diff options
author | jschauma <jschauma@pkgsrc.org> | 2005-01-24 03:41:34 +0000 |
---|---|---|
committer | jschauma <jschauma@pkgsrc.org> | 2005-01-24 03:41:34 +0000 |
commit | 4bef7cd9445ce8266915e9fb050138c0be89d96a (patch) | |
tree | ecb409539009003a04286c57b5523f00def55dd4 /mk | |
parent | 8a3f01d79db418f621344b73e1bef7bf8966c881 (diff) | |
download | pkgsrc-4bef7cd9445ce8266915e9fb050138c0be89d96a.tar.gz |
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).
Diffstat (limited to 'mk')
-rw-r--r-- | mk/bulk/upload | 53 |
1 files changed, 52 insertions, 1 deletions
diff --git a/mk/bulk/upload b/mk/bulk/upload index a94a1001db5..96371ed0763 100644 --- a/mk/bulk/upload +++ b/mk/bulk/upload @@ -1,13 +1,23 @@ #!/bin/sh -# $NetBSD: upload,v 1.19 2005/01/20 02:02:50 tv Exp $ +# $NetBSD: upload,v 1.20 2005/01/24 03:41:34 jschauma Exp $ # # Upload non-restricted binary pkgs to ftp server # +CKSUM="cksum"; +MD5="digest md5"; +SHA1="digest sha1"; +BSDSUM="sum -o 1"; +SYSVSUM="sum -o 2"; + opsys=`uname -s` case "$opsys" in NetBSD) BMAKE=make ;; +IRIX*) BMAKE=bmake; + BSDSUM="sum -r"; + SYSVSUM="sum"; + ;; *) BMAKE=bmake ;; esac @@ -98,6 +108,47 @@ 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 ) + 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 + + if [ x"${SIGN_AS}" != x"" ]; then + for i in ${SUMFILES}; do + echo "Signing $i" + gpg --clearsign $i && rm $i + done + SUMFILES="BSDSUM.asc CKSUM.asc MD5.asc SHA1.asc SYSVSUM.asc" + fi + + for i in ${SUMFILES}; do + [ -s ${packages}/${i} ] && echo $i >> $osf + done + +fi + + echo "#!/bin/sh" > $upload echo "packages=$packages" >> $upload echo "if ! cd $packages ; then" >> $upload |