Fix up ordering in imagesums

"find" doesn't care about ordering in the way I thought, so use
separate find calls instead
This commit is contained in:
Steve McIntyre 2019-10-18 18:56:00 +01:00
parent b2b7e7da3c
commit 68f5b13740
1 changed files with 11 additions and 7 deletions

View File

@ -26,12 +26,16 @@ for SUM in $CHECKSUMS; do
:> $FILE :> $FILE
done done
# Ordering is important in the "find" call here - we *really* want to # Ordering is important, so we do separate "find" calls here - we
# get the jigdo files before the iso files, so we can use the # *really* want to get the jigdo files before the iso files, so we can
# checksums there first instead of re-calculating them # use the checksums there first instead of re-calculating them
for file in $(find * \ FILES=""
-name '*.jigdo' -o -name '*.template' \ FILES="$FILES "$(find * -name '*.jigdo')
-o -name '*.iso' -o -name '*.torrent'); do FILES="$FILES "$(find * -name '*.template')
FILES="$FILES "$(find * -name '*.iso')
FILES="$FILES "$(find * -name '*.torrent')
for file in $FILES; do
iso="" iso=""
case $file in case $file in
*.jigdo) *.jigdo)
@ -68,7 +72,7 @@ for file in $(find * \
echo "$CKSUM $iso" >> $FILE echo "$CKSUM $iso" >> $FILE
grep $iso $FILE grep $iso $FILE
else else
echo "No Jigdo help for $SUM, doing it the long way with $CMD" echo "$JIGDO cannot provide jigdo help for $SUM for $iso, doing it the long way with $CMD"
$CMD $iso >> $FILE $CMD $iso >> $FILE
grep $iso $FILE grep $iso $FILE
fi fi