implement -keep

This commit is contained in:
George Danchev 2011-06-27 14:31:39 +00:00
parent 88378b25af
commit 050b93514a
3 changed files with 10 additions and 10 deletions

View File

@ -12,7 +12,7 @@ IMG=""
ISOLINUX_BIN=""
BOOT_CAT=""
CONFFILE=$HOME/releng_build_isojigdo.conf
CLEAN=0
KEEP=0
GEN_DATA_DIR=$0.result
RES=""
@ -21,9 +21,9 @@ print_help() {
Usage:
$0 -help
# using a config file ${CONFFILE}
$0 -rc [-clean]
$0 -rc [-keep]
# without using a config file
$0 xorriso_cmd IN_dir OUT_image [IN_isolinux] [OUT_bootcat] [-clean]
$0 xorriso_cmd IN_dir OUT_image [IN_isolinux] [OUT_bootcat] [-keep]
HLP
}
@ -44,7 +44,7 @@ if [ "${1}" == "-rc" ]; then
else
echo -e "\n$0: Config file ${CONFFILE} not found.\n" && exit 20
fi
if [ "${2}" == "-clean" ]; then CLEAN=1; fi
if [ "${2}" == "-keep" ]; then KEEP=1; fi
# command line args
elif [ "${3}" ]; then
XOR="${1}"
@ -53,7 +53,7 @@ elif [ "${3}" ]; then
if [ "${4}" ]; then
ISOLINUX_BIN="${4}"
if [ "${5}" ]; then BOOT_CAT="${5}"; fi
if [ "${4}" == "-clean" -o "${5}" == "-clean" -o "${6}" == "-clean" ]; then CLEAN=1; fi
if [ "${4}" == "-keep" -o "${5}" == "-keep" -o "${6}" == "-keep" ]; then KEEP=1; fi
fi
# the rest
else
@ -172,14 +172,14 @@ case ${DIFF_RET} in
esac
# sort out the cruft
if [ ${CLEAN} -eq 1 ]; then
if [ ${KEEP} -eq 0 ]; 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 -rf ${GEN_DATA_DIR}
printf "$0: removed %s\n" ${GEN_DATA_DIR}
else
printf "$0: left %s\n" ${GEN_DATA_DIR}
printf "$0: leaving %s\n" ${GEN_DATA_DIR}
fi
# last hints

View File

@ -21,7 +21,7 @@ for s in `ls | grep ^releng_ | grep -v ${SELF} | sort`; do
T1=`date '+%s'`
set +e
# -rc -clean are shared options amongst the all releng scripts
./${s} -rc -clean 1>>${CLOG1} 2>>${CLOG2}
./${s} -rc 1>>${CLOG1} 2>>${CLOG2}
RET=$?
T2=`date '+%s'`
let TS="${T2}-${T1}"

View File

@ -11,7 +11,7 @@ START_DIR_DONT_CHANGE=`pwd`
# config file
CONFFILE=$HOME/TODO.conf
CLEAN=0
KEEP=0
#####################################################################
print_help() {
@ -19,7 +19,7 @@ print_help() {
Usage:
$0 -help
# using a config file ${CONFFILE}
$0 -rc [-clean]
$0 -rc [-keep]
# without using a config file
$0
HLP