Blame SOURCES/0001-Fix-issues-with-multi-word-device-types.patch

39359f
commit 9a2c94700471486dd6487b7659762a41f7ee33c7
39359f
Author: David Sommerseth <davids@redhat.com>
39359f
Date:   Fri Apr 15 20:31:32 2016 +0200
39359f
39359f
    Fix issues with multi word device types
39359f
    
39359f
    When running rescan-scsi-bus.sh on systems with device types such
39359f
    as "Medium Changer" or "Optical Device", the following error can be
39359f
    observed:
39359f
    
39359f
       /usr/bin/rescan-scsi-bus.sh: line 281: [: too many arguments
39359f
    
39359f
    Signed-off-by: David Sommerseth <davids@redhat.com>
39359f
39359f
diff --git a/scripts/rescan-scsi-bus.sh b/scripts/rescan-scsi-bus.sh
39359f
old mode 100755
39359f
new mode 100644
39359f
index 81112c1..7ec9323
39359f
--- a/scripts/rescan-scsi-bus.sh
39359f
+++ b/scripts/rescan-scsi-bus.sh
39359f
@@ -278,7 +278,9 @@ testonline ()
39359f
     return 1
39359f
   fi
39359f
   TMPSTR=`echo "$SCSISTR" | sed -n 's/.*Type: *\(.*\) *ANSI.*/\1/p'`
39359f
-  if [ $TMPSTR != $TYPE ] ; then
39359f
+  NTMPSTR="$(sed -e 's/[[:space:]]*$//' -e 's/^[[:space:]]*//' <<<${TMPSTR})"
39359f
+  NTYPE="$(sed -e 's/[[:space:]]*$//' -e 's/^[[:space:]]*//' <<<${TYPE})"
39359f
+  if [ "$NTMPSTR" != "$NTYPE" ] ; then
39359f
     echo -e "\e[A\e[A\e[A\e[A${red}$SGDEV changed: ${bold}\nfrom:${TMPSTR} \nto: $TYPE ${norm} \n\n\n"
39359f
     return 1
39359f
   fi