pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc update pkg_chk to 1.73:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/a75b60476397
branches:  trunk
changeset: 514075:a75b60476397
user:      abs <abs%pkgsrc.org@localhost>
date:      Wed Jun 07 13:52:39 2006 +0000

description:
update pkg_chk to 1.73:
- Handle new way of building BUILD_VERSION, by doing less ourselves
  and (ab)using the pkgsrc infrastrafructure. Jump through some
  hoops to ensure a package is not reported as different due to
  BUILD_VERSION format versions (assuming the package is identical
  otherwise). Only -B affected.

diffstat:

 doc/CHANGES-2006                  |   3 +-
 pkgtools/pkg_chk/Makefile         |   4 +-
 pkgtools/pkg_chk/files/pkg_chk.sh |  64 ++++++++++++++++++--------------------
 3 files changed, 35 insertions(+), 36 deletions(-)

diffs (153 lines):

diff -r 62ddd891e8f9 -r a75b60476397 doc/CHANGES-2006
--- a/doc/CHANGES-2006  Wed Jun 07 13:03:59 2006 +0000
+++ b/doc/CHANGES-2006  Wed Jun 07 13:52:39 2006 +0000
@@ -1,4 +1,4 @@
-$NetBSD: CHANGES-2006,v 1.441 2006/06/07 12:04:36 abs Exp $
+$NetBSD: CHANGES-2006,v 1.442 2006/06/07 13:53:15 abs Exp $
 
 Changes to the packages collection and infrastructure in 2006:
 
@@ -2947,3 +2947,4 @@
        Added time/p5-DateTime-Format-ISO8601-0.0403 [abs 2006-06-07]
        Added time/p5-DateTime-Format-Strptime-1.0700 [abs 2006-06-07]
        Added www/p5-FCGI-ProcManager-0.17 [abs 2006-06-07]
+       Updated pkgtools/pkg_chk to 1.73 [abs 2006-06-07]
diff -r 62ddd891e8f9 -r a75b60476397 pkgtools/pkg_chk/Makefile
--- a/pkgtools/pkg_chk/Makefile Wed Jun 07 13:03:59 2006 +0000
+++ b/pkgtools/pkg_chk/Makefile Wed Jun 07 13:52:39 2006 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.32 2006/05/04 22:08:05 dillo Exp $
+# $NetBSD: Makefile,v 1.33 2006/06/07 13:52:39 abs Exp $
 
-DISTNAME=      pkg_chk-1.72
+DISTNAME=      pkg_chk-1.73
 CATEGORIES=    pkgtools
 MASTER_SITES=  # empty
 DISTFILES=     # empty
diff -r 62ddd891e8f9 -r a75b60476397 pkgtools/pkg_chk/files/pkg_chk.sh
--- a/pkgtools/pkg_chk/files/pkg_chk.sh Wed Jun 07 13:03:59 2006 +0000
+++ b/pkgtools/pkg_chk/files/pkg_chk.sh Wed Jun 07 13:52:39 2006 +0000
@@ -1,6 +1,6 @@
 #!@SH@ -e
 #
-# $Id: pkg_chk.sh,v 1.33 2006/05/04 22:08:05 dillo Exp $
+# $Id: pkg_chk.sh,v 1.34 2006/06/07 13:52:39 abs Exp $
 #
 # TODO: Make -g check dependencies and tsort
 # TODO: Variation of -g which only lists top level packages
@@ -65,8 +65,9 @@
            msg
        else
            if [ -n "$opt_B" ];then
-               current_build_ver=$(get_build_ver)
-               installed_build_ver=$(${SED} "s|^[^:]*/[^:]*:||" $PKG_DBDIR/$PKGNAME/+BUILD_VERSION)
+               # sort here temporarily to handle older +BUILD_VERSION
+               current_build_ver=$(get_build_ver | ${SED} "s|.*\$NetBSD: pkg_chk.sh,v 1.34 2006/06/07 13:52:39 abs Exp ${SORT} -u)
+               installed_build_ver=$(${SED} "s|.*\$NetBSD: pkg_chk.sh,v 1.34 2006/06/07 13:52:39 abs Exp $PKG_DBDIR/$PKGNAME/+BUILD_VERSION | ${SORT} -u)
                if [ x"$current_build_ver" != x"$installed_build_ver" ];then
                    msg "$PKGNAME: build-version mismatch"
                    verbose "--current--"
@@ -85,6 +86,13 @@
     done
     }
 
+cleanup_and_exit()
+    {
+    rm -f $TMPFILE
+    rmdir $TMPDIR
+    exit "$@"
+    }
+
 delete_pkgs()
     {
     for pkg in $* ; do
@@ -189,14 +197,15 @@
 fatal()
     {
     msg "*** $@"
-    exit 1
+    cleanup_and_exit 1
     }
 
 fatal_maybe()
     {
-    msg "$@"
     if [ -z "$opt_k" ];then
-       exit 1
+       fatal "@"
+    else
+       msg "$@"
     fi
     }
 
@@ -213,32 +222,14 @@
 get_build_ver()
     {
     if [ -n "$opt_b" -a -z "$opt_s" ] ; then
-       ${PKG_INFO} -. -q -b $PACKAGES/$PKGNAME.tgz | ${SED} "s|^[^:]*/[^:]*:||" | ${GREP} .
+       ${PKG_INFO} -. -q -b $PACKAGES/$PKGNAME.tgz | ${GREP} .
        return
     fi
-    files=""
-    for f in Makefile ${FILESDIR}/* ${PKGDIR}/*; do
-       if [ -f $f ];then
-           files="$files $f"
-       fi
-    done
-    if [ -f ${DISTINFO_FILE} ]; then
-       for f in $(${AWK} 'NF == 4 && $3 == "=" { gsub("[()]", "", $2); print $2 }' < ${DISTINFO_FILE}); do 
-           if [ -f ${PATCHDIR}/$f ]; then
-               files="$files ${PATCHDIR}/$f";
-           fi;
-       done
-    fi
-    if [ -d ${PATCHDIR} ]; then
-       for f in ${PATCHDIR}/patch-*; do
-           case $f in
-           *.orig|*.rej|*~) ;;
-           ${PATCHDIR}/patch-local-*)
-               files="$files $f" ;;
-           esac
-       done
-    fi
-    cat $files | ${GREP} '\$NetBSD'
+    # Unfortunately pkgsrc always outputs to a file, but it does helpfully
+    # allows # us to specify the name
+    rm -f $TMPFILE
+    ${MAKE} _BUILD_VERSION_FILE=$TMPFILE $TMPFILE
+    cat $TMPFILE
     }
 
 list_packages()
@@ -523,7 +514,7 @@
                        tail -40
            fi
             if [ "$FAILOK" != 1 ]; then
-                exit 1
+                fatal "** '$1' failed"
             fi
         fi
     fi
@@ -634,6 +625,9 @@
     usage
 fi
 
+TMPDIR=`mktemp -d /tmp/${0##*/}.XXXXXX`
+TMPFILE=$TMPDIR/tmp
+
 # Hide PKG_PATH to avoid breakage in 'make' calls
 saved_PKG_PATH=$PKG_PATH
 unset PKG_PATH || true
@@ -801,6 +795,10 @@
 
 [ -n "$MISS_DONE" ] &&         msg "Missing:$MISS_DONE"
 [ -n "$INSTALL_DONE" ] &&      msg "Installed:$INSTALL_DONE"
-[ -n "$FAIL_DONE" ] &&         msg "Failed:$FAIL_DONE"
 
-[ -z "$FAIL_DONE" ]
+if [ -n "$FAIL_DONE" ] ; then
+   msg "Failed:$FAIL_DONE"
+   cleanup_and_exit 1
+fi
+
+cleanup_and_exit



Home | Main Index | Thread Index | Old Index