pkgsrc-Changes-HG archive

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

[pkgsrc/pkgsrc-2004Q4]: pkgsrc/mk/bulk Pullup ticket 245 - requested by Jan S...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/a1265eb0cae3
branches:  pkgsrc-2004Q4
changeset: 485866:a1265eb0cae3
user:      salo <salo%pkgsrc.org@localhost>
date:      Mon Jan 31 00:25:32 2005 +0000

description:
Pullup ticket 245 - requested by Jan Schaumann
generate and upload checksums for bulk builds

Revisions pulled up:
- pkgsrc/mk/bulk/build.conf-example 1.24-1.26
- pkgsrc/mk/bulk/upload             1.20-1.21

   Module Name: pkgsrc
   Committed By:        jschauma
   Date:                Mon Jan 24 03:41:34 UTC 2005

   Modified Files:
        pkgsrc/mk/bulk: upload

   Log Message:
   Add bits to allow bulk-builders to generate checksums for the binary
   packages they upload (by setting the optional variable MKSUMS=yes) and,
   also optionally, PGP signing them (by setting SIGN_AS=username%NetBSD.org@localhost,
   for example).
---
   Module Name: pkgsrc
   Committed By:        jschauma
   Date:                Mon Jan 24 13:08:19 UTC 2005

   Modified Files:
        pkgsrc/mk/bulk: build.conf-example

   Log Message:
   Add MKSUMS and SIGN_AS (the former defaulting to yes, the latter
   commented out).
---
   Module Name: pkgsrc
   Committed By:        tv
   Date:                Mon Jan 24 13:21:13 UTC 2005

   Modified Files:
        pkgsrc/mk/bulk: build.conf-example

   Log Message:
   Not all OS's have all the checksum tools available to make MKSUMS=yes
   work.  Default it to "no" instead.
---
   Module Name: pkgsrc
   Committed By:        jschauma
   Date:                Mon Jan 24 15:00:48 UTC 2005

   Modified Files:
        pkgsrc/mk/bulk: build.conf-example upload

   Log Message:
   Per default, only create md5 and sha1 checksums.
   (These are available on all platforms via digest(1).)
   Set commands for other checksums on a per OPSYS basis.

   Set MKSUSM=yes back as the default.

diffstat:

 mk/bulk/build.conf-example |   8 +++++-
 mk/bulk/upload             |  63 ++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 68 insertions(+), 3 deletions(-)

diffs (109 lines):

diff -r 4bdd70e82589 -r a1265eb0cae3 mk/bulk/build.conf-example
--- a/mk/bulk/build.conf-example        Sun Jan 30 20:39:10 2005 +0000
+++ b/mk/bulk/build.conf-example        Mon Jan 31 00:25:32 2005 +0000
@@ -1,5 +1,5 @@
 # build.conf
-# $NetBSD: build.conf-example,v 1.22 2004/08/12 22:18:07 sketch Exp $
+# $NetBSD: build.conf-example,v 1.22.6.1 2005/01/31 00:25:32 salo Exp $
 #
 # config file in /bin/sh syntax for {,pre,post}-build
 #
@@ -57,6 +57,12 @@
 # Nice level for builds
 NICE_LEVEL="nice -n 20"
 
+# Whether or not to create checksum files
+MKSUMS=yes
+
+# If you want to PGP sign the checksum files, set and correct
+#SIGN_AS=username%NetBSD.org@localhost
+
 ###########################################################################
 ### No changes should be needed below this line !!!
 ###########################################################################
diff -r 4bdd70e82589 -r a1265eb0cae3 mk/bulk/upload
--- a/mk/bulk/upload    Sun Jan 30 20:39:10 2005 +0000
+++ b/mk/bulk/upload    Mon Jan 31 00:25:32 2005 +0000
@@ -1,14 +1,26 @@
 #!/bin/sh
-# $NetBSD: upload,v 1.18 2004/04/19 18:39:09 hubertf Exp $
+# $NetBSD: upload,v 1.18.8.1 2005/01/31 00:25:32 salo Exp $
 
 #
 # Upload non-restricted binary pkgs to ftp server
 # Must be called in $USR_PKGSRC
 #
 
+MD5="digest md5";
+SHA1="digest sha1";
+
 opsys=`uname -s`
 case "$opsys" in
-NetBSD)        BMAKE=make ;;
+NetBSD)        BMAKE=make;
+       BSDSUM="sum -o 1";
+       CKSUM="cksum";
+       SYSVSUM="sum -o 2";
+       ;;
+IRIX*) BMAKE=bmake;
+#      BSDSUM="sum -r";
+#      CKSUM="cksum";
+#      SYSVSUM="sum";
+       ;;
 *)     BMAKE=bmake ;;
 esac
 
@@ -89,6 +101,53 @@
 failed=no
 cd $packages
 
+if [ "${MKSUMS}" = "yes" -o "${MKSUMS}" = "YES" ]; then
+
+       SUMFILES="BSDSUM CKSUM MD5 SHA1 SYSVSUM"
+
+       rm -f ${SUMFILES}
+
+       if [ x"${SIGN_AS}" != x"" ]; then
+               ( cd ${pkgsrcdir}/security/gnupg; ${BMAKE} bulk-install )
+               for i in ${SUMFILES}; do
+                       echo > $i
+                       echo "This file is signed with ${SIGN_AS}'s PGP key." >> $i
+                       echo >> $i
+               done
+       fi
+
+       ( cd ${pkgsrcdir}/pkgtools/digest; ${BMAKE} bulk-install )
+
+       [ -z "${BSDSUM}" ] && BSDSUM="echo"
+       [ -z "${CKSUM}" ] && CKSUM="echo"
+       [ -z "${SYSVSUM}" ] && SYSVSUM="echo"
+
+       for i in All/*; do
+               if ! grep -q $i $exf; then
+                       ${BSDSUM} $i >> BSDSUM
+                       ${CKSUM} $i >> CKSUM
+                       ${MD5} $i >> MD5
+                       ${SHA1} $i >> SHA1
+                       ${SYSVSUM} $i >> SYSVSUM
+               fi
+       done
+
+       [ "${BSDSUM}" = "echo" ] && rm BSDSUM
+       [ "${CKSUM}" = "echo" ] && rm CKSUM
+       [ "${SYSVSUM}" = "echo" ] && rm SYSVSUM
+       
+       if [ x"${SIGN_AS}" != x"" ]; then
+               for i in ${SUMFILES}; do
+                       if [ -s $i ]; then
+                               echo "Signing $i"
+                               gpg --clearsign $i && rm $i
+                               echo ${i}.asc >> $osf
+                       fi
+               done
+       fi
+fi
+
+
 echo "#!/bin/sh" > $upload
 echo "packages=$packages" >> $upload
 echo "if ! cd $packages ; then" >> $upload



Home | Main Index | Thread Index | Old Index