From 965b86c295aadb5d7c16bcfcd827cda070446469 Mon Sep 17 00:00:00 2001 From: Cyril Brulebois Date: Fri, 13 Jul 2012 21:34:54 +0000 Subject: [PATCH] Make grab_md5 more robust. If $DI_CODENAME is ever set to a bad value, one would end up trying to use a non-existing debian-installer, resulting in non-bootable images way later. To detect that much earlier, make sure all locations (computed from $CODENAME and $DI_CODENAME) are directories. --- tools/grab_md5 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/grab_md5 b/tools/grab_md5 index ee0ef094..af18ae86 100755 --- a/tools/grab_md5 +++ b/tools/grab_md5 @@ -8,6 +8,8 @@ # Parse Packages and Sources files out of a mirror and pre-process # them into a single list ready for mkisofs to check later +set -e + MIRROR=$1 ARCHES="$2" CODENAME=$3 @@ -19,6 +21,13 @@ do LOCATIONS="$MIRROR/dists/$CODENAME/ $MIRROR/dists/$DI_CODENAME/" echo "Looking in $LOCATIONS" + for LOCATION in $LOCATIONS; do + if [ ! -d $LOCATION ]; then + echo "Error: $LOCATION is not a directory" + exit 1 + fi + done + case $ARCH in source) FILES=`find $LOCATIONS -name Sources.gz`