[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#258315: XSI:isms in discover.init



Package: discover1
Version: 1.6.1
Severity: minor
Tags: patch

discover.init contains use of the XSI:isms `-a' and `-o' in tests.
This patch fixes this.

Rationale:
Policy 10.4
http://www.opengroup.org/onlinepubs/009695399/utilities/test.html


Regards: David Weinehall

diff -ur discover1-1.6.1-old/discover/discover.init discover1-1.6.1/discover/discover.init
--- discover1-1.6.1-old/discover/discover.init	2004-06-16 05:12:52.000000000 +0300
+++ discover1-1.6.1/discover/discover.init	2004-07-08 21:16:36.000000000 +0300
@@ -99,7 +99,7 @@
 for MODULE in $MODULES
 do
     # See if we should skip $MODULE:
-    if [ "$MODULE" = "ignore" -o "$MODULE" = "unknown" ]
+    if [ "$MODULE" = "ignore" ] || [ "$MODULE" = "unknown" ]
     then
         continue
     fi
@@ -163,16 +163,16 @@
     for CDROM in $(run_discover --device cdrom | sort)
     do
         ALTCDROM=$(echo $CDROM | sed 's/\/dev\/scd/\/dev\/sr/')
-        if [ ! -e $CDROM -a ! -e $ALTCDROM ] 
+        if [ ! -e $CDROM ] && [ ! -e $ALTCDROM ] 
         then
             echo -n "discover reports that $CDROM is a CD/DVD device, but it and $ALTCDROM " >&2
             echo "do not exist.  Not updating /dev/cdrom$CDNUM." >&2
-        elif [ ! -b $CDROM -a ! -e $ALTCDROM ]
+        elif [ ! -b $CDROM ] && [ ! -e $ALTCDROM ]
         then
             
             echo -n "discover reports that $CDROM is a CD/DVD device, but it and $ALTCDROM " >&2
             echo "are not block devices.  Not updating /dev/cdrom$CDNUM." >&2
-        elif [ -e /dev/cdrom$CDNUM -a ! -L /dev/cdrom$CDNUM ]
+        elif [ -e /dev/cdrom$CDNUM ] && [ ! -L /dev/cdrom$CDNUM ]
         then
             echo -n "/dev/cdrom$CDNUM exists and is not a symlink.  Not updating " >&2
             echo "/dev/cdrom$CDNUM." >&2
@@ -193,7 +193,7 @@
     # Link /dev/cdrom to the appropriate device:
     if [ -e /dev/cdrom0 ]
     then
-        if [ -L /dev/cdrom -o ! -e /dev/cdrom ]
+        if [ -L /dev/cdrom ] || [ ! -e /dev/cdrom ]
         then
             ln -fs /dev/cdrom0 /dev/cdrom
             # link the mountpoint only if nothing is mounted there



Reply to: