pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/bootstrap Nothing uses the pkg.sh script anymore. We ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/481e39efc5f3
branches:  trunk
changeset: 516141:481e39efc5f3
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Fri Jul 14 22:18:05 2006 +0000

description:
Nothing uses the pkg.sh script anymore.  We now rely on the real pkg_*
tools after they're installed to do package registration within pkgsrc
itself.

diffstat:

 bootstrap/pkg.sh |  569 -------------------------------------------------------
 1 files changed, 0 insertions(+), 569 deletions(-)

diffs (truncated from 573 to 300 lines):

diff -r add44a27f141 -r 481e39efc5f3 bootstrap/pkg.sh
--- a/bootstrap/pkg.sh  Fri Jul 14 22:17:09 2006 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,569 +0,0 @@
-#! /bin/sh
-#
-# $NetBSD: pkg.sh,v 1.1.1.1 2004/03/11 13:03:59 grant Exp $
-#
-#
-# Copyright (c) 2002 Alistair G. Crooks.  All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-#    must display the following acknowledgement:
-#      This product includes software developed by Alistair G. Crooks
-#      for the NetBSD project.
-# 4. The name of the author may not be used to endorse or promote
-#    products derived from this software without specific prior written
-#    permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
-# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-#set -x
-
-version=20020615
-
-opsys=`uname -s`
-
-case "$opsys" in
-Darwin)
-       awkprog=/usr/bin/awk
-       catprog=/bin/cat
-       chmodprog=/bin/chmod
-       cpprog=/bin/cp
-       lnprog=/bin/ln
-       mkdirprog=/bin/mkdir
-       rmprog=/bin/rm
-       sedprog=/usr/bin/sed
-       ;;
-Linux)
-       awkprog=/usr/bin/awk
-       catprog=/bin/cat
-       chmodprog=/bin/chmod
-       cpprog=/bin/cp
-       lnprog=/bin/ln
-       mkdirprog=/bin/mkdir
-       rmprog=/bin/rm
-       sedprog=/bin/sed
-       ;;
-NetBSD)
-       awkprog=/usr/bin/awk
-       catprog=/bin/cat
-       chmodprog=/bin/chmod
-       cpprog=/bin/cp
-       lnprog=/bin/ln
-       mkdirprog=/bin/mkdir
-       rmprog=/bin/rm
-       sedprog=/usr/bin/sed
-       ;;
-SunOS)
-       awkprog=/usr/bin/nawk
-       catprog=/usr/bin/cat
-       chmodprog=/usr/bin/chmod
-       cpprog=/usr/bin/cp
-       lnprog=/usr/bin/ln
-       mkdirprog=/usr/bin/mkdir
-       rmprog=/usr/bin/rm
-       sedprog=/usr/xpg4/bin/sed
-       ;;
-*)
-       awkprog=awk
-       catprog=cat
-       chmodprog=chmod
-       cpprog=cp
-       lnprog=ln
-       mkdirprog=mkdir
-       rmprog=rm
-       sedprog=sed
-       ;;
-esac
-
-getpkg()
-{
-       if test -d $PKG_DBDIR/$1; then
-               d=$PKG_DBDIR/$1
-       else
-               d="`echo $PKG_DBDIR/${1}-*`"
-       fi
-       echo $d
-}
-
-case "$DIGESTPROG" in
-"")    DIGESTPROG=/usr/pkg/bin/digest ;;
-esac
-case "$PKG_DBDIR" in
-"")     PKG_DBDIR=/var/db/pkg ;;
-esac
-case "$PKG_DIGEST" in
-"")    PKG_DIGEST=sha1 ;;
-esac
-
-ALLDIGESTS="sha1 sha512"
-
-case "$0" in
-*pkg_create)   cmd=create ;;
-*pkg_delete)   cmd=delete ;;
-*pkg_info)     cmd=info ;;
-*pkg.sh|*pkg)  cmd=$1; shift ;;
-esac
-
-case "$cmd" in
-create)
-       if [ $# -lt 1 ]; then
-               echo "Usage: pkg create ..." > /dev/stderr
-               exit 1
-       fi
-
-       BUILDINFOFILE=""                # done
-       BUILDVERSIONFILE=""             # done
-       CONFLICTS=""                    # done
-       comment=""                      # done
-       DISPLAYFILE=""                  # done
-       DESCRFILE=""                    # done
-       plist=""                        # done
-       minush=no
-       realprefix=""
-       installfile=""                  # done
-       deinstallfile=""                # done
-       srcdir=""
-       relsymlinks=no
-       mtreefile=""
-       plistonly=no
-       PREREQS=""
-       #prefix=""
-       reorder=no
-       requirements=""
-       allsizefile=""                  # done
-       thissizefile=""                 # done
-       updatefilecache=yes
-       excludefrom=""
-
-       while [ $# -gt 0 ]; do
-               case "$1" in
-               -B)     BUILDINFOFILE="$2"; shift ;;
-               -C)     CONFLICTS="$2"; shift ;;
-               -D)     DISPLAYFILE="$2"; shift ;;
-               -I)     realprefix="$2"; shift ;;
-               -L)     srcdir="$2"; shift ;;
-               -O)     plistonly=yes ;;
-               -P)     PREREQS="$PREREQS $2"; shift ;;
-               -R)     reorder=yes ;;
-               -S)     allsizefile="$2"; shift ;;
-               -U)     updatefilecache=no ;;
-               -V)     echo $version; exit 0 ;;
-               -X)     excludefrom="$excludefrom $2"; shift ;;
-               -b)     BUILDVERSIONFILE="$2"; shift ;;
-               -c)     case "$2" in
-                       -*)     comment="`echo $2 | $sedprog -e 's|^-||'`"; shift ;;
-                       *)      comment=`$catprog $2` ;;
-                       esac
-                       shift ;;
-               -d)     DESCRFILE=$2; shift ;;
-               -f)     plist="$2"; shift ;;
-               -h)     minush=yes ;;
-               -i)     installfile="$2"; shift ;;
-               -k)     deinstallfile="$2"; shift ;;
-               -l)     relsymlinks=yes ;;
-               -m)     mtreefile="$2"; shift ;;
-               -p)     PREFIX="$2"; shift ;;
-               -r)     requirements="$2"; shift ;;
-               -s)     thissizefile="$2"; shift ;;
-               -t)     shift ;;
-               -v)     set -x ;;
-               --)     shift; break ;;
-               *)      break ;;
-               esac
-               shift
-       done
-
-       PKGNAME=$1
-
-       if [ ! -d $PKG_DBDIR/$PKGNAME ]; then
-               $mkdirprog $PKG_DBDIR/$PKGNAME
-       fi
-
-       if [ -f "$BUILDINFOFILE" ]; then
-               $cpprog $BUILDINFOFILE $PKG_DBDIR/$PKGNAME/+BUILD_INFO
-       fi
-       if [ -f "$BUILDVERSIONFILE" ]; then
-               $cpprog $BUILDVERSIONFILE $PKG_DBDIR/$PKGNAME/+BUILD_VERSION
-       fi
-       echo $comment > $PKG_DBDIR/$PKGNAME/+COMMENT
-       $cpprog $DESCRFILE $PKG_DBDIR/$PKGNAME/+DESC
-
-       case "$installfile" in
-       "")     ;;
-       *)      $cpprog $installfile $PKG_DBDIR/$PKGNAME/+INSTALL ;;
-       esac
-       case "$deinstallfile" in
-       "")     ;;
-       *)      $cpprog $deinstallfile $PKG_DBDIR/$PKGNAME/+DEINSTALL ;;
-       esac
-       case "$DISPLAYFILE" in
-       "")     ;;
-       *)      $cpprog $DISPLAYFILE $PKG_DBDIR/$PKGNAME/+DISPLAY ;;
-       esac
-       case "$allsizefile" in
-       "")     ;;
-       *)      $cpprog $allsizefile $PKG_DBDIR/$PKGNAME/+SIZE_ALL ;;
-       esac
-       case "$thissizefile" in
-       "")     ;;
-       *)      $cpprog $thissizefile $PKG_DBDIR/$PKGNAME/+SIZE_PKG ;;
-       esac
-
-       export PREFIX PKGNAME CONFLICTS PREREQS DIGESTPROG PKG_DIGEST
-
-       $awkprog '
-       BEGIN   {
-               if (ENVIRON["CONFLICTS"] != "") {
-                       cflc = split(ENVIRON["CONFLICTS"], cflv);
-                       for (i = 1 ; i <= cflc ; i++)
-                               printf("@pkgcfl %s\n", cflv[i])
-               }
-               if (ENVIRON["PREREQS"] != "") {
-                       prec = split(ENVIRON["PREREQS"], prev);
-                       for (i = 1 ; i <= prec ; i++)
-                               printf("@pkgdep %s\n", prev[i])
-               }
-               prefix = ENVIRON["PREFIX"];
-               printf("@name %s\n@cwd %s\n", ENVIRON["PKGNAME"], prefix) }
-       /^@(comment|dirrm|src)/ { print $0; next }
-       /^@(un)?exec/   {       last = filename; gsub(".*/", "", last); gsub("%f", last);
-               fc = split(filename, fv, "/"); fn = prefix; for (i = 1 ; i < fc ; i++) fn = fn "/" fv[i]; gsub("%B", fn);
-               gsub("%F", filename);
-               gsub("%D", prefix); print $0; next }
-       { filename = $0; printf("%s\n@comment MD5:", $0); cmd = sprintf("'$catprog' %s/%s | %s %s", prefix, $0, ENVIRON["DIGESTPROG"], ENVIRON["PKG_DIGEST"]); system(cmd) }
-       ' < $plist > $PKG_DBDIR/$PKGNAME/+CONTENTS
-
-       # construct the digests of all the metafiles
-       echo "#! /bin/sh" > $PKG_DBDIR/$PKGNAME/+VERIFY
-       echo "" >> $PKG_DBDIR/$PKGNAME/+VERIFY
-       echo 'case $# in' >> $PKG_DBDIR/$PKGNAME/+VERIFY
-       echo '0) ;;' >> $PKG_DBDIR/$PKGNAME/+VERIFY
-       echo '*) cd '$PKG_DBDIR/$PKGNAME ';;' >> $PKG_DBDIR/$PKGNAME/+VERIFY
-       echo 'esac' >> $PKG_DBDIR/$PKGNAME/+VERIFY
-       echo "" >> $PKG_DBDIR/$PKGNAME/+VERIFY
-       echo "$awkprog '" >> $PKG_DBDIR/$PKGNAME/+VERIFY
-       echo 'BEGIN     { ex = 0 }' >> $PKG_DBDIR/$PKGNAME/+VERIFY
-       echo 'END       { exit(ex) }' >> $PKG_DBDIR/$PKGNAME/+VERIFY
-       echo '/^@cwd/   { prefix = $2; next }' >> $PKG_DBDIR/$PKGNAME/+VERIFY
-       echo '/^@/      { next }' >> $PKG_DBDIR/$PKGNAME/+VERIFY
-       echo '  {' >> $PKG_DBDIR/$PKGNAME/+VERIFY
-       echo '  for (done = 0 ; !done ; ) {' >> $PKG_DBDIR/$PKGNAME/+VERIFY
-       echo '          filename = prefix "/" $0;' >> $PKG_DBDIR/$PKGNAME/+VERIFY
-       echo '          getline;' >> $PKG_DBDIR/$PKGNAME/+VERIFY
-       echo '          if ($0 ~ /^@comment (MD5|SHA1):/) {' >> $PKG_DBDIR/$PKGNAME/+VERIFY
-       echo '                  alg = dig = $2;' >> $PKG_DBDIR/$PKGNAME/+VERIFY
-       echo '                  gsub(":.*", "", alg);' >> $PKG_DBDIR/$PKGNAME/+VERIFY
-       echo '                  gsub("[A-Za-z0-9]*:", "", dig);' >> $PKG_DBDIR/$PKGNAME/+VERIFY
-       echo '                  cmd = sprintf("s=`'$catprog' %s | '$DIGESTPROG' %s`; if test \"%s\" != \"$s\"; then echo \"Checksum mismatch (%s): expected %s, got $s\"; fi", filename, alg, dig, 
filename, dig);' >> $PKG_DBDIR/$PKGNAME/+VERIFY
-       echo '                  if (system(cmd) != 0) ex = 1' >> $PKG_DBDIR/$PKGNAME/+VERIFY
-       echo '                  done = 1;' >> $PKG_DBDIR/$PKGNAME/+VERIFY
-       echo '          }' >> $PKG_DBDIR/$PKGNAME/+VERIFY
-       echo '  }' >> $PKG_DBDIR/$PKGNAME/+VERIFY
-       echo "}' +CONTENTS" >> $PKG_DBDIR/$PKGNAME/+VERIFY
-       echo "" >> $PKG_DBDIR/$PKGNAME/+VERIFY
-       echo "$awkprog '" >> $PKG_DBDIR/$PKGNAME/+VERIFY
-       echo "BEGIN     { ex = 0 }" >> $PKG_DBDIR/$PKGNAME/+VERIFY
-       echo "END       { exit(ex) }" >> $PKG_DBDIR/$PKGNAME/+VERIFY
-       echo "          {" >> $PKG_DBDIR/$PKGNAME/+VERIFY
-       echo 'cmd = sprintf("s=`'$catprog' %s | '$DIGESTPROG' %s`; if test \"%s\" != \"$s\"; then echo \"Checksum mismatch (%s): expected %s, got $s\"; fi", $1, $2, $3, $1, $3);' >> 
$PKG_DBDIR/$PKGNAME/+VERIFY
-       echo "if (system(cmd) != 0) ex = 1" >> $PKG_DBDIR/$PKGNAME/+VERIFY
-       echo "}' << filesEOF" >> $PKG_DBDIR/$PKGNAME/+VERIFY
-       # construct the digests of all the metafiles
-       for f in +BUILD_INFO +BUILD_VERSION +COMMENT +CONTENTS +DEINSTALL +DESC +DISPLAY +INSTALL +SIZE_ALL +SIZE_PKG; do
-               if [ -f $PKG_DBDIR/$PKGNAME/$f ]; then
-                       for dig in $ALLDIGESTS; do
-                               echo "$f $dig `$catprog $PKG_DBDIR/$PKGNAME/$f | $DIGESTPROG $dig`" >> $PKG_DBDIR/$PKGNAME/+VERIFY
-                       done
-               fi
-       done
-       echo "filesEOF" >> $PKG_DBDIR/$PKGNAME/+VERIFY



Home | Main Index | Thread Index | Old Index