pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pkg_chk Update pkg_chk to 1.52:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/f9a4e13f8edc
branches:  trunk
changeset: 484898:f9a4e13f8edc
user:      abs <abs%pkgsrc.org@localhost>
date:      Tue Nov 30 19:32:10 2004 +0000

description:
Update pkg_chk to 1.52:
        Tags starting with '/' are checked for as readable files

diffstat:

 pkgtools/pkg_chk/Makefile         |   4 ++--
 pkgtools/pkg_chk/files/pkg_chk.8  |  14 +++++++++-----
 pkgtools/pkg_chk/files/pkg_chk.sh |  32 ++++++++++++++------------------
 3 files changed, 25 insertions(+), 25 deletions(-)

diffs (121 lines):

diff -r 7bba5d110897 -r f9a4e13f8edc pkgtools/pkg_chk/Makefile
--- a/pkgtools/pkg_chk/Makefile Tue Nov 30 18:29:40 2004 +0000
+++ b/pkgtools/pkg_chk/Makefile Tue Nov 30 19:32:10 2004 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.8 2004/09/03 10:19:17 abs Exp $
+# $NetBSD: Makefile,v 1.9 2004/11/30 19:32:10 abs Exp $
 
-DISTNAME=      pkg_chk-1.51
+DISTNAME=      pkg_chk-1.52
 CATEGORIES=    pkgtools
 MASTER_SITES=  # empty
 DISTFILES=     # empty
diff -r 7bba5d110897 -r f9a4e13f8edc pkgtools/pkg_chk/files/pkg_chk.8
--- a/pkgtools/pkg_chk/files/pkg_chk.8  Tue Nov 30 18:29:40 2004 +0000
+++ b/pkgtools/pkg_chk/files/pkg_chk.8  Tue Nov 30 19:32:10 2004 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: pkg_chk.8,v 1.3 2004/11/17 16:27:20 wiz Exp $
+.\"    $NetBSD: pkg_chk.8,v 1.4 2004/11/30 19:32:10 abs Exp $
 .\"
 .\" Copyright (c) 2001 by David Brownlee (abs%NetBSD.org@localhost)
 .\" Absolutely no warranty.
@@ -148,6 +148,10 @@
 .Em *
 matches any tag.
 .It
+If a tag starts with an
+.Em /
+then it is checked for as a readable filename.
+.It
 Tags cannot contain a hypen
 .Sq -
 or plus
@@ -157,18 +161,18 @@
 .Dq or .
 .Dq taga tagb
 means if
-.Em tag_a
+.Em taga
 or
-.Em tag_b
+.Em tagb
 match the current machine.
 .It
 Tags separated by a plus are treated as
 .Dq and .
 .Dq taga+tagb
 means if
-.Em tag_a
+.Em taga
 and
-.Em tag_b
+.Em tagb
 match the current machine.
 .El
 .Pp
diff -r 7bba5d110897 -r f9a4e13f8edc pkgtools/pkg_chk/files/pkg_chk.sh
--- a/pkgtools/pkg_chk/files/pkg_chk.sh Tue Nov 30 18:29:40 2004 +0000
+++ b/pkgtools/pkg_chk/files/pkg_chk.sh Tue Nov 30 19:32:10 2004 +0000
@@ -1,6 +1,6 @@
 #!@SH@ -e
 #
-# $Id: pkg_chk.sh,v 1.8 2004/09/03 10:19:17 abs Exp $
+# $Id: pkg_chk.sh,v 1.9 2004/11/30 19:32:10 abs Exp $
 #
 # TODO: Handle updates with dependencies via binary packages
 
@@ -384,6 +384,7 @@
 
 test -n "$MAKE" || MAKE="@MAKE@"
 test -n "$MAKECONF" || MAKECONF="@MAKECONF@"
+
 if [ ! -f $MAKECONF ] ; then
     if [ -f /etc/mk.conf ] ; then
        MAKECONF=/etc/mk.conf
@@ -474,12 +475,17 @@
 
        taglist["*"] = "*"
     }
-    function and_expr_with_dict(expr, dict, ary, i, r) {
+    function and_expr_with_dict(expr, dict, ary, i, r, d) {
        split(expr,ary,/\+/);
        r = 1;
-       for (i in ary)
-               if (! (ary[i] in dict))
+       for (i in ary) {
+               if (ary[i] ~ /^\//) {
+                       if (getline d < ary[i] == -1)
+                           { r = 0; break ;}
+               }
+               else if (! (ary[i] in dict))
                        { r = 0; break ;}
+       }
        return r;
     }
     {
@@ -489,21 +495,11 @@
     need = 0;
     for (f = 1 ; f<=NF ; ++f) {                        # For each word on the line
        if (sub("^-", "", $f)) {        # If it begins with a '-'
-               if ($f ~ /\+/) {        # If it is a ANDed tag expression
-                       if (and_expr_with_dict($f, taglist))
-                               next;           # If it is true, discard
-               } else {                        # If it is a simple tag
-                       if ($f in taglist)      # If match, discard
-                               next;
-               }
+               if (and_expr_with_dict($f, taglist))
+                       next;           # If it is true, discard
        } else {
-               if ($f ~ /\+/) {        # If it is a ANDed tag expression
-                       if (and_expr_with_dict($f, taglist))
-                               need = 1;       # If it is true, note needed
-               } else {                        # If it is a simple tag
-                       if ($f in taglist)      # If match, note needed
-                               need = 1;
-               }
+               if (and_expr_with_dict($f, taglist))
+                       need = 1;       # If it is true, note needed
        }
     }
     if (NF == 1 || need)



Home | Main Index | Thread Index | Old Index