diff --git a/libisoburn/trunk/releng/releng_build_isojigdo.conf.template b/libisoburn/trunk/releng/releng_build_isojigdo.conf.template index 5f22fc69..1b23101c 100644 --- a/libisoburn/trunk/releng/releng_build_isojigdo.conf.template +++ b/libisoburn/trunk/releng/releng_build_isojigdo.conf.template @@ -1,5 +1,5 @@ # *** Set your paths, see below -# *** Expected location is $HOME/releng_build_isojigdo.conf +# *** Expected location is $HOME/.libburnia-releng/releng_build_isojigdo.conf # *** Then a run of 'releng_build_isojigdo -rc' will pick it up # xorriso executable to be tested diff --git a/libisoburn/trunk/releng/releng_print_size b/libisoburn/trunk/releng/releng_print_size index d46b257b..7bdb9dd0 100755 --- a/libisoburn/trunk/releng/releng_print_size +++ b/libisoburn/trunk/releng/releng_print_size @@ -5,7 +5,7 @@ set -e START_DIR_DONT_CHANGE=`pwd` SELF=$(basename "$0") # required config items -RELENG_XORRISO=/usr/bin/xorriso +RELENG_XORRISO="" RELENG_GENISOIMAGE=/usr/bin/genisoimage RELENG_MKISOFS=/usr/bin/mkisofs @@ -13,7 +13,7 @@ RELENG_MKISOFS=/usr/bin/mkisofs CONFFILE=${HOME}/.libburnia-releng/${SELF}.conf GEN_DATA_DIR=releng_generated_data/${SELF} -UPPER=4 +UPPER=32 KEEP=0 ##################################################################### @@ -26,7 +26,7 @@ Usage: $0 -rc [-keep] # without using a config file - $0 your_own_options_here + $0 TODO: not ready yet # cleanup test generated data directory and exit $0 -cleanup @@ -34,16 +34,70 @@ HLP } ##################################################################### -print_help -#if [ ! -x "${XOR}" ]; then -# printf "$0: Not found or not an executable: $XOR\n" -# exit 50 -#fi +# cleanup +if [ "${1}" == "-cleanup" ]; then + cd "${START_DIR_DONT_CHANGE}" || exit 80 + if [ -d "${GEN_DATA_DIR}" ]; then + rm -rf ${GEN_DATA_DIR} + printf "${SELF}: removed %s\n" ${GEN_DATA_DIR} + else + printf "${SELF}: ${GEN_DATA_DIR} does not exist.\n" + fi + exit 0 +fi + +# help +if [ ! "${1}" ]; then print_help && exit 10; fi +# config file +if [ "${1}" == "-rc" ]; then + if [ -e ${CONFFILE} ]; then + . ${CONFFILE} + printf "${SELF}: Using config file %s\n" ${CONFFILE} + else + echo -e "\n${SELF}: Config file ${CONFFILE} not found.\n" && exit 20 + fi + if [ "${2}" == "-keep" ]; then KEEP=1; fi +# command line args +elif [ "${2}" ]; then + RELENG_XORRISO="${2}" + if [ "${3}" == "-keep" ]; then KEEP=1; fi +# the rest +else + print_help && exit 30 +fi + +# data dir +if [ -d "${GEN_DATA_DIR}" ]; then + printf "\n${SELF}: directory %s exists!" ${GEN_DATA_DIR} + printf "\n${SELF}: use '${SELF} -cleanup' to remove.\n" + exit 2 +else + mkdir "${GEN_DATA_DIR}" +fi + +if [ "${RELENG_XORRISO}" == "" ]; then + echo -e "\n${SELF}: xorriso_cmd is required\n" + exit 40 +fi + +if [ ! -x "${RELENG_XORRISO}" ]; then + printf "${SELF}: Not found or not an executable: $RELENG_XORRISO\n" + exit 50 +fi + +# all must be set at this point +printf "${SELF}: Config items:" +printf "\n\txorriso_cmd=${RELENG_XORRISO}\n" # xorriso version details, incl. underlying libraries -# "${XOR}" -version - +"${RELENG_XORRISO}" -version +if ! "${RELENG_XORRISO}" -version | grep libjte >/dev/null 2>&1; then + printf "\n${SELF}: JTE not supported with this xorriso build. Install jigit and rebuild." + printf "\n${SELF}: See http://www.einval.com/~steve/software/JTE/\n" + exit 51 +fi +################################################ printf "${SELF}: Generating sample tree\n" for ((i1=0; i1 < ${UPPER}/4; i1++)) do @@ -73,10 +127,11 @@ if [ -x ${RELENG_MKISOFS} ]; then time ${RELENG_MKISOFS} -quiet -print-size ${GEN_DATA_DIR} fi -cd ${START_DIR_DONT_CHANGE} || exit 2 - -rm -rf ${GEN_DATA_DIR} +if [ ${KEEP} -eq 0 ]; then + cd ${START_DIR_DONT_CHANGE} || exit 2 + rm -rf ${GEN_DATA_DIR} +fi printf "\n${SELF}: FAIL: SCRIPT NOT COMPLETED YET\n" exit 31 -exit 0 + diff --git a/libisoburn/trunk/releng/releng_print_size.conf.template b/libisoburn/trunk/releng/releng_print_size.conf.template new file mode 100644 index 00000000..2c2a6ac6 --- /dev/null +++ b/libisoburn/trunk/releng/releng_print_size.conf.template @@ -0,0 +1,6 @@ +# *** Set your paths, see below +# *** Expected location is $HOME/.libburnia-releng/releng_print_size.conf +# *** Then a run of 'releng_print_size -rc' will pick it up + +# xorriso executable to be tested +RELENG_XORRISO=/path/to/xorriso