summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsalo <salo@pkgsrc.org>2005-01-31 00:25:32 +0000
committersalo <salo@pkgsrc.org>2005-01-31 00:25:32 +0000
commit64faf7c9a17371c1139e068ed8074fa45a2ae7d9 (patch)
tree078d2889a9e2b8526821e7aba171c362f7c2354f
parentbcc6a9293ac18d445e51550aed90b1ba018d2ec4 (diff)
downloadpkgsrc-64faf7c9a17371c1139e068ed8074fa45a2ae7d9.tar.gz
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, 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.
-rw-r--r--mk/bulk/build.conf-example8
-rw-r--r--mk/bulk/upload63
2 files changed, 68 insertions, 3 deletions
diff --git a/mk/bulk/build.conf-example b/mk/bulk/build.conf-example
index 4a25b9595f4..28e56d1c935 100644
--- a/mk/bulk/build.conf-example
+++ b/mk/bulk/build.conf-example
@@ -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 @@ RSYNC_OPTS='-e ssh'
# 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
+
###########################################################################
### No changes should be needed below this line !!!
###########################################################################
diff --git a/mk/bulk/upload b/mk/bulk/upload
index d31b3918640..8598e5f0474 100644
--- a/mk/bulk/upload
+++ b/mk/bulk/upload
@@ -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 @@ RSFLAGS="-vap --progress $RSYNC_OPTS"
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