summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorabs <abs@pkgsrc.org>2004-11-30 19:32:10 +0000
committerabs <abs@pkgsrc.org>2004-11-30 19:32:10 +0000
commit984249aa27ed44b5052478f209786aa87f0b2df8 (patch)
treead413e77a53ba05f6f86a7166334978ae56bc4ab /pkgtools
parent38d0b928748ef9174f24da5cc3e1115585cc7afc (diff)
downloadpkgsrc-984249aa27ed44b5052478f209786aa87f0b2df8.tar.gz
Update pkg_chk to 1.52:
Tags starting with '/' are checked for as readable files
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkg_chk/Makefile4
-rw-r--r--pkgtools/pkg_chk/files/pkg_chk.814
-rwxr-xr-xpkgtools/pkg_chk/files/pkg_chk.sh32
3 files changed, 25 insertions, 25 deletions
diff --git a/pkgtools/pkg_chk/Makefile b/pkgtools/pkg_chk/Makefile
index 0479ee3f7c6..b2e1a8a99ba 100644
--- a/pkgtools/pkg_chk/Makefile
+++ b/pkgtools/pkg_chk/Makefile
@@ -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 --git a/pkgtools/pkg_chk/files/pkg_chk.8 b/pkgtools/pkg_chk/files/pkg_chk.8
index 5ff4cf7c910..f97036627e5 100644
--- a/pkgtools/pkg_chk/files/pkg_chk.8
+++ b/pkgtools/pkg_chk/files/pkg_chk.8
@@ -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)
.\" Absolutely no warranty.
@@ -148,6 +148,10 @@ An asterisk
.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 @@ Tags separated by spaces are treated as
.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 --git a/pkgtools/pkg_chk/files/pkg_chk.sh b/pkgtools/pkg_chk/files/pkg_chk.sh
index f417615540c..bb61d43aaf1 100755
--- a/pkgtools/pkg_chk/files/pkg_chk.sh
+++ b/pkgtools/pkg_chk/files/pkg_chk.sh
@@ -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 @@ unset PKG_PATH || true
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 @@ if [ -n "$opt_c" -o -n "$opt_l" ];then
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 @@ if [ -n "$opt_c" -o -n "$opt_l" ];then
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)