Also generate checksums for torrent files

This commit is contained in:
Steve McIntyre 2018-02-15 16:17:57 +00:00
parent 877e113fa9
commit 7123761213
1 changed files with 17 additions and 14 deletions

View File

@ -26,14 +26,14 @@ for SUM in $CHECKSUMS; do
:> $FILE :> $FILE
done done
# 2 calls to find here to get the ordering right - we *really* want to # Ordering is important in the "find" call here - we *really* want to
# get the jigdo files first # get the jigdo files before the iso files, so we can use the
for file in $(find * -name \*.jigdo -o -name \*.template -o -name \*.iso); do # checksums there first instead of re-calculating them
for file in $(find * \
-name '*.jigdo' -o -name '*.template' \
-o -name '*.iso' -o -name '*.torrent'); do
iso="" iso=""
case $file in case $file in
*.template)
JIGDO=1
;;
*.jigdo) *.jigdo)
iso=${file%%.jigdo}.iso iso=${file%%.jigdo}.iso
JIGDO=1 JIGDO=1
@ -42,6 +42,8 @@ for file in $(find * -name \*.jigdo -o -name \*.template -o -name \*.iso); do
iso=$file iso=$file
JIGDO=0 JIGDO=0
;; ;;
*.template|*.torrent)
;;
*) *)
echo "Found unexpected file $file!" echo "Found unexpected file $file!"
exit 1 exit 1
@ -73,12 +75,13 @@ for file in $(find * -name \*.jigdo -o -name \*.template -o -name \*.iso); do
fi fi
fi fi
# Also add the template file and jigdo file to the SUMS, if they exist # Also add the template, jigdo and torrent files to the SUMS,
case $file in # if they exist
*.template|*.jigdo) case $file in
$CMD $file >> $FILE *.template|*.jigdo|*.torrent)
grep $file $FILE $CMD $file >> $FILE
;; grep $file $FILE
esac ;;
done esac
done
done done