diff options
author | abs <abs@pkgsrc.org> | 2003-09-16 14:36:08 +0000 |
---|---|---|
committer | abs <abs@pkgsrc.org> | 2003-09-16 14:36:08 +0000 |
commit | c7fc8393206c4fdd67d1c1322a9abc81b28d3832 (patch) | |
tree | 56b81f8cc317d7b90cca99294fbee6df556214b1 /pkgtools | |
parent | a599ed4e3118c6aafd81c961bead296ef198dcd7 (diff) | |
download | pkgsrc-c7fc8393206c4fdd67d1c1322a9abc81b28d3832.tar.gz |
Update pkgchk to 1.41:
Implement '-L logfile' which redirect the output of any commands run
into the logfile, displaying the tail end on any errors.
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkgchk/Makefile | 4 | ||||
-rw-r--r-- | pkgtools/pkgchk/files/pkgchk.8 | 7 | ||||
-rwxr-xr-x | pkgtools/pkgchk/files/pkgchk.sh | 20 |
3 files changed, 25 insertions, 6 deletions
diff --git a/pkgtools/pkgchk/Makefile b/pkgtools/pkgchk/Makefile index 6dc81b6bf58..a9cdcfe9384 100644 --- a/pkgtools/pkgchk/Makefile +++ b/pkgtools/pkgchk/Makefile @@ -1,6 +1,6 @@ -# $NetBSD: Makefile,v 1.44 2003/09/10 19:12:52 jmmv Exp $ +# $NetBSD: Makefile,v 1.45 2003/09/16 14:36:08 abs Exp $ -DISTNAME= pkgchk-1.40 +DISTNAME= pkgchk-1.41 WRKSRC= ${WRKDIR} CATEGORIES= pkgtools MASTER_SITES= # empty diff --git a/pkgtools/pkgchk/files/pkgchk.8 b/pkgtools/pkgchk/files/pkgchk.8 index f216b93967b..a223b0617ae 100644 --- a/pkgtools/pkgchk/files/pkgchk.8 +++ b/pkgtools/pkgchk/files/pkgchk.8 @@ -1,4 +1,4 @@ -.\" $NetBSD: pkgchk.8,v 1.14 2003/09/10 19:04:53 jmmv Exp $ +.\" $NetBSD: pkgchk.8,v 1.15 2003/09/16 14:36:10 abs Exp $ .\" .\" Copyright (c) 2001 by David Brownlee (abs@netbsd.org) .\" Absolutely no warranty. @@ -37,6 +37,11 @@ Use the pkgchk.conf file Add the comma separated list of tags to those checked when parsing pkgchk.conf. Also includes .Ev PKGCHK_TAGS . +.It Fl L Ar file +Redirect the output for all commands run into the logfile +.Pa file . +Should be specified as a full pathname. On any error the tail end of the +logfile will be displayed. .It Fl U Ar tags Remove the comma separated list of tags from those checked when parsing pkgchk.conf. Also includes diff --git a/pkgtools/pkgchk/files/pkgchk.sh b/pkgtools/pkgchk/files/pkgchk.sh index 3c84def32a9..70c4832a45b 100755 --- a/pkgtools/pkgchk/files/pkgchk.sh +++ b/pkgtools/pkgchk/files/pkgchk.sh @@ -1,6 +1,6 @@ #!/bin/sh -e # -# $Id: pkgchk.sh,v 1.43 2003/09/10 19:12:55 jmmv Exp $ +# $Id: pkgchk.sh,v 1.44 2003/09/16 14:36:12 abs Exp $ # # TODO: Handle updates with dependencies via binary packages @@ -227,9 +227,16 @@ run_cmd() fi echo $1 if [ -z "$opt_n" ];then - sh -c "$1" || FAIL=1 + if [ -n "$opt_L" ] ; then + sh -c "$1" > "$opt_L" 2>&1 || FAIL=1 + else + sh -c "$1" || FAIL=1 + fi if [ -n "$FAIL" ] ; then echo "** '$1' failed" + if [ -n "$opt_L" ] ; then + tail -20 "$opt_L" + fi if [ "$FAILOK" != 1 ]; then exit 1 fi @@ -237,7 +244,7 @@ run_cmd() fi } -args=`getopt BC:D:U:abcfhiknrsuv $*` +args=`getopt BC:D:L:U:abcfhiknrsuv $*` if [ $? != 0 ]; then opt_h=1 fi @@ -247,6 +254,7 @@ while [ $# != 0 ]; do -B ) opt_B=1 ; opt_i=1 ;; -C ) opt_C="$2" ; shift;; -D ) opt_D="$2" ; shift;; + -L ) opt_L="$2" ; shift;; -U ) opt_U="$2" ; shift;; -a ) opt_a=1 ; opt_c=1 ;; -b ) opt_b=1 ;; @@ -280,6 +288,7 @@ if [ -n "$opt_h" -o $# != 1 ];then -B Check the "Build version" of packages (implies -i) -C conf Use pkgchk.conf file 'conf' -D tags Comma separated list of additional pkgchk.conf tags to set + -L file Redirect output from commands run into file (should be fullpath) -U tags Comma separated list of pkgchk.conf tags to unset -a Add all missing packages (implies -c) -b Limit installations to binary packages @@ -329,6 +338,10 @@ else ac_n= ac_c='\c' ac_t= fi +if [ -n "$opt_L" ] ; then + rm -f $opt_L +fi + extract_variables if [ -n "$opt_C" ] ; then PKGCHK_CONF=$opt_C @@ -341,6 +354,7 @@ if [ -n "$opt_i" ];then PKGDIRLIST=`sh -c "${PKG_INFO} -B \*" | ${AWK} -F= '/PKGPATH=/{print $2" "}'` fi + if [ -n "$opt_c" ];then if [ ! -r $PKGCHK_CONF ];then |