* Fri Feb 11 2022 Tomas Bzatek <tbzatek@redhat.com> - 1.47-8

- Fix scanning progress output (#2052512)

Resolves: #2052512
This commit is contained in:
Tomas Bzatek 2022-02-11 14:51:45 +01:00
parent 8eec83cc10
commit 85f37348f5
2 changed files with 76 additions and 1 deletions

View File

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

View File

@ -4,7 +4,7 @@
Summary: Utilities for devices that use SCSI command sets
Name: sg3_utils
Version: 1.47
Release: 7%{?dist}
Release: 8%{?dist}
License: GPLv2+ and BSD
URL: https://sg.danny.cz/sg/sg3_utils.html
Source0: https://sg.danny.cz/sg/p/sg3_utils-%{version}.tar.xz
@ -24,6 +24,9 @@ Patch3: rescan-scsi-bus_printf.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2035362
# rescan-scsi-bus.sh with "-r" switch deletes all scsi devices, especially boot disk which causes the system to hang
Patch4: rescan-scsi-bus_sg_inq-parse.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2052512
# rescan-scsi-bus.sh: Fix scanning progress output
Patch5: sg3_utils-1.48-rescan-scsi-bus.sh_seq_-s.patch
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
BuildRequires: make
@ -120,6 +123,9 @@ install -p -m 755 scripts/fc_wwpn_id $RPM_BUILD_ROOT%{_udevlibdir}
%changelog
* Fri Feb 11 2022 Tomas Bzatek <tbzatek@redhat.com> - 1.47-8
- Fix scanning progress output (#2052512)
* Thu Jan 27 2022 Tomas Bzatek <tbzatek@redhat.com> - 1.47-7
- Fix sg_inq parsing in rescan-scsi-bus.sh (#2036005,#2035362)
- Fix rescan-scsi-bus.sh summary print (#2035382)