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
This commit is contained in:
parent
c924cdc420
commit
e24f3fe2be
|
@ -0,0 +1,52 @@
|
|||
#! /bin/sh
|
||||
|
||||
# Copyright 2004 Steve McIntyre <steve@einval.com>
|
||||
# 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
|
Loading…
Reference in New Issue