completed transitioning, docs reflect that too
This commit is contained in:
@ -2,29 +2,39 @@
|
||||
|
||||
set -e
|
||||
|
||||
# It is not a good idea to include inc/releng_getopts.inc with the
|
||||
# master script as it calls the subordinate scripts and they include
|
||||
# this file too, and we want to avoid sharing variable with subshells
|
||||
|
||||
SELF=$(basename "$0")
|
||||
GEN_DATA_DIR=releng_generated_data
|
||||
CLOG=${GEN_DATA_DIR}/log.${SELF}
|
||||
PASSED_OPTIONS="$@"
|
||||
CLEANUP_LOG=0
|
||||
|
||||
PASSED_OPTIONS=""
|
||||
#############################################
|
||||
while getopts “x:k:c:f:h” OPT
|
||||
do
|
||||
case $OPT in
|
||||
c)
|
||||
CLEANUP_LOG=1
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ "${1}" == "-cleanup" ]; then
|
||||
PASSED_OPTIONS="-cleanup"
|
||||
elif [ "${1}" == "-rc" -a "${2}" == "-keep" ]; then
|
||||
PASSED_OPTIONS="-rc -keep"
|
||||
elif [ "${1}" == "-rc" ]; then
|
||||
PASSED_OPTIONS="-rc"
|
||||
else
|
||||
if [ ! "${1}" ]; then
|
||||
cat << HLP
|
||||
|
||||
${SELF} runs executables from CWD starting with releng_*.
|
||||
${SELF} runs executables from CWD starting with releng_*, passing them its own options.
|
||||
stdout/stderr output stored in ${CLOG}
|
||||
|
||||
${SELF} -rc [-keep]
|
||||
${SELF} -cleanup
|
||||
${SELF} -x path/to/xorriso [-k1]
|
||||
${SELF} -c1
|
||||
|
||||
HLP
|
||||
exit 101
|
||||
exit 31
|
||||
fi
|
||||
|
||||
########################################################
|
||||
@ -63,9 +73,16 @@ fi
|
||||
DEND=`date --utc`
|
||||
printf "\n${SELF}: Stopped at ${DEND}."
|
||||
|
||||
if [ "${1}" == "-cleanup" ]; then
|
||||
if [ -f "${CLOG}" ]; then rm -f "${CLOG}"; fi
|
||||
if [ -f "${CLOG}".prev ]; then rm -f "${CLOG}".prev; fi
|
||||
if [ "${CLEANUP_LOG}" -eq 1 ]; then
|
||||
if [ -f "${CLOG}" ]; then
|
||||
printf "\n${SELF}: Removed my own log ${CLOG}."
|
||||
rm -f "${CLOG}"
|
||||
fi
|
||||
if [ -f "${CLOG}".prev ]; then
|
||||
printf "\n${SELF}: Removed my own log ${CLOG}.prev."
|
||||
rm -f "${CLOG}".prev
|
||||
fi
|
||||
printf "\n"
|
||||
else
|
||||
E2=`date '+%s'`
|
||||
let ES="${E2} - ${E1}"
|
||||
@ -110,6 +127,5 @@ fi
|
||||
fi
|
||||
fi
|
||||
|
||||
printf "\n"
|
||||
|
||||
# Fin
|
||||
exit 0
|
||||
|
Reference in New Issue
Block a user