Blame SOURCES/sg3_utils-1.48-rescan-scsi-bus.sh_seq_-s.patch

65fa6d
From 9939d8d804d0ce423824836173c296daf4e13e99 Mon Sep 17 00:00:00 2001
65fa6d
From: Douglas Gilbert <dgilbert@interlog.com>
65fa6d
Date: Mon, 7 Feb 2022 16:02:32 +0000
65fa6d
Subject: [PATCH] rescan-scsi-bus.sh: Use "seq -s"
65fa6d
65fa6d
Since the commit [git: 8c86fe2; svn rev 815  "library: add to '.so' name;
65fa6d
rescan-scsi-bus: multiple patches to sync with Suse], we correctly use
65fa6d
quoting when we print $idsearch or $lunsearch. This causes a change in
65fa6d
the output of the script, because these number lists are generated by
65fa6d
the GNU seq utility, which uses "\n" as default separator, and the
65fa6d
quoting now causes the newlines to be preserved. Use "seq -s" to
65fa6d
generate space-separated lists instead.
65fa6d
65fa6d
65fa6d
65fa6d
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@936 6180dd3e-e324-4e3e-922d-17de1ae2f315
65fa6d
---
65fa6d
 ChangeLog                  |  4 +++-
65fa6d
 scripts/rescan-scsi-bus.sh | 12 ++++++------
65fa6d
 2 files changed, 9 insertions(+), 7 deletions(-)
65fa6d
65fa6d
diff --git a/scripts/rescan-scsi-bus.sh b/scripts/rescan-scsi-bus.sh
65fa6d
index e4eeef1..78544b1 100755
65fa6d
--- a/scripts/rescan-scsi-bus.sh
65fa6d
+++ b/scripts/rescan-scsi-bus.sh
65fa6d
@@ -716,7 +716,7 @@ expandlist ()
65fa6d
       result="$result $beg";
65fa6d
     else
65fa6d
       end=${first#*-}
65fa6d
-      result="$result $(seq $beg $end)"
65fa6d
+      result="$result $(seq -s ' ' $beg $end)"
65fa6d
     fi
65fa6d
     [ "$rest" = "$first" ] && rest=""
65fa6d
     first=${rest%%,*}
65fa6d
@@ -1200,7 +1200,7 @@ fi
65fa6d
 unsetcolor
65fa6d
 debug=0
65fa6d
 lunsearch=
65fa6d
-opt_idsearch=$(seq 0 7)
65fa6d
+opt_idsearch=$(seq -s ' ' 0 7)
65fa6d
 filter_ids=0
65fa6d
 opt_channelsearch=
65fa6d
 remove=
65fa6d
@@ -1227,13 +1227,13 @@ while [ ! -z "$opt" ] && [ -z "${opt##-*}" ] ; do
65fa6d
     f) flush=1 ;;
65fa6d
     i) lipreset=0 ;;
65fa6d
     I) shift; lipreset=$opt ;;
65fa6d
-    l) lunsearch=$(seq 0 7) ;;
65fa6d
-    L) lunsearch=$(seq 0 "$2"); shift ;;
65fa6d
+    l) lunsearch=$(seq -s ' ' 0 7) ;;
65fa6d
+    L) lunsearch=$(seq -s ' ' 0 "$2"); shift ;;
65fa6d
     m) mp_enable=1 ;;
65fa6d
     r) remove=1 ;;
65fa6d
     s) resize=1; mp_enable=1 ;;
65fa6d
     u) update=1 ;;
65fa6d
-    w) opt_idsearch=$(seq 0 15) ;;
65fa6d
+    w) opt_idsearch=$(seq -s ' ' 0 15) ;;
65fa6d
     -alltargets)  existing_targets=;;
65fa6d
     -attachpq3) scan_flags=$((scan_flags|0x1000000)) ;;
65fa6d
     -channels=*)  arg=${opt#-channels=};opt_channelsearch=$(expandlist "$arg") ;;
65fa6d
@@ -1257,7 +1257,7 @@ while [ ! -z "$opt" ] && [ -z "${opt##-*}" ] ; do
65fa6d
     -sparselun) scan_flags=$((scan_flags|0x40)) ;;
65fa6d
     -sync) sync=2 ;;
65fa6d
     -update) update=1;;
65fa6d
-    -wide) opt_idsearch=$(seq 0 15) ;;
65fa6d
+    -wide) opt_idsearch=$(seq -s ' ' 0 15) ;;
65fa6d
     *) echo "Unknown option -$opt !" ;;
65fa6d
   esac
65fa6d
   shift