pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkg_chk Update pkg_chk to 1.81 - Add support ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/dd9506f33fe6
branches:  trunk
changeset: 518872:dd9506f33fe6
user:      abs <abs%pkgsrc.org@localhost>
date:      Wed Sep 20 21:54:13 2006 +0000

description:
Update pkg_chk to 1.81 - Add support for PKG_SUFX = .tbz - from Aleksey Cheusov in PR/34453

diffstat:

 pkgtools/pkg_chk/Makefile         |   6 +++---
 pkgtools/pkg_chk/files/pkg_chk.sh |  29 ++++++++++++++++-------------
 2 files changed, 19 insertions(+), 16 deletions(-)

diffs (127 lines):

diff -r d6fa67f6b7ff -r dd9506f33fe6 pkgtools/pkg_chk/Makefile
--- a/pkgtools/pkg_chk/Makefile Wed Sep 20 19:54:51 2006 +0000
+++ b/pkgtools/pkg_chk/Makefile Wed Sep 20 21:54:13 2006 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.43 2006/08/25 19:49:53 abs Exp $
+# $NetBSD: Makefile,v 1.44 2006/09/20 21:54:13 abs Exp $
 
-DISTNAME=      pkg_chk-1.80
+DISTNAME=      pkg_chk-1.81
 CATEGORIES=    pkgtools
 MASTER_SITES=  # empty
 DISTFILES=     # empty
@@ -19,7 +19,7 @@
 
 CONFLICTS=     pkgchk-[0-9]*
 
-INSTALLATION_DIRS=     sbin man/man8
+INSTALLATION_DIRS=     sbin ${PKGMANDIR}/man8
 
 .include "../../mk/bsd.prefs.mk"
 
diff -r d6fa67f6b7ff -r dd9506f33fe6 pkgtools/pkg_chk/files/pkg_chk.sh
--- a/pkgtools/pkg_chk/files/pkg_chk.sh Wed Sep 20 19:54:51 2006 +0000
+++ b/pkgtools/pkg_chk/files/pkg_chk.sh Wed Sep 20 21:54:13 2006 +0000
@@ -1,6 +1,6 @@
 #!@SH@ -e
 #
-# $Id: pkg_chk.sh,v 1.41 2006/08/25 19:49:54 abs Exp $
+# $Id: pkg_chk.sh,v 1.42 2006/09/20 21:54:13 abs Exp $
 #
 # TODO: Make -g check dependencies and tsort
 # TODO: Variation of -g which only lists top level packages
@@ -23,7 +23,7 @@
         done
        return 1;
     else
-       if [ -f "$PACKAGES/$1.tgz" ]; then
+       if [ -f "$PACKAGES/$1$PKG_SUFX" ]; then
            return 0;
        else
            return 1;
@@ -175,18 +175,21 @@
        cd $PKGSRCDIR/pkgtools/pkg_chk
        extract_make_vars Makefile AWK GREP GZIP_CMD SED SORT TSORT PACKAGES \
                        PKG_ADD PKG_DELETE PKG_INFO PKG_DBDIR PKGCHK_CONF \
-                       PKGCHK_UPDATE_CONF PKGCHK_TAGS PKGCHK_NOTAGS
+                       PKGCHK_UPDATE_CONF PKGCHK_TAGS PKGCHK_NOTAGS PKG_SUFX
        if [ -z "$PACKAGES" ];then
            PACKAGES=$PKGSRCDIR/packages
        fi
     elif [ $MAKECONF != /dev/null ] ; then
        extract_make_vars $MAKECONF PACKAGES PKGCHK_CONF PKGCHK_UPDATE_CONF \
-                       PKGCHK_TAGS PKGCHK_NOTAGS
+                       PKGCHK_TAGS PKGCHK_NOTAGS PKG_SUFX
        if [ -z "$PACKAGES" ] ; then
            PACKAGES=`pwd`
        fi
     fi
 
+    # .tgz/.tbz to regexp
+    PKG_SUFX_RE=`echo $PKG_SUFX | sed 's/[.]/[.]/'`
+
     if [ ! -d $PKG_DBDIR ] ; then
        fatal "Unable to access PKG_DBDIR ($PKG_DBDIR)"
     fi
@@ -240,7 +243,7 @@
 get_build_ver()
     {
     if [ -n "$opt_b" -a -z "$opt_s" ] ; then
-       ${PKG_INFO} -. -q -b $PACKAGES/$PKGNAME.tgz | ${GREP} .
+       ${PKG_INFO} -. -q -b $PACKAGES/$PKGNAME$PKG_SUFX | ${GREP} .
        return
     fi
     # Unfortunately pkgsrc always outputs to a file, but it does helpfully
@@ -266,7 +269,7 @@
            fatal_later "$PKGNAME - binary package missing"
            continue
        fi
-       verbose "$PKGNAME.tgz: found"
+       verbose "$PKGNAME$PKG_SUFX: found"
        DEPCHECKLIST="$DEPCHECKLIST$PKGNAME ";
     done
 
@@ -275,18 +278,18 @@
     while [ "$DEPCHECKLIST" != ' ' ]; do
        NEXTCHECK=' '
        for pkg in $DEPCHECKLIST ; do
-           DEPLIST="$(${PKG_INFO} -. -q -N $PACKAGES/$pkg.tgz | ${GREP} .. || true)"
+           DEPLIST="$(${PKG_INFO} -. -q -N $PACKAGES/$pkg$PKG_SUFX | ${GREP} .. || true)"
            if [ -z "$DEPLIST" ] ; then
-               PAIRLIST="${PAIRLIST}$pkg.tgz $pkg.tgz\n"
+               PAIRLIST="${PAIRLIST}$pkg$PKG_SUFX $pkg$PKG_SUFX\n"
            fi
            for dep in $DEPLIST ; do
                if is_binary_available $dep; then
                    :
                else
-                   fatal_later "$dep.tgz - dependency missing for $pkg"
+                   fatal_later "$dep$PKG_SUFX - dependency missing for $pkg"
                    break
                fi
-               PAIRLIST="${PAIRLIST}$dep.tgz $pkg.tgz\n"
+               PAIRLIST="${PAIRLIST}$dep$PKG_SUFX $pkg$PKG_SUFX\n"
                case "$PKGLIST$DEPCHECKLIST$NEXTCHECK" in
                    *" $dep "*)
                        verbose "$pkg: Duplicate depend $dep"
@@ -474,7 +477,7 @@
        if [ -n "$saved_PKG_PATH" ] ; then
            export PKG_PATH=$saved_PKG_PATH
        fi
-       run_cmd "${PKG_ADD} $PACKAGES/$PKGNAME.tgz"
+       run_cmd "${PKG_ADD} $PACKAGES/$PKGNAME$PKG_SUFX"
        if [ -n "$saved_PKG_PATH" ] ; then
            unset PKG_PATH
        fi
@@ -737,9 +740,9 @@
            if [ -d "$PACKAGES" ] ; then
                msg_progress Scan $PACKAGES
                cd $PACKAGES
-               for f in `ls -t | grep '\.tgz$'` ; do # Sort by time to pick up newest first
+               for f in `ls -t | grep "$PKG_SUFX_RE"'$'` ; do # Sort by time to pick up newest first
                    PKGDIR=`${PKG_INFO} -. -B $PACKAGES/$f|${AWK} -F= '$1=="PKGPATH"{print $2}'`
-                   PKGNAME=`echo $f | ${SED} 's/\.tgz$//'`
+                   PKGNAME=`echo $f | ${SED} "s/$PKG_SUFX"'$//'`
                    PKGDB="${PKGDB} $PKGDIR:$PKGNAME"
                done
                PKGSRCDIR=NONE



Home | Main Index | Thread Index | Old Index