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 2124820d4e
commit c270e8b0ae
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
+ start a new test over the top of template_new_releng
+ file name starts with releng_
+ any generated data to be stored in ./$0.result directory
+ mandatory options -rc [-clean]
+ well documented configuration file test.conf{.template}
+ throw FAIL string to stdout if any failure is detected

View File

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