diff options
author | abs <abs> | 2001-10-10 09:55:31 +0000 |
---|---|---|
committer | abs <abs> | 2001-10-10 09:55:31 +0000 |
commit | 845a27deb8c478b226634120f3f9a239adee1296 (patch) | |
tree | 0c32add8c34459ce0e37ade21bf0c5f8fd7cbb19 /pkgtools/pkgchk | |
parent | 86501732fa01b284a6b3501f0a8a4ab06eac7d56 (diff) | |
download | pkgsrc-845a27deb8c478b226634120f3f9a239adee1296.tar.gz |
Update pkgchk to 1.18:
Changes from Stoned Elipot to permit setting additional tags in mk.conf
or similar, plus handling and tags (eg: 'x11/acroread x11+i386').
Also expand the manpage slightly and give some examples.
Diffstat (limited to 'pkgtools/pkgchk')
-rw-r--r-- | pkgtools/pkgchk/Makefile | 4 | ||||
-rw-r--r-- | pkgtools/pkgchk/files/pkgchk.8 | 63 | ||||
-rwxr-xr-x | pkgtools/pkgchk/files/pkgchk.sh | 56 |
3 files changed, 95 insertions, 28 deletions
diff --git a/pkgtools/pkgchk/Makefile b/pkgtools/pkgchk/Makefile index 2025304c920..7ef25fcc3e4 100644 --- a/pkgtools/pkgchk/Makefile +++ b/pkgtools/pkgchk/Makefile @@ -1,6 +1,6 @@ -# $NetBSD: Makefile,v 1.18 2001/10/01 12:24:00 abs Exp $ +# $NetBSD: Makefile,v 1.19 2001/10/10 09:55:31 abs Exp $ -DISTNAME= pkgchk-1.17 +DISTNAME= pkgchk-1.18 CATEGORIES= pkgtools MASTER_SITES= # empty DISTFILES= # empty diff --git a/pkgtools/pkgchk/files/pkgchk.8 b/pkgtools/pkgchk/files/pkgchk.8 index e4aef21d828..84680ed38bb 100644 --- a/pkgtools/pkgchk/files/pkgchk.8 +++ b/pkgtools/pkgchk/files/pkgchk.8 @@ -1,4 +1,4 @@ -.\" $NetBSD: pkgchk.8,v 1.6 2001/09/27 21:13:46 abs Exp $ +.\" $NetBSD: pkgchk.8,v 1.7 2001/10/10 09:55:32 abs Exp $ .\" .\" Copyright (c) 2001 by David Brownlee (abs@netbsd.org) .\" Absolutely no warranty. @@ -31,10 +31,12 @@ will skip dependent packages to reduce unnecessary rebuilding. Check the "Build version" (see option -b of pkg_info(1)) of packages. .It Fl D Ar tags Add the comma separated list of tags to those checked when parsing -pkgchk.conf. +pkgchk.conf. Also includes +.Ev PKGCHK_TAGS . .It Fl U Ar tags Remove the comma separated list of tags from those checked when -parsing pkgchk.conf. +parsing pkgchk.conf. Also includes +.Ev PKGCHK_NOTAGS . .It Fl a Automatically add any missing packages. If a binary package exists in @@ -78,18 +80,39 @@ options are given. Note: If the update fails (particularly when building from source), the system will be left with missing packaged. .It Fl v -Verbose - list the tags set, and all packages checked. +Verbose - list the tags set when checking pkgchk.conf, and all packages checked. .El .Sh FILE FORMAT .Pp Each non comment line in pkgsrc.conf should contain a package directory (such as sysutils/skill) followed by an optional list of -tags. If a tag starts with a hyphen (-), then any machine matching -will be excluded, otherwise if any tags match the current machine -the package will be included. A line with a package directory -without any tags, or the tag +tags. Tags are checked against the current machine's set: +.Bl -bullet +.It +If a matched tag starts with a hyphen '-', the package is always excluded. +.It +Otherwise if any tags match the package will be included. +.It +A line without any tags matches all machines. +.It +An asterisk .Em * -will match all machines. +matches any tag. +.It +Tags cannot contain a hypen '-' or plus '+'. +.It +Tags separated by spaces are treated as 'or'. 'taga tagb' means if +.Em tag_a +or +.Em tag_b +match the current machine. +.It +Tags separated by a plus are treated as 'and'. 'taga+tagb' means if +.Em tag_a +and +.Em tag_b +match the current machine. +.El .Pp The default set of tags used to determine which packages to match in pkgsrc.conf are equivalent to the output of the following with any spaces @@ -100,6 +123,7 @@ or is present, .Em x11 is added to the list of tags. +Tags should not contain the - or + characters. To see tags for the current machine, run .Nm with the @@ -143,9 +167,28 @@ then read from .Pa /etc/mk.conf . Defaults to .Pa ${PKGSRCDIR}/pkgchk.conf . +.It Ev PKGCHK_TAGS +Additional tags to add when parsing pkgchk.conf. +.It Ev PKGCHK_NOTAGS +Additional tags to unset when parsing pkgchk.conf. .El +.Sh EXAMPLES +Sample pkgchk.conf file: +.Bd -literal +# Must install before others +devel/cpuflags +pkgtools/xpkgwedge x11 + +shells/standalone-tcsh * +wm/pwm x11 +misc/setiathome i386 +print/acroread x11+i386 +www/communicator x11+sparc x11+sparc64 +www/navigator x11+i386 +x11/xlockmore x11 -wopr +.Ed .Sh AUTHOR -David Brownlee <abs@netbsd.org> +David Brownlee <abs@netbsd.org>, plus much from Stoned Elipot. .Sh CAVEATS Updating packages on which other packages depend can currently only be done via source (not binary packages). diff --git a/pkgtools/pkgchk/files/pkgchk.sh b/pkgtools/pkgchk/files/pkgchk.sh index 57958389c12..7e7c9e5b3d4 100755 --- a/pkgtools/pkgchk/files/pkgchk.sh +++ b/pkgtools/pkgchk/files/pkgchk.sh @@ -1,8 +1,7 @@ #!/bin/sh -e # -# $Id: pkgchk.sh,v 1.20 2001/10/01 12:24:00 abs Exp $ +# $Id: pkgchk.sh,v 1.21 2001/10/10 09:55:32 abs Exp $ # -# TODO: Handle and as well as or tags (eg: i386+x11) # TODO: Handle updates with dependencies via binary packages PATH=/usr/sbin:${PATH} @@ -40,10 +39,11 @@ extract_variables() fi # Now we have PKGSRCDIR, use it to determine PACKAGES, and PKGCHK_CONF + # as well as AWK, GREP, SED, PKGCHK_TAGS and PKGCHK_NOTAGS # cd $PKGSRCDIR/pkgtools/pkgchk - extract_make_vars AWK GREP SED PACKAGES PKGCHK_CONF + extract_make_vars AWK GREP SED PACKAGES PKGCHK_CONF PKGCHK_TAGS PKGCHK_NOTAGS if [ -z "$PACKAGES" ];then PACKAGES=$PKGSRCDIR/packages @@ -235,6 +235,16 @@ if [ -n "$opt_c" ];then if [ -f /usr/X11R6/lib/libX11.so -o -f /usr/X11R6/lib/libX11.a ];then TAGS="$TAGS,x11" fi + if [ -n "$PKGCHK_TAGS" ];then + TAGS="$TAGS,$PKGCHK_TAGS" + fi + if [ -n "$PKGCHK_NOTAGS" ];then + if [ -n "$opt_U" ];then + opt_U="$opt_U,$PKGCHK_NOTAGS" + else + opt_U="$PKGCHK_NOTAGS" + fi + fi if [ -n "$opt_D" ];then TAGS="$TAGS,$opt_D" fi @@ -257,25 +267,39 @@ if [ -n "$opt_c" ];then for (tag in tmp) { delete taglist[tmp[tag]] } taglist["*"] = "*" - } + } + function and_expr_with_dict(expr, dict, ary, i, r) { + split(expr,ary,/\\+/); + r = 1; + for (i in ary) + if (! (ary[i] in dict)) + { r = 0; break ;} + return r; + } { sub("#.*", ""); if (alreadyset[$1]) { next; } need = 0; - for (f = 1 ; f<=NF ; ++f) # For each word on the line - { - if (sub("^-", "", $f)) # If it begins with a '-' - { - if ($f in taglist) # If match, discard - { next; } - } - else - { - if ($f in taglist) # If match, note needed - { need = 1; } - } + 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; + } + } 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 (NF == 1 || need) { print $1 } } |