Print this page
XXX Remove nawk(1)

*** 157,186 **** function getsize { # Estimate image size and add 10% overhead for ufs stuff. # Note, we can't use du here in case we're on a filesystem, e.g. zfs, # in which the disk usage is less than the sum of the file sizes. ! # The nawk code # # {t += ($5 % 1024) ? (int($5 / 1024) + 1) * 1024 : $5} # # below rounds up the size of a file/directory, in bytes, to the # next multiple of 1024. This mimics the behavior of ufs especially # with directories. This results in a total size that's slightly # bigger than if du was called on a ufs directory. size32=$(cat "$list32" | xargs -I {} ls -lLd "{}" 2> /dev/null | ! nawk '{t += ($5 % 1024) ? (int($5 / 1024) + 1) * 1024 : $5} END {print int(t * 1.10 / 1024)}') (( size32 += dirsize32 )) size64=$(cat "$list64" | xargs -I {} ls -lLd "{}" 2> /dev/null | ! nawk '{t += ($5 % 1024) ? (int($5 / 1024) + 1) * 1024 : $5} END {print int(t * 1.10 / 1024)}') (( size64 += dirsize64 )) (( total_size = size32 + size64 )) if [ $compress = yes ] ; then ! total_size=`echo $total_size | nawk '{print int($1 / 2)}'` fi } # # Copies all desired files to a target directory. One argument should be --- 157,186 ---- function getsize { # Estimate image size and add 10% overhead for ufs stuff. # Note, we can't use du here in case we're on a filesystem, e.g. zfs, # in which the disk usage is less than the sum of the file sizes. ! # The awk code # # {t += ($5 % 1024) ? (int($5 / 1024) + 1) * 1024 : $5} # # below rounds up the size of a file/directory, in bytes, to the # next multiple of 1024. This mimics the behavior of ufs especially # with directories. This results in a total size that's slightly # bigger than if du was called on a ufs directory. size32=$(cat "$list32" | xargs -I {} ls -lLd "{}" 2> /dev/null | ! /usr/xpg4/bin/awk '{t += ($5 % 1024) ? (int($5 / 1024) + 1) * 1024 : $5} END {print int(t * 1.10 / 1024)}') (( size32 += dirsize32 )) size64=$(cat "$list64" | xargs -I {} ls -lLd "{}" 2> /dev/null | ! /usr/xpg4/bin/awk '{t += ($5 % 1024) ? (int($5 / 1024) + 1) * 1024 : $5} END {print int(t * 1.10 / 1024)}') (( size64 += dirsize64 )) (( total_size = size32 + size64 )) if [ $compress = yes ] ; then ! total_size=`echo $total_size | /usr/xpg4/bin/awk '{print int($1 / 2)}'` fi } # # Copies all desired files to a target directory. One argument should be
*** 393,403 **** create_isofs "$which" "$archive" fi # sanity check the archive before moving it into place # ! ARCHIVE_SIZE=`ls -l "${archive}-new" 2> /dev/null | nawk '{ print $5 }'` if [ $compress = yes ] || [ $ISA = sparc ] ; then # # 'file' will report "English text" for uncompressed # boot_archives. Checking for that doesn't seem stable, # so we just check that the file exists. --- 393,403 ---- create_isofs "$which" "$archive" fi # sanity check the archive before moving it into place # ! ARCHIVE_SIZE=`ls -l "${archive}-new" 2> /dev/null | /usr/xpg4/bin/awk '{ print $5 }'` if [ $compress = yes ] || [ $ISA = sparc ] ; then # # 'file' will report "English text" for uncompressed # boot_archives. Checking for that doesn't seem stable, # so we just check that the file exists.
*** 475,485 **** do if [ $SPLIT = no ]; then print "$path" elif [ -d "$path" ]; then if [ $format = ufs ]; then ! size=`ls -lLd "$path" | nawk ' {print ($5 % 1024) ? (int($5 / 1024) + 1) * 1024 : $5}'` if [ `basename "$path"` != "amd64" ]; then (( dirsize32 += size )) fi (( dirsize64 += size )) --- 475,485 ---- do if [ $SPLIT = no ]; then print "$path" elif [ -d "$path" ]; then if [ $format = ufs ]; then ! size=`ls -lLd "$path" | /usr/xpg4/bin/awk ' {print ($5 % 1024) ? (int($5 / 1024) + 1) * 1024 : $5}'` if [ `basename "$path"` != "amd64" ]; then (( dirsize32 += size )) fi (( dirsize64 += size ))