From 689c42873048642fcdd5c0d4794b0c504a2ce083 Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Sun, 19 Apr 2015 15:19:15 +0200 Subject: reproducible: build: do not try to delete the lockfile if it's not ours --- bin/reproducible_build.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh index 1182f524..3c016cd2 100755 --- a/bin/reproducible_build.sh +++ b/bin/reproducible_build.sh @@ -54,6 +54,7 @@ handle_race_condition() { check_for_race_conditions() { if [ $$ -ne $(cat "$LOCKFILE") ] ; then + BAD_LOCKFILE=true handle_race_condition lockfile fi } @@ -91,7 +92,7 @@ cleanup_all() { irc_message "Check $REPRODUCIBLE_URL/rbuild/${SUITE}/${ARCH}/${SRCPACKAGE}_${EVERSION}.rbuild.log to find out why no artifacts were saved." fi rm -r $TMPDIR - rm $LOCKFILE || true + if ! $BAD_LOCKFILE ; then rm -f $LOCKFILE ; fi } cleanup_userContent() { @@ -420,6 +421,7 @@ cd $TMPDIR DATE=$(date +'%Y-%m-%d %H:%M') START=$(date +'%s') RBUILDLOG=$(mktemp --tmpdir=$TMPDIR) +BAD_LOCKFILE=false choose_package # defines SUITE, PKGID, SRCPACKAGE, SCHEDULED_DATE, SAVE_ARTIFACTS -- cgit v1.2.3-70-g09d2