Made releng/auto_printsize ready for FreeBSD ("bash" linked to /bin/sh)

This commit is contained in:
Thomas Schmitt 2011-08-09 19:38:16 +00:00
parent 9a473ac931
commit 15c3c70212

View File

@ -55,14 +55,51 @@ FILE_UPPER=10
printf "\n${SELF}: Generating sample tree in ${GEN_DATA_DIR} :\n" printf "\n${SELF}: Generating sample tree in ${GEN_DATA_DIR} :\n"
count=0 count=0
date date
for ((i1=0; i1 < ${DIR_UPPER}/4; i1++))
# Hopefully the for-loops are much faster than while-loops with arithmetics
# This needs 7/4*DIR_UPPER+FILE_UPPER (= 66) while-iterations
#
i1_list=
i1=0
o1=$(expr ${DIR_UPPER} / 4)
while test $i1 -lt $o1
do do
for ((i2=0; i2 < ${DIR_UPPER}/2; i2++)) i1_list="$i1_list $i1"
i1=$(expr $i1 + 1)
done
i2_list=
i2=0
o2=$(expr ${DIR_UPPER} / 2)
while test $i2 -lt $o2
do
i2_list="$i2_list $i2"
i2=$(expr $i2 + 1)
done
i3_list=
i3=0
while test $i3 -lt ${DIR_UPPER}
do
i3_list="$i3_list $i3"
i3=$(expr $i3 + 1)
done
i_file_list=
i_file=0
while test $i_file -lt ${FILE_UPPER}
do
i_file_list="$i_file_list $i_file"
i_file=$(expr $i_file + 1)
done
#
# plus 1/8*DIR_UPPER*DIR_UPPER*DIR_UPPER*FILE_UPPER (= 40960) for-iterations
#
for i1 in $i1_list
do
for i2 in $i2_list
do do
for ((i3=0; i3 < ${DIR_UPPER}; i3++)) for i3 in $i3_list
do do
mkdir -p ${GEN_DATA_DIR}/DirOne$i1/DirTwo$i2/DirThree$i3 mkdir -p ${GEN_DATA_DIR}/DirOne$i1/DirTwo$i2/DirThree$i3
for ((i_file=0; i_file < ${FILE_UPPER}; i_file++)) for i_file in $i_file_list
do do
echo -n \ echo -n \
> ${GEN_DATA_DIR}/DirOne$i1/DirTwo$i2/DirThree$i3/File_${i_file} > ${GEN_DATA_DIR}/DirOne$i1/DirTwo$i2/DirThree$i3/File_${i_file}
@ -72,6 +109,7 @@ do
done done
echo " ${count} files created ..." echo " ${count} files created ..."
done done
printf "done.\n" printf "done.\n"
date date
du -s "${GEN_DATA_DIR}" du -s "${GEN_DATA_DIR}"