diff options
author | abs <abs@pkgsrc.org> | 2005-09-27 17:13:03 +0000 |
---|---|---|
committer | abs <abs@pkgsrc.org> | 2005-09-27 17:13:03 +0000 |
commit | c413838a65aa9d76c9293d3bb6f5e71fc0d49826 (patch) | |
tree | 29a12a97e1bd1e3dcac1998b4004eb0c8265d765 /pkgtools/pkg_chk | |
parent | 087bc54521ddd2da49058ebed7fc2b95f4a46924 (diff) | |
download | pkgsrc-c413838a65aa9d76c9293d3bb6f5e71fc0d49826.tar.gz |
Update pkg_chk to 1.62:
+ Implement defining tag groups in pkgchk.conf. For example
"mailserver = tll gta tycoon jeeves iris"
+ If the first tag on a line starts with a '-', there is now an
implicit '*' before it
+ -B no longer implies -i
Diffstat (limited to 'pkgtools/pkg_chk')
-rw-r--r-- | pkgtools/pkg_chk/Makefile | 4 | ||||
-rw-r--r-- | pkgtools/pkg_chk/files/pkg_chk.8 | 50 | ||||
-rwxr-xr-x | pkgtools/pkg_chk/files/pkg_chk.sh | 32 |
3 files changed, 64 insertions, 22 deletions
diff --git a/pkgtools/pkg_chk/Makefile b/pkgtools/pkg_chk/Makefile index 1a9a9f013c4..a1d4f73845c 100644 --- a/pkgtools/pkg_chk/Makefile +++ b/pkgtools/pkg_chk/Makefile @@ -1,6 +1,6 @@ -# $NetBSD: Makefile,v 1.19 2005/09/11 10:39:03 abs Exp $ +# $NetBSD: Makefile,v 1.20 2005/09/27 17:13:03 abs Exp $ -DISTNAME= pkg_chk-1.61 +DISTNAME= pkg_chk-1.62 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 ba3fdc501aa..54d56a59830 100644 --- a/pkgtools/pkg_chk/files/pkg_chk.8 +++ b/pkgtools/pkg_chk/files/pkg_chk.8 @@ -1,9 +1,9 @@ -.\" $NetBSD: pkg_chk.8,v 1.11 2005/06/01 11:38:45 wiz Exp $ +.\" $NetBSD: pkg_chk.8,v 1.12 2005/09/27 17:13:03 abs Exp $ .\" .\" Copyright (c) 2001 by David Brownlee (abs@NetBSD.org) .\" Absolutely no warranty. .\" -.Dd June 1, 2005 +.Dd September 27, 2005 .Dt PKG_CHK 1 .Sh NAME .Nm pkg_chk @@ -28,7 +28,7 @@ When updating packages that depend on each other .Nm will skip dependent packages to reduce unnecessary rebuilding. .Pp -.Sy Options +.Ss Options .Bl -tag -width xxxxxxxx .It Fl a Automatically add any missing packages. @@ -160,12 +160,29 @@ Verbose - list the tags set when checking and all packages checked. .El .Sh FILE FORMAT -Each non comment line in +Anything after a '#' on a line is considered a comment. + +Each line in .Pa pkgchk.conf -should contain a package -directory (such as sysutils/skill) followed by an optional list of -tags. -Tags are checked against the current machine's set: +can either define a new tag or a package directory +(such as sysutils/skill), in each case followed by a list of tags. +.Ss New tag groups +Lines that define a new tag can be used to group tags to avoid +repeating the same set of tags for multiple packages. +For example: + +.Dl mailserver \= tll gta tycoon jeeves iris + +would cause the mailserver tag to be set for any of the listed hosts. +Note that the tags after the +.Sq = +are parsed with the same set of tag +evaluation rules as those after package definitions (see later). +.Ss Package definition lines +Package directory lines are used to determine which packages are to be +installed, checking the tags against the current defined set. +.Ss Tag evaulation +Tags on package directory are checked against the current machine's set: .Bl -bullet .It If a matched tag starts with a hyphen @@ -177,11 +194,11 @@ Otherwise if any tags match the package will be included. A line without any tags matches all machines. .It An asterisk -.Em * +.Sq * matches any tag. .It If a tag starts with an -.Em / +.Sq / then it is checked for as a readable filename. .It Tags cannot contain a hyphen @@ -299,9 +316,18 @@ Sample .Pa pkgchk.conf file: .Bd -literal -# Must install before others + +mailserver = tll gta tycoon jeeves iris + +# Install before others devel/cpuflags -pkgtools/xpkgwedge x11 +pkgtools/pkg_chk + +# Mail related +mail/exim * +mail/spamassassin mailserver +mail/cyrus-imapd mailserver +mail/procmail mailserver bobhost shells/standalone-tcsh * wm/pwm /etc/X11/XF86Config diff --git a/pkgtools/pkg_chk/files/pkg_chk.sh b/pkgtools/pkg_chk/files/pkg_chk.sh index 1533376e6e7..3e242aa353e 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.19 2005/09/11 10:39:03 abs Exp $ +# $Id: pkg_chk.sh,v 1.20 2005/09/27 17:13:03 abs Exp $ # # TODO: Make -g check dependencies and tsort # TODO: Variation of -g which only lists top level packages @@ -250,7 +250,7 @@ list_packages() fi for dep in $DEPLIST ; do if [ ! -f $PACKAGES/$dep.tgz ] ; then - fatal_maybe " ** $dep.tgz - binary package dependency missing" + fatal_maybe " ** $dep.tgz - dependency missing for $pkg" break 2 fi PAIRLIST="${PAIRLIST}$dep.tgz $pkg.tgz\n" @@ -340,10 +340,23 @@ pkgdirs_from_conf() { sub("#.*", ""); if (skip[$1]) - { next; } + next; need = 0; - for (f = 1 ; f<=NF ; ++f) { # For each word on the line + if ($0 ~ /=/) { + split($0, tmp, "[ \t]*="); + taggroup = tmp[1]; + sub("[ \t]*=", "="); + } + else + { + taggroup = "" + if (NF == 1) # If only one arg, we want pkg + need = 1; + } + for (f = 2 ; f<=NF ; ++f) { # For each word on the line if (sub("^-", "", $f)) { # If it begins with a '-' + if (f == 2) # If first entry '-', assume '*' + { need = 1; } if (and_expr_with_dict($f, taglist)) next; # If it is true, discard } else { @@ -351,8 +364,11 @@ pkgdirs_from_conf() need = 1; # If it is true, note needed } } - if (NF == 1 || need) - { print $1 } + if (need) + if (taggroup) + taglist[taggroup] = 1 + else + print $1; } ' < $CONF ) @@ -496,7 +512,7 @@ usage() fi echo 'Usage: pkg_chk [opts] -a Add all missing packages (implies -c) - -B Check the "Build version" of packages (implies -i) + -B Check the "Build version" of packages -b Install binary packages -C conf Use pkgchk.conf file 'conf' -c Check installed packages against pkgchk.conf @@ -543,7 +559,7 @@ set -- $args while [ $# != 0 ]; do case "$1" in -a ) opt_a=1 ; opt_c=1 ;; - -B ) opt_B=1 ; opt_i=1 ;; + -B ) opt_B=1 ;; -b ) opt_b=1 ;; -C ) opt_C="$2" ; shift;; -c ) opt_c=1 ;; |