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

View File

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

View File

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