check for config file and jigdo-gen-md5-list existance

This commit is contained in:
George Danchev 2011-06-23 11:01:39 +00:00
parent d7cd3be2df
commit c8eafc252f

View File

@ -9,7 +9,7 @@ IMG=""
# optional # optional
ISOLINUX_BIN="" ISOLINUX_BIN=""
BOOT_CAT="" BOOT_CAT=""
CONFFILE=$HOME/releng_build_jigdo.conf CONFFILE=$HOME/releng_build_isojigdo.conf
CLEAN=0 CLEAN=0
print_help() { print_help() {
@ -34,7 +34,7 @@ if [ ! "${1}" -o "${1}" == "-help" ]; then print_help && exit 0; fi
# config file # config file
if [ "${1}" == "-rc" ]; then if [ "${1}" == "-rc" ]; then
if [ -e ${CONFFILE} ]; then . ${CONFFILE} if [ -e ${CONFFILE} ]; then . ${CONFFILE}
else echo -e "$0: can not find config file: ${CONFFILE}\n" else echo -e "$0: Config file ${CONFFILE} not found.\n" && exit 1
fi fi
if [ "${2}" == "-clean" ]; then CLEAN=1; fi if [ "${2}" == "-clean" ]; then CLEAN=1; fi
# command line args # command line args
@ -66,7 +66,14 @@ main() {
# /sbin/mkfs.msdos -n Bla -C fatpart.fat 8192 # /sbin/mkfs.msdos -n Bla -C fatpart.fat 8192
# create MD5 list in base64 format # create MD5 list in base64 format
jigdo-gen-md5-list ${DIR} > ${IMG}.md5 if which jigdo-gen-md5-list >/dev/null 2>&1; then
printf "$0: Creating MD5 list in hex format..."
jigdo-gen-md5-list ${DIR} > ${IMG}.md5
printf "Done.\n"
else
printf "$0: Not found: jigdo-gen-md5-list. Install jigit.\n"
exit 1
fi
# build the command - general section # build the command - general section
CMD="${XOR} \ CMD="${XOR} \
@ -103,7 +110,7 @@ CMD+="\
CMD+="${DIR}" CMD+="${DIR}"
# run it # run it
echo -e "$0: creating iso & jigdo representations:\n$CMD\n" echo -e "$0: Creating ISO and jigdo representations:\n$CMD\n"
${CMD} ${CMD}
# create another one from jigdo files # create another one from jigdo files