Compare commits

..

No commits in common. 'c9' and 'c8' have entirely different histories.
c9 ... c8

@ -0,0 +1,13 @@
diff --git a/setup.py b/setup.py
index 4518165..2ebfc04 100755
--- a/setup.py
+++ b/setup.py
@@ -34,7 +34,7 @@ setup(
'scripts/targetcli',
'daemon/targetclid'
],
- data_files = [('/lib/systemd/system', ['systemd/targetclid.socket', 'systemd/targetclid.service'])],
+ data_files = [('/usr/lib/systemd/system', ['systemd/targetclid.socket', 'systemd/targetclid.service'])],
classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",

@ -0,0 +1,55 @@
From 3176671662bda79d4b4059b8cc22b4b31a6547e0 Mon Sep 17 00:00:00 2001
From: Maurizio Lombardi <mlombard@redhat.com>
Date: Fri, 13 Nov 2020 11:44:40 +0100
Subject: [PATCH] fileio backstore: fix sparse file creation
fallocate() can't be used to create sparse files because it
actually preallocates all the disk space that will be used by the file
backstore, sparse files do not have preallocated disk space
by definition.
We must therefore use ftruncate().
We can, on the other hand, use fallocate() to create non-sparse
files and fall back to the slower "while() fwrite()" if we
are running on Python version < 3.3 where fallocate() is not available
Fixes 3bd4d8ef7c9b154c53e8b8dd863a570bce7f5c2c
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
---
targetcli/ui_backstore.py | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/targetcli/ui_backstore.py b/targetcli/ui_backstore.py
index 8692f22..9bc0c58 100644
--- a/targetcli/ui_backstore.py
+++ b/targetcli/ui_backstore.py
@@ -423,17 +423,17 @@ class UIFileIOBackstore(UIBackstore):
raise ExecutionError("Could not open %s" % filename)
try:
if sparse:
+ os.ftruncate(f.fileno(), size)
+ else:
+ self.shell.log.info("Writing %d bytes" % size)
try:
+ # Prior to version 3.3, Python does not provide fallocate
os.posix_fallocate(f.fileno(), 0, size)
except AttributeError:
- # Prior to version 3.3, Python does not provide fallocate
- os.ftruncate(f.fileno(), size)
- else:
- self.shell.log.info("Writing %d bytes" % size)
- while size > 0:
- write_size = min(size, 1024)
- f.write("\0" * write_size)
- size -= write_size
+ while size > 0:
+ write_size = min(size, 1024)
+ f.write("\0" * write_size)
+ size -= write_size
except (OSError, IOError):
os.remove(filename)
raise ExecutionError("Could not expand file to %d bytes" % size)
--
2.28.0

@ -1,26 +0,0 @@
From 88da522778fc6a7b256cda7f960912b439290538 Mon Sep 17 00:00:00 2001
From: Matt Coleman <matt@datto.com>
Date: Fri, 19 Jun 2020 19:06:24 -0400
Subject: [PATCH] Do not install systemd files in setup.py
setuptools should not perform OS-specific actions such as installing systemd units.
OS-specific actions should be handled by the package manager.
---
setup.py | 1 -
1 file changed, 1 deletion(-)
diff --git a/setup.py b/setup.py
index 4518165..8dff55e 100755
--- a/setup.py
+++ b/setup.py
@@ -34,7 +34,6 @@ setup(
'scripts/targetcli',
'daemon/targetclid'
],
- data_files = [('/lib/systemd/system', ['systemd/targetclid.socket', 'systemd/targetclid.service'])],
classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
--
2.27.0

@ -2,18 +2,17 @@
Name: targetcli Name: targetcli
License: ASL 2.0 License: ASL 2.0
Group: System Environment/Libraries
Summary: An administration shell for storage targets Summary: An administration shell for storage targets
Version: 2.1.53 Version: 2.1.53
Release: 7%{?dist} Release: 2%{?dist}
URL: https://github.com/open-iscsi/%{oname} URL: https://github.com/open-iscsi/%{oname}
Source: %{url}/archive/v%{version}/%{oname}-%{version}.tar.gz Source: %{url}/archive/v%{version}/%{oname}-%{version}.tar.gz
# Proposed upstream Patch0: 0001-setup.py-add-the-socket-and-service-files-to-the-dat.patch
## From: https://github.com/open-iscsi/targetcli-fb/pull/176 Patch1: 0002-fileio-backstore-fix-sparse-file-creation.patch
Patch1: Do-not-install-systemd-files-in-setup.py.patch
BuildArch: noarch BuildArch: noarch
BuildRequires: python3-devel, python3-setuptools, systemd-rpm-macros BuildRequires: python3-devel, python3-setuptools
Requires: python3-rtslib, target-restore, python3-configshell, python3-six, python3-dbus Requires: python3-rtslib, target-restore, python3-configshell, python3-six, python3-dbus, python3-gobject-base
Requires: python3-gobject-base
%description %description
@ -24,93 +23,57 @@ users will also need to install and use fcoe-utils.
%prep %prep
%setup -q -n %{oname}-%{version} %setup -q -n %{oname}-%{version}
%patch0 -p1
%patch1 -p1 %patch1 -p1
%build %build
%py3_build %{__python3} setup.py build
gzip --stdout targetcli.8 > targetcli.8.gz
gzip --stdout targetclid.8 > targetclid.8.gz
%install %install
%py3_install mkdir -p %{buildroot}%{_unitdir}
%{__python3} setup.py install --skip-build --root %{buildroot}
mkdir -p %{buildroot}%{_sysconfdir}/target/backup mkdir -p %{buildroot}%{_sysconfdir}/target/backup
mkdir -p %{buildroot}%{_sysconfdir}/target/pr
mkdir -p %{buildroot}%{_mandir}/man8/ mkdir -p %{buildroot}%{_mandir}/man8/
install -m 644 targetcli*.8 %{buildroot}%{_mandir}/man8/ install -m 644 targetcli.8.gz %{buildroot}%{_mandir}/man8/
mkdir -p %{buildroot}%{_unitdir}/ install -m 644 targetclid.8.gz %{buildroot}%{_mandir}/man8/
install -m 644 systemd/* %{buildroot}%{_unitdir}/
%files %files
%doc README.md %{python3_sitelib}/*
%license COPYING
%{python3_sitelib}/targetcli*
%{_bindir}/targetcli %{_bindir}/targetcli
%{_bindir}/targetclid %{_bindir}/targetclid
%{_mandir}/man8/targetcli*.8*
%{_unitdir}/*
%dir %{_sysconfdir}/target %dir %{_sysconfdir}/target
%dir %{_sysconfdir}/target/backup %dir %{_sysconfdir}/target/backup
%dir %{_sysconfdir}/target/pr
%doc COPYING README.md
%{_mandir}/man8/targetcli.8.gz
%{_mandir}/man8/targetclid.8.gz
%{_usr}/lib/systemd/system/targetclid.service
%{_usr}/lib/systemd/system/targetclid.socket
%changelog %changelog
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 2.1.53-7 * Tue Dec 01 2020 Maurizio Lombardi <mlombard@redhat.com> - 2.1.53-2
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags - Fix sparse file creation
Related: rhbz#1991688
* Thu Jun 24 2021 Maurizio Lombardi <mlombard@redhat.com> - 2.1.53-5 * Thu Jun 25 2020 Maurizio Lombardi <mlombard@redhat.com> - 2.1.53-1
- Add the gating.yaml file - Update to new upstream version
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 2.1.53-4 * Mon May 11 2020 Maurizio Lombardi <mlombard@redhat.com> - 2.1.52-1
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937 - Update to new upstream version
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.53-3 * Fri Dec 06 2019 Maurizio Lombardi <mlombard@redhat.com> - 2.1.51-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - Create the target/pr directory when installing the package
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.53-2 * Mon Nov 18 2019 Maurizio Lombardi <mlombard@redhat.com> - 2.1.51-1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - Update to new upstream release
* Thu Jun 25 2020 Matt Coleman <matt@datto.com> - 2.1.53-1 * Thu Sep 06 2018 Maurizio Lombardi <mlombard@redhat.com> - 2.1.fb49-1
- New upstream version - Update to new upstream release
- Add the upstream project's targetclid systemd unit files
- Add proposed upstream patch:
+ Do not install systemd files in setup.py
+ https://github.com/open-iscsi/targetcli-fb/pull/176
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 2.1.fb49-9
- Rebuilt for Python 3.9
* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.fb49-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Fri Nov 01 2019 Neal Gompa <ngompa13@gmail.com> - 2.1.fb49-7
- Use correct Python macros to build the package
- Fix file list and install COPYING as license file
- Don't compress manpages in build phase, as rpm auto-compresses manpages
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 2.1.fb49-6
- Rebuilt for Python 3.8.0rc1 (#1748018)
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 2.1.fb49-5
- Rebuilt for Python 3.8
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.fb49-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Mar 15 2019 Alan Pevec <apevec AT redhat.com> - 2.1.fb49-3
- Reduce dep to python3-gobject-base rhbz#1688808
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.fb49-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Wed Oct 10 2018 Andy Grover <agrover@redhat.com> - 2.1.fb49-1
- New upstream version
- Fix URL so spectool -g works
- Remove patch 0001-signed-char.patch
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.fb48-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 2.1.fb48-5
- Rebuilt for Python 3.7
* Tue May 8 2018 Andy Grover <agrover@redhat.com> - 2.1.fb48-4 * Mon Aug 06 2018 Maurizio Lombardi <mlombard@redhat.com> - 2.1.fb48-4
- Add patch 0001-signed-char.patch - Fix code incompatible with python3
* Fri Feb 09 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 2.1.fb48-3 * Fri Feb 09 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 2.1.fb48-3
- Escape macros in %%changelog - Escape macros in %%changelog

Loading…
Cancel
Save