Ticket #2569: fix bashisms in extfs

Several extfs scripts (notably iso9660) don't work on linux
distributions using dash as the default shell. This patch
fixes all current problems in extfs reported by checkbashisms
utility.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
Jindrich Makovicka 2011-07-05 17:13:21 +02:00 committed by Slava Zanko
parent 0b71156473
commit b0ba12d49c
4 changed files with 22 additions and 4 deletions

View File

@ -78,7 +78,7 @@ BEGIN {
} }
mcisofs_copyout () { mcisofs_copyout () {
if [ "x$SEMICOLON" == "xYES" ]; then if [ "x$SEMICOLON" = "xYES" ]; then
$ISOINFO -i "$1" -x "/$2;1" 2>/dev/null > "$3" $ISOINFO -i "$1" -x "/$2;1" 2>/dev/null > "$3"
else else
$ISOINFO -i "$1" -x "/$2" 2>/dev/null > "$3" $ISOINFO -i "$1" -x "/$2" 2>/dev/null > "$3"

View File

@ -22,7 +22,13 @@ ACE_GET="unace x"
# ls: # ls:
mc_ace_fs_list() mc_ace_fs_list()
{ {
$ACE_LIST "$1" | gawk -v uid=${UID-0} ' if [ "x$UID" = "x" ]; then
UID=`id -ru 2>/dev/null`
if [ "x$UID" = "x" ]; then
UID=0
fi
fi
$ACE_LIST "$1" | gawk -v uid=$UID '
BEGIN { Month="JanFebMarAprMayJunJulAugSepOctNovDec" } BEGIN { Month="JanFebMarAprMayJunJulAugSepOctNovDec" }
/%/ { /%/ {
split($1,date,".") split($1,date,".")

View File

@ -19,7 +19,13 @@ ARC_DEL="arc d"
mc_arc_fs_list() mc_arc_fs_list()
{ {
$ARC_LIST "$1" | gawk -v uid=${UID-0} ' if [ "x$UID" = "x" ]; then
UID=`id -ru 2>/dev/null`
if [ "x$UID" = "x" ]; then
UID=0
fi
fi
$ARC_LIST "$1" | gawk -v uid=$UID '
BEGIN { } BEGIN { }
/^Name/ { next } /^Name/ { next }
/===/ { next } /===/ { next }

View File

@ -20,7 +20,13 @@ C1541="c1541"
# There are no time stamps in the disk image, so a bogus timestamp is displayed # There are no time stamps in the disk image, so a bogus timestamp is displayed
mc_c1541_fs_list() mc_c1541_fs_list()
{ {
$C1541 "$1" -list | gawk -v uid=${UID-0} ' if [ x"$UID" = x ]; then
UID=`id -ru 2>/dev/null`
if [ "x$UID" = "x" ]; then
UID=0
fi
fi
$C1541 "$1" -list | gawk -v uid=$UID '
BEGIN { FS = "\"" } BEGIN { FS = "\"" }
/No LINES!/ { next } /No LINES!/ { next }
/BLOCKS FREE/ { next } /BLOCKS FREE/ { next }