libisoburn/releng/releng_print_size

83 lines
1.8 KiB
Plaintext
Raw Normal View History

#!/bin/bash
set -e
START_DIR_DONT_CHANGE=`pwd`
SELF=$(basename "$0")
# required config items
RELENG_XORRISO=/usr/bin/xorriso
RELENG_GENISOIMAGE=/usr/bin/genisoimage
RELENG_MKISOFS=/usr/bin/mkisofs
# config file
CONFFILE=${HOME}/.libburnia-releng/${SELF}.conf
GEN_DATA_DIR=releng_generated_data/${SELF}
UPPER=4
KEEP=0
#####################################################################
print_help() {
cat << HLP
Usage:
$0 -help
# using a config file ${CONFFILE}
$0 -rc [-keep]
# without using a config file
$0 your_own_options_here
# cleanup test generated data directory and exit
$0 -cleanup
HLP
}
#####################################################################
print_help
#if [ ! -x "${XOR}" ]; then
# printf "$0: Not found or not an executable: $XOR\n"
# exit 50
#fi
# xorriso version details, incl. underlying libraries
# "${XOR}" -version
printf "${SELF}: Generating sample tree\n"
for ((i1=0; i1 < ${UPPER}/4; i1++))
do
for ((i2=0; i2 < ${UPPER}/2; i2++))
do
for ((i3=0; i3 < ${UPPER}; i3++))
do
mkdir -p ${GEN_DATA_DIR}/DirOne$i1/DirTwo$i2/DirThree$i3
touch ${GEN_DATA_DIR}/DirOne$i1/DirTwo$i2/DirThree$i3/FileOne
done
done
done
# Disk cache might play dirty games, so re-run these several times?
if [ -x ${RELENG_XORRISO} ]; then
printf "${RELENG_XORRISO}\n"
time ${RELENG_XORRISO} -as mkisofs -quiet -print-size ${GEN_DATA_DIR}
fi
if [ -x ${RELENG_GENISOIMAGE} ]; then
printf "${RELENG_GENISOIMAGE}\n"
time ${RELENG_GENISOIMAGE} -quiet -print-size ${GEN_DATA_DIR}
fi
if [ -x ${RELENG_MKISOFS} ]; then
printf "${RELENG_MKISOFS}\n"
time ${RELENG_MKISOFS} -quiet -print-size ${GEN_DATA_DIR}
fi
cd ${START_DIR_DONT_CHANGE} || exit 2
rm -rf ${GEN_DATA_DIR}
printf "\n${SELF}: FAIL: SCRIPT NOT COMPLETED YET\n"
exit 31
exit 0