From ab50e6f10b0f9b7fb36604ca6e58accfd674e570 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Fri, 23 Dec 2016 02:11:02 +0100 Subject: reproducible Debian: better deal with non-existing stamp files Signed-off-by: Holger Levsen --- bin/reproducible_setup_pbuilder.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'bin/reproducible_setup_pbuilder.sh') diff --git a/bin/reproducible_setup_pbuilder.sh b/bin/reproducible_setup_pbuilder.sh index ec5c7836..88ac2433 100755 --- a/bin/reproducible_setup_pbuilder.sh +++ b/bin/reproducible_setup_pbuilder.sh @@ -134,9 +134,11 @@ setup_pbuilder() { BASETGZ=/var/cache/pbuilder/$SUITE-reproducible-base.tgz STAMP=/var/log/jenkins/$SUITE-reproducible-base.tgz.stamp -if [ -f "$STAMP" -a $(stat -c %Y "$STAMP") -gt $(date +%s) ]; then - echo "stamp file has a timestamp from the future." - exit 1 +if [ -f "$STAMP" ] ; then + if [ -f "$STAMP" -a $(stat -c %Y "$STAMP") -gt $(date +%s) ]; then + echo "stamp file has a timestamp from the future." + exit 1 + fi fi OLDSTAMP=$(find $STAMP -mtime +1 -exec ls -lad {} \; || echo "nostamp") -- cgit v1.2.3-54-g00ecf