diff options
author | Holger Levsen <holger@layer-acht.org> | 2015-01-03 22:23:13 +0100 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2015-01-03 22:23:13 +0100 |
commit | ab0b94d44d9cda33dac8ef3288f0528f39f0a0c3 (patch) | |
tree | b7610b4616022745ecd7629dfe7c5dcb985e6e77 /bin | |
parent | bb5adb23474f2a3b63b6532351249924bda4ed8a (diff) | |
download | jenkins.debian.net-ab0b94d44d9cda33dac8ef3288f0528f39f0a0c3.tar.xz |
reproducible: only compare if we can
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/reproducible_create_meta_pkg_sets.sh | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/bin/reproducible_create_meta_pkg_sets.sh b/bin/reproducible_create_meta_pkg_sets.sh index fee3e232..a887bc51 100755 --- a/bin/reproducible_create_meta_pkg_sets.sh +++ b/bin/reproducible_create_meta_pkg_sets.sh @@ -29,17 +29,19 @@ update_if_similar() { # this is mostly done to not accidently overwrite the lists # with garbage, eg. when external services are down TARGET=$TPATH/$1 - LENGTH=$(cat $TARGET | wc -w) - NEWLEN=$(cat $TMPFILE | wc -w) - PERCENT=$(echo "$LENGTH*100/$NEWLEN"|bc) - if [ $PERCENT -gt 107 ] || [ $PERCENT -lt 93 ] ; then - mv $TMPFILE $TARGET.new - echo - echo diff $TARGET $TARGET.new - diff $TARGET $TARGET.new - echo - echo "Too much difference, aborting. Please investigate and update manually." - exit 1 + if [ -f $TARGET ] ; then + LENGTH=$(cat $TARGET | wc -w) + NEWLEN=$(cat $TMPFILE | wc -w) + PERCENT=$(echo "$LENGTH*100/$NEWLEN"|bc) + if [ $PERCENT -gt 107 ] || [ $PERCENT -lt 93 ] ; then + mv $TMPFILE $TARGET.new + echo + echo diff $TARGET $TARGET.new + diff $TARGET $TARGET.new + echo + echo "Too much difference, aborting. Please investigate and update manually." + exit 1 + fi fi mv $TMPFILE $TARGET } |