From 2b53d7e429d9301e459ffefa7913f1af867be330 Mon Sep 17 00:00:00 2001 From: Wenchao Hao Date: Fri, 1 Jul 2022 11:40:39 +0800 Subject: [PATCH] fix syntax error introduced by patch Signed-off-by: Wenchao Hao (cherry picked from commit aea8bfe282fd5714d141669d45898468c55e72b0) --- 0002-bugfix-sg3_utils-fix-syntax-error.patch | 35 ++++---------------- sg3_utils.spec | 5 ++- 2 files changed, 11 insertions(+), 29 deletions(-) diff --git a/0002-bugfix-sg3_utils-fix-syntax-error.patch b/0002-bugfix-sg3_utils-fix-syntax-error.patch index d2c7fac..a5b06a8 100644 --- a/0002-bugfix-sg3_utils-fix-syntax-error.patch +++ b/0002-bugfix-sg3_utils-fix-syntax-error.patch @@ -3,54 +3,33 @@ From: sunshihao Date: Thu, 16 Apr 2020 10:53:25 +0800 Subject: [PATCH 3/4] bugfix-sg3_utils-fix-syntax-error +Signed-off-by: Wenchao Hao --- - scripts/rescan-scsi-bus.sh | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) + scripts/rescan-scsi-bus.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/rescan-scsi-bus.sh b/scripts/rescan-scsi-bus.sh -index b1cbebc..25a5f2a 100755 +index b1cbebc..5f867c4 100755 --- a/scripts/rescan-scsi-bus.sh +++ b/scripts/rescan-scsi-bus.sh -@@ -83,10 +83,10 @@ findhosts () - hosts= - for driverdir in /proc/scsi/*; do - driver=${driverdir#/proc/scsi/} -- if [ "$driver" = scsi ] || [ "$driver" = sg ] || [ "$driver" = dummy ] || [ "$driver" = device_info ] ; then continue; fi -+ if [ "$driver" = xscsi ] || [ "$driver" = xsg ] || [ "$driver" = xdummy ] || [ "$driver" = xdevice_info ] ; then continue; fi - for hostdir in $driverdir/*; do - name=${hostdir#/proc/scsi/*/} -- if [ "$name" = add_map ] || [ "$name" = map ] || [ "$name" = mod_parm ] ; then continue; fi -+ if [ "$name" = xadd_map ] || [ "$name" = xmap ] || [ "$name" = xmod_parm ] ; then continue; fi - num=$name - driverinfo=$driver - if [ -r "$hostdir/status" ] ; then @@ -289,7 +289,7 @@ testonline () print_and_scroll_back "$host:$channel:$id:$lun $SGDEV ($RMB) " [ $RC = 2 ] && [ "$RMB" = "1" ] && break done - if [ $ctr != 0 ] ; then -+ if [ $xctr != x0 ] ; then ++ if [ "$ctr" != 0 ] ; then white_out fi # echo -e "\e[A\e[A\e[A${yellow}Test existence of $SGDEV = $RC ${norm} \n\n\n" -@@ -569,7 +569,7 @@ dolunscan() - # Device not present - printf "\r\e[A"; - # Optimization: if lun==0, stop here (only if in non-remove mode) -- if [ "$lun" = 0 ] && [ -z "$remove" ] && [ "$optscan" = 1 ] ; then -+ if [ x"$lun" = x0 ] && [ -z "$remove" ] && [ "x$optscan" = x1 ] ; then - return 1; - fi - else @@ -1283,7 +1283,7 @@ if [ "$sync" = 2 ] ; then echo "Syncing file systems" sync fi -if [ -w /sys/module/scsi_mod/parameters/default_dev_flags ] && [ $scan_flags != 0 ] ; then -+if [ -w /sys/module/scsi_mod/parameters/default_dev_flags ] && [ x$scan_flags != x0 ] ; then ++if [ -w /sys/module/scsi_mod/parameters/default_dev_flags ] && [ "$scan_flags" != 0 ] ; then OLD_SCANFLAGS=$(cat /sys/module/scsi_mod/parameters/default_dev_flags) NEW_SCANFLAGS=$((OLD_SCANFLAGS|scan_flags)) if [ "$OLD_SCANFLAGS" != "$NEW_SCANFLAGS" ] ; then -- -2.19.1 +2.35.3 diff --git a/sg3_utils.spec b/sg3_utils.spec index 170622c..6ad1186 100644 --- a/sg3_utils.spec +++ b/sg3_utils.spec @@ -1,6 +1,6 @@ Name: sg3_utils Version: 1.46 -Release: 4 +Release: 5 Summary: Utilities that send SCSI commands to devices. License: GPL-2.0-or-later AND BSD URL: http://sg.danny.cz/sg/sg3_utils.html @@ -76,6 +76,9 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/*.la %{_mandir}/man8/* %changelog +* Fri Jul 1 2022 Wenchao Hao -1.46-5 +- Fix grammar error in rescan-scsi-bus.sh introduced by patch + * Thu Feb 17 2022 Wenchao Hao -1.46-4 - Fix grammar error in rescan-scsi-bus.sh -- Gitee