diff --git a/SOURCES/0003-Fix-regex-in-get_size_for_disk_name.patch b/SOURCES/0003-Fix-regex-in-get_size_for_disk_name.patch new file mode 100644 index 0000000..6aab430 --- /dev/null +++ b/SOURCES/0003-Fix-regex-in-get_size_for_disk_name.patch @@ -0,0 +1,25 @@ +From 7011f8460b0f21b414fae2a62a330c1312ec6fc0 Mon Sep 17 00:00:00 2001 +From: Andy Grover +Date: Fri, 6 Nov 2015 09:13:35 -0800 +Subject: [PATCH] Fix regex in get_size_for_disk_name + +Would break with 'sda10'. We need to non-greedily match the first subgroup. + +Signed-off-by: Andy Grover +--- + rtslib/utils.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/rtslib/utils.py b/rtslib/utils.py +index 5531e8f..79a4d9d 100644 +--- a/rtslib/utils.py ++++ b/rtslib/utils.py +@@ -152,7 +152,7 @@ def get_size_for_disk_name(name): + return get_size("/sys/block/%s" % name) + except IOError: + # Maybe it's a partition? +- m = re.search(r'^([a-z0-9_\-!]+)(\d+)$', name) ++ m = re.search(r'^([a-z0-9_\-!]+?)(\d+)$', name) + if m: + # If disk name ends with a digit, Linux sticks a 'p' between it and + # the partition number in the blockdev name. diff --git a/SPECS/python-rtslib.spec b/SPECS/python-rtslib.spec index 54a5b16..4a46b41 100644 --- a/SPECS/python-rtslib.spec +++ b/SPECS/python-rtslib.spec @@ -9,12 +9,13 @@ License: ASL 2.0 Group: System Environment/Libraries Summary: API for Linux kernel LIO SCSI target Version: 2.1.fb57 -Release: 3%{?dist} +Release: 5%{?dist} URL: https://fedorahosted.org/targetcli-fb/ Source: https://fedorahosted.org/released/targetcli-fb/%{oname}-%{version}.tar.gz Source1: target.service Patch0: 0001-Turn-off-unsupported-fabrics.patch Patch1: 0002-Fix-comparisons-to-None.patch +Patch2: 0003-Fix-regex-in-get_size_for_disk_name.patch BuildArch: noarch BuildRequires: python-devel epydoc python-setuptools systemd-units Requires: python-kmod python-six @@ -53,6 +54,7 @@ API for generic Linux SCSI kernel target. %setup -q -n %{oname}-%{version} %patch0 -p1 %patch1 -p1 +%patch2 -p1 %if 0%{?with_python3} rm -rf %{py3dir} @@ -126,6 +128,12 @@ popd %doc doc/html %changelog +* Fri Jul 29 2016 Andy Grover - 2.1.fb57-5 +- Rebuild to fix now-fixed issue with redhat-rpm-config in build system + +* Wed Jul 27 2016 Andy Grover - 2.1.fb57-4 +- Add 0003-Fix-regex-in-get_size_for_disk_name.patch + * Wed Oct 28 2015 Andy Grover - 2.1.fb57-3 - Add 0002-Fix-comparisons-to-None.patch for #1276044