!24 [sync] PR-19: Sync each branch submit

Merge pull request !24 from openeuler-sync-bot/sync-pr19-openEuler-20.03-LTS-Next-to-openEuler-20.03-LTS-SP3
This commit is contained in:
openeuler-ci-bot 2022-01-29 04:19:12 +00:00 committed by Gitee
commit 51fa21e207
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 24 additions and 8 deletions

View File

@ -16,7 +16,7 @@ index 25a5f2a..dc3026a 100755
# If block directory exists && and PQUAL != 0, we unmapped lun0 and just have a well-known lun
# If block directory doesn't exist && PQUAL == 0, we mapped a real lun0
- if [ "$lun" -eq 0 ] && [ $IPTYPE -eq 0 ] ; then
+ if [ "x$lun" -eq x0 ] && [ x$IPTYPE -eq 0 ] ; then
+ if [ x"$lun" = x0 ] && [ x$IPTYPE = x0 ] ; then
if [ $RC = 2 ] ; then
if [ -e "$devpath" ] ; then
if [ -d "$devpath/block" ] ; then
@ -25,7 +25,7 @@ index 25a5f2a..dc3026a 100755
fi
fi
- elif [ $RC = 0 ] && [ $IPTYPE -eq 0 ] ; then
+ elif [ $RC = 0 ] && [ x$IPTYPE -eq x0 ] ; then
+ elif [ $RC = 0 ] && [ x$IPTYPE = x0 ] ; then
if [ -e "$devpath" ] ; then
if [ ! -d "$devpath/block" ] ; then
remappedlun0=1 # Transition from well-known to real lun 0
@ -34,7 +34,7 @@ index 25a5f2a..dc3026a 100755
# Special case: lun 0 just got added (for reportlunscan),
# so make sure we correctly treat it as new
- if [ "$lun" = "0" ] && [ "$1" = "1" ] && [ -z "$remappedlun0" ] ; then
+ if [ x"$lun" = x"0" ] && [ "$1" = "1" ] && [ -z "$remappedlun0" ] ; then
+ if [ x"$lun" = x"0" ] && [ x"$1" = x"1" ] && [ -z "$remappedlun0" ] ; then
SCSISTR=""
printf "\r\e[A\e[A\e[A"
fi
@ -43,7 +43,7 @@ index 25a5f2a..dc3026a 100755
else
echo "scsi remove-single-device $devnr" > /proc/scsi/scsi
- if [ $RC -eq 1 ] || [ "$lun" -eq 0 ] ; then
+ if [ $RC -eq 1 ] || [ x"$lun" -eq x0 ] ; then
+ if [ $RC -eq 1 ] || [ x"$lun" = x0 ] ; then
# Try readding, should fail if device is gone
echo "scsi add-single-device $devnr" > /proc/scsi/scsi
fi

View File

@ -1,6 +1,6 @@
Name: sg3_utils
Version: 1.45
Release: 2
Release: 6
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
@ -9,12 +9,12 @@ Source0: http://sg.danny.cz/sg/p/sg3_utils-%{version}.tar.xz
Patch0: 0000-sg3_utils-1.37-rescan-scsi-findremapped-enhance.patch
Patch1: 0001-sg3_utils-1.37-rescan-downpress.patch
Patch2: 0002-bugfix-sg3_utils-fix-syntax-error.patch
Patch3: 0003-sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-err.patch
Patch3: 0003-sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-error.patch
Patch4: 0004-sg3_utils-fix-memset-coredump.patch
Provides: %{name}-libs
Obsoletes: %{name}-libs
BuildRequires: gcc, git
BuildRequires: gcc
%description
The sg3_utils package contains utilities that send SCSI commands to devices. As well as
@ -39,7 +39,7 @@ Requires: man
This contains man files for the using of pciutils.
%prep
%autosetup -Sgit -n %{name}-%{version}
%autosetup -n %{name}-%{version} -p1
%build
%configure --disable-static
@ -48,6 +48,9 @@ This contains man files for the using of pciutils.
make %{?_smp_mflags}
%check
make check
%install
%make_install
install -p -m 644 doc/rescan-scsi-bus.sh.8 $RPM_BUILD_ROOT%{_mandir}/man8
@ -71,6 +74,19 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/*.la
%{_mandir}/man8/*
%changelog
* Wed Nov 3 2021 yanglongkang <yanglongkang@huawei.com> - 1.45-6
- sync each branch submit
* Sat Jul 31 2021 chenyanpanHW <chenyanpan@huawei.com> - 1.45-5
- DESC: delete -Sgit from %autosetup, and delete BuildRequires git
* Wed Nov 10 2020 haowenchao <haowenchao@huawei.com> - 1.45-4
- Fix grammar problems caused by patch
0003-sg3_utils-1.42-delete-lun-rescan-scsi-bus-report-error.patch
* Wed Nov 5 2020 lixiaokeng <lixiaokeng@huawei.com> - 1.45-3
- add make check
* Tue Feb 9 2021 Zhiqiang Liu <liuzhiqiang26@huawei.com> - 1.45-2
- solve coredump problem, rename patches and set release to 2 for CI