From 04dcde6a8b5170a9a34781f2aea590ea6ba31478 Mon Sep 17 00:00:00 2001 From: Steve McIntyre <93sam@debian.org> Date: Sat, 25 Nov 2006 02:08:38 +0000 Subject: [PATCH] * Split final md5sum of images out from Makefile into tools/imagesums; if we've made jigdo files then *don't* waste time running md5sum on the images as well! --- Makefile | 13 ++----------- debian/changelog | 5 +++++ tools/imagesums | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 11 deletions(-) create mode 100755 tools/imagesums diff --git a/Makefile b/Makefile index 9b635476..f8b6b032 100755 --- a/Makefile +++ b/Makefile @@ -779,18 +779,9 @@ image: bin-image bin-image: check-number-given bin-images src-image: check-number-given src-images -#Calculate the md5sums for the images (if available), or get from templates +# Calculate the md5sums for the images (if available), or get from templates imagesums: - $(Q)cd $(OUT); :> MD5SUMS; for file in `find * -name \*.raw`; do \ - $(md5sum) $$file >>MD5SUMS; \ - done; \ - for file in `find * -name \*.template`; do \ - if [ "`tail --bytes=33 "$$file" | head --bytes=1 | od -tx1 -An | sed -e 's/ //g'`" != 05 ]; then \ - echo "Possibly invalid template $$file"; exit 1; \ - fi; \ - grep -q " $${file%%.template}.raw"'$$' MD5SUMS \ - || echo "`tail --bytes=26 "$$file" | head --bytes=16 | od -tx1 -An | sed -e 's/ //g'` $${file%%.template}.raw" >>MD5SUMS; \ - done + $(Q)$(BASEDIR)/tools/imagesums $(OUT) # Likewise, the file size can be extracted from the .template with: # tail --bytes=32 $$file | head --bytes=6 | od -tx1 -An \ diff --git a/debian/changelog b/debian/changelog index 6caf2e0f..3b10559d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -61,6 +61,11 @@ debian-cd (2.2.26) UNRELEASED; urgency=low [ Frans Pop ] * Include floppy disk images again for i386. + [ Steve McIntyre ] + * Split final md5sum of images out from Makefile into tools/imagesums; + if we've made jigdo files then *don't* waste time running md5sum on + the images as well! + -- Frans Pop Thu, 23 Nov 2006 01:42:00 +0100 debian-cd (2.2.25) unstable; urgency=low diff --git a/tools/imagesums b/tools/imagesums new file mode 100755 index 00000000..f13b1125 --- /dev/null +++ b/tools/imagesums @@ -0,0 +1,32 @@ +#!/bin/bash + +cd $1 + +:> MD5SUMS + +case $DO_JIGDO in + 0) + for file in `find * -name \*.raw` + do + md5sum $file >> MD5SUMS + done + ;; + 1|2) + for file in `find * -name \*.template` + do + if [ "`tail --bytes=33 "$file" | head --bytes=1 | od -tx1 -An | sed -e 's/ //g'`" != 05 ]; then + echo "Possibly invalid template $file" + exit + fi + grep -q " ${file%%.template}.raw"'$$' MD5SUMS \ + || echo "`tail --bytes=26 "$file" | \ + head --bytes=16 | \ + od -tx1 -An | \ + sed -e 's/ //g'` ${file%%.template}.raw" >> MD5SUMS + done + ;; + *) + echo "DO_JIGDO not defined!" + exit 1 + ;; +esac