From e24f3fe2be337fcb536881e9fb44a4a73c121279 Mon Sep 17 00:00:00 2001 From: Steve McIntyre <93sam@debian.org> Date: Mon, 12 Jul 2004 22:30:02 +0000 Subject: [PATCH] First checkin of JTE changes. Add a simple helper script jigdo_cleanup to sanitise the .jigdo files after mkisofs-jte has created them. Add: iso image filename template filename template info fallback urls to the raw .jigdo --- tools/jigdo_cleanup | 52 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100755 tools/jigdo_cleanup diff --git a/tools/jigdo_cleanup b/tools/jigdo_cleanup new file mode 100755 index 00000000..2c6a1622 --- /dev/null +++ b/tools/jigdo_cleanup @@ -0,0 +1,52 @@ +#! /bin/sh + +# Copyright 2004 Steve McIntyre +# See the README file for the license + +# This script is called by the Makefile to cleanup the .jigdo +# files: +# +# Make sure the iso filename is sane +# Add in the TEMPLATEURL information +# Update the Servers lines + +jigdo="$1" # .jigdo file to work on +iso="$2" # The name to give to the .iso +template="$3" # URL for .template file, can be relative URL +discinfo="$4" # e.g. "Debian GNU/Linux 3.0 r1 "Woody" - Unofficial i386 Binary-1" +# any further parameters are fallback URLs +info="Generated on "`date -R` + +# Don't panic - the \047 in the awk below is the ASCII for ' - if I +# use ' instead, the enclosing shell script gets annoyed...! +cat $jigdo | awk -v ISO="$iso" -v TEMPLATE="$template" -v DISCINFO="$discinfo" -v INFO="$info" ' + /^Filename=/ { + printf("Filename=%s\n", ISO); + next + } + /^Template=/ { + printf("Template=%s\n", TEMPLATE); + next + } + /^Template-MD5Sum=/ { + printf("%s\n", $0); + printf("ShortInfo=\047%s\047\n", DISCINFO); + printf("Info=\047%s\047\n", INFO); + next + } + /.*/ { print $0 } +' > $jigdo.1 +mv -f $jigdo.1 $jigdo + +# If some fallbacks were specified, output a servers section with the +# URLs. The entries of the variable are expected to be already of the +# form "Label=http://some.url/" +if test -n "$JIGDOFALLBACKURLS"; then + for url in "$JIGDOFALLBACKURLS" + do + # The --try-last switch assigns a lower priority to the URL, + # so it will only be used if other server entries (without the + # --try-last) have already been tried without success. + echo "$url --try-last" >> $jigdo + done +fi