move generated data to script.result directory to ease identification and eventual removal

This commit is contained in:
George Danchev 2011-06-27 14:23:50 +00:00
parent 2750798aef
commit b66456df67
2 changed files with 21 additions and 14 deletions

View File

@ -14,6 +14,7 @@ Release Engineering Che[at|ck] List
* DELIVERING A NEW TEST SCRIPT * DELIVERING A NEW TEST SCRIPT
+ start a new test over the top of template_new_releng + start a new test over the top of template_new_releng
+ file name starts with releng_ + file name starts with releng_
+ any generated data to be stored in ./$0.result directory
+ mandatory options -rc [-clean] + mandatory options -rc [-clean]
+ well documented configuration file test.conf{.template} + well documented configuration file test.conf{.template}
+ throw FAIL string to stdout if any failure is detected + throw FAIL string to stdout if any failure is detected

View File

@ -13,7 +13,7 @@ ISOLINUX_BIN=""
BOOT_CAT="" BOOT_CAT=""
CONFFILE=$HOME/releng_build_isojigdo.conf CONFFILE=$HOME/releng_build_isojigdo.conf
CLEAN=0 CLEAN=0
GEN_DATA_DIR=$0.result
RES="" RES=""
print_help() { print_help() {
@ -28,6 +28,12 @@ HLP
} }
##################################################################### #####################################################################
if [ -d "${GEN_DATA_DIR}" ]; then
printf "\n$0: %s exists!\n" ${GEN_DATA_DIR}
exit 2
else
mkdir "${GEN_DATA_DIR}"
fi
# help # help
if [ ! "${1}" ]; then print_help && exit 10; fi if [ ! "${1}" ]; then print_help && exit 10; fi
# config file # config file
@ -90,7 +96,7 @@ fi
# create MD5 list in base64 format # create MD5 list in base64 format
if which jigdo-gen-md5-list >/dev/null 2>&1; then if which jigdo-gen-md5-list >/dev/null 2>&1; then
printf "$0: Creating MD5 list in hex format..." printf "$0: Creating MD5 list in hex format..."
jigdo-gen-md5-list ${DIR} > ${IMG}.md5 jigdo-gen-md5-list ${DIR} > ${GEN_DATA_DIR}/${IMG}.md5
printf "Done.\n" printf "Done.\n"
else else
printf "\n$0: Not found: jigdo-gen-md5-list. Install jigit." printf "\n$0: Not found: jigdo-gen-md5-list. Install jigit."
@ -102,7 +108,7 @@ fi
CMD="${XOR} \ CMD="${XOR} \
-as mkisofs \ -as mkisofs \
-quiet \ -quiet \
-o ${IMG}.iso \ -o ${GEN_DATA_DIR}/${IMG}.iso \
-R \ -R \
-V ISOJIGDO \ -V ISOJIGDO \
-partition_offset 16 \ -partition_offset 16 \
@ -125,10 +131,10 @@ CMD+="\
-jigdo-template-compress gzip \ -jigdo-template-compress gzip \
-checksum_algorithm_iso md5,sha1,sha256,sha512 \ -checksum_algorithm_iso md5,sha1,sha256,sha512 \
-checksum_algorithm_template md5,sha1,sha256,sha512 \ -checksum_algorithm_template md5,sha1,sha256,sha512 \
-jigdo-jigdo ${IMG}.jigdo \ -jigdo-jigdo ${GEN_DATA_DIR}/${IMG}.jigdo \
-jigdo-template ${IMG}.template \ -jigdo-template ${GEN_DATA_DIR}/${IMG}.template \
-jigdo-map Debian=${DIR} \ -jigdo-map Debian=${DIR} \
-md5-list ${IMG}.md5 \ -md5-list ${GEN_DATA_DIR}/${IMG}.md5 \
-jigdo-min-file-size 1024 \ -jigdo-min-file-size 1024 \
" "
@ -142,10 +148,10 @@ ${CMD}
if which jigit-mkimage >/dev/null 2>&1; then if which jigit-mkimage >/dev/null 2>&1; then
printf "$0: Creating new ISO from jigdo files..." printf "$0: Creating new ISO from jigdo files..."
jigit-mkimage \ jigit-mkimage \
-t ${IMG}.template \ -t ${GEN_DATA_DIR}/${IMG}.template \
-j ${IMG}.jigdo \ -j ${GEN_DATA_DIR}/${IMG}.jigdo \
-m Debian=${DIR} \ -m Debian=${DIR} \
-o ${IMG}.new -o ${GEN_DATA_DIR}/${IMG}.new
printf "Done.\n" printf "Done.\n"
else else
printf "\n$0: Not found: jigit-mkimage. Install jigit." printf "\n$0: Not found: jigit-mkimage. Install jigit."
@ -154,11 +160,11 @@ else
fi fi
# trap the exit code of diff and let the Universe explode # trap the exit code of diff and let the Universe explode
diff ${IMG}.iso ${IMG}.new diff ${GEN_DATA_DIR}/${IMG}.iso ${GEN_DATA_DIR}/${IMG}.new
DIFF_RET="$?" DIFF_RET="$?"
case ${DIFF_RET} in case ${DIFF_RET} in
0) 0)
echo -e "$0: diff ${IMG}.iso ${IMG}.new matched.\n" echo -e "$0: diff ${GEN_DATA_DIR}/${IMG}.iso ${GEN_DATA_DIR}/${IMG}.new matched.\n"
;; ;;
*) *)
echo -e "$0: FAIL: diff returned code: $DIFF_RET\n" echo -e "$0: FAIL: diff returned code: $DIFF_RET\n"
@ -170,10 +176,10 @@ if [ ${CLEAN} -eq 1 ]; then
# safety net, just in case -> we want to be in the starting # safety net, just in case -> we want to be in the starting
# directory before removing whatever self-generated stuff # directory before removing whatever self-generated stuff
cd "${START_DIR_DONT_CHANGE}" || exit 80 cd "${START_DIR_DONT_CHANGE}" || exit 80
rm -f ${RES} rm -rf ${GEN_DATA_DIR}
printf "$0: removed %s\n" ${RES} printf "$0: removed %s\n" ${GEN_DATA_DIR}
else else
printf "$0: left %s\n" ${RES} printf "$0: left %s\n" ${GEN_DATA_DIR}
fi fi
# last hints # last hints