diff options
author | Holger Levsen <holger@layer-acht.org> | 2015-10-16 18:09:35 +0200 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2015-10-16 18:09:35 +0200 |
commit | 12a743d0d213112f7ef712c7f9b5662f854c4857 (patch) | |
tree | 515df7043b0014eb0b833fa7dbd29637d4a94702 /bin | |
parent | 1cc177bd9f009fdf63f2ec7e1730cae40aba59b7 (diff) | |
download | jenkins.debian.net-12a743d0d213112f7ef712c7f9b5662f854c4857.tar.xz |
reproducible arch: build in /tmp/$PKG-$(basename $TMPDIR) instead of /tmp/$PKG
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/reproducible_build_arch_pkg.sh | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/bin/reproducible_build_arch_pkg.sh b/bin/reproducible_build_arch_pkg.sh index dee34e9d..34eb5529 100755 --- a/bin/reproducible_build_arch_pkg.sh +++ b/bin/reproducible_build_arch_pkg.sh @@ -14,10 +14,16 @@ set -e cleanup_all() { cd + # delete main work dir rm $TMPDIR -r echo "$(date -u) - $TMPDIR deleted." + # delete makekpg work dir + if [ ! -z $SRCPACKAGE ] && [ -d /tmp/$SRCPACKAGE-$(basename $TMPDIR) ] ; then + rm -r /tmp/$SRCPACKAGE-$(basename $TMPDIR) + fi + # delete session if it still exists if [ "$MODE" != "master" ] ; then - schroot --end-session -c arch-$SRCPACKAGE-$(basename $TMDPIR) > /dev/null 2>&1 || true + schroot --end-session -c arch-$SRCPACKAGE-$(basename $TMPDIR) > /dev/null 2>&1 || true fi } @@ -37,10 +43,12 @@ first_build() { echo "Date UTC: $(date -u)" echo "=============================================================================" set -x - local SESSION="arch-$SRCPACKAGE-$(basename $TMDPIR)" + local SESSION="arch-$SRCPACKAGE-$(basename $TMPDIR)" + local BUILDDIR="/tmp/$SRCPACKAGE-$(basename $TMPDIR)" schroot --begin-session --session-name=$SESSION -c jenkins-reproducible-arch - schroot --run-session -c $SESSION --directory /tmp -- cp -r /var/abs/core/$SRCPACKAGE /tmp - schroot --run-session -c $SESSION --directory /tmp/$SRCPACKAGE -- makepkg --skippgpcheck + schroot --run-session -c $SESSION --directory /tmp -- mkdir $BUILDDIR + schroot --run-session -c $SESSION --directory /tmp -- cp -r /var/abs/core/$SRCPACKAGE/* $BUILDDIR/ + schroot --run-session -c $SESSION --directory $BUILDDIR -- makepkg --skippgpcheck schroot --end-session -c $SESSION if ! "$DEBUG" ; then set +x ; fi } @@ -52,10 +60,12 @@ second_build() { echo "Date UTC: $(date -u)" echo "=============================================================================" set -x - local SESSION="arch-$SRCPACKAGE-$(basename $TMDPIR)" + local SESSION="arch-$SRCPACKAGE-$(basename $TMPDIR)" + local BUILDDIR="/tmp/$SRCPACKAGE-$(basename $TMPDIR)" schroot --begin-session --session-name=$SESSION -c jenkins-reproducible-arch - schroot --run-session -c $SESSION --directory /tmp -- cp -r /var/abs/core/$SRCPACKAGE /tmp - schroot --run-session -c $SESSION --directory /tmp/$SRCPACKAGE -- makepkg --skippgpcheck + schroot --run-session -c $SESSION --directory /tmp -- mkdir $BUILDDIR + schroot --run-session -c $SESSION --directory /tmp -- cp -r /var/abs/core/$SRCPACKAGE/* $BUILDDIR/ + schroot --run-session -c $SESSION --directory $BUILDDIR -- makepkg --skippgpcheck schroot --end-session -c $SESSION if ! "$DEBUG" ; then set +x ; fi } @@ -131,7 +141,7 @@ elif [ "$1" = "1" ] || [ "$1" = "2" ] ; then else second_build fi - mv -v /tmp/$SRCPACKAGE $TMPDIR/b$MODE/archlinux/ + mv -v /tmp/$SRCPACKAGE-$(basename $TMPDIR) $TMPDIR/b$MODE/archlinux/ echo "$(date -u) - build #$MODE for $SRCPACKAGE on $HOSTNAME done." exit 0 fi |