Skip to content

Instantly share code, notes, and snippets.

@tycho
Last active May 23, 2016 15:24
Show Gist options
  • Save tycho/87e505aff2d25de6441154bea22a5acb to your computer and use it in GitHub Desktop.
Save tycho/87e505aff2d25de6441154bea22a5acb to your computer and use it in GitHub Desktop.
#!/bin/bash
set -ex
if [ "$(type -P pixz)" = "" ]; then
echo "You need pixz installed."
exit 1
fi
if [ "$(type -P gpg)" = "" ]; then
echo "You need gnupg installed."
exit 1
fi
if [ "$(type -P ec2-x86_64-build)" = "" ]; then
echo "You need the ec2 variant of devtools installed."
exit 1
fi
# Make GPG-agent cache our credentials so we don't break on signing later...
BOGUS=$(mktemp)
gpg --detach-sign $BOGUS
rm ${BOGUS}{,.sig}
rm -f *.pkg.tar*
[ -f .multilib ] && sudo nice -n 15 multilib-build $@ -r /builder -- -T
[ ! -f .no_x86_64 ] && sudo nice -n 15 ec2-x86_64-build $@ -r /builder -- -T
[ ! -f .no_i686 ] && sudo nice -n 15 ec2-i686-build $@ -r /builder -- -T
rm -f *.log
DEBUG_TARBALLS=()
for TARBALL in *-debug-*.pkg.tar; do
[ -f "$TARBALL" ] || continue;
DEBUG_TARBALLS+=( ${TARBALL} )
done
for TARBALL in *-debug-*.pkg.tar.gz; do
[ -f "$TARBALL" ] || continue;
DEBUG_TARBALLS+=( ${TARBALL%.gz} )
nice pigz -d $TARBALL
done
for TARBALL in ${DEBUG_TARBALLS[@]}; do
[ -f "$TARBALL" ] || continue;
nice pixz $TARBALL ${TARBALL}.xz
rm $TARBALL
done
for PACKAGE in $(ls *.pkg.tar{,.*z}); do
gpg --detach-sign $PACKAGE
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment