Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-specfile for openSUSE:Factory checked in at 2025-05-31 19:15:55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-specfile (Old) and /work/SRC/openSUSE:Factory/.python-specfile.new.16005 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-specfile" Sat May 31 19:15:55 2025 rev:34 rq:1281331 version:0.35.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-specfile/python-specfile.changes 2025-05-14 17:02:43.203040227 +0200 +++ /work/SRC/openSUSE:Factory/.python-specfile.new.16005/python-specfile.changes 2025-05-31 19:16:49.262644593 +0200 @@ -1,0 +2,7 @@ +Fri May 30 08:43:58 UTC 2025 - John Paul Adrian Glaubitz <adrian.glaub...@suse.com> + +- Update to 0.35.1 + * We have fixed a bug that caused changes to get lost when a + spec file passed as a path was replaced or deleted. (#470) + +------------------------------------------------------------------- Old: ---- specfile-0.35.0.tar.gz New: ---- specfile-0.35.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-specfile.spec ++++++ --- /var/tmp/diff_new_pack.5AyLHO/_old 2025-05-31 19:16:49.926672035 +0200 +++ /var/tmp/diff_new_pack.5AyLHO/_new 2025-05-31 19:16:49.930672200 +0200 @@ -18,7 +18,7 @@ %{?sle15_python_module_pythons} Name: python-specfile -Version: 0.35.0 +Version: 0.35.1 Release: 0 Summary: A library for parsing and manipulating RPM spec files License: MIT ++++++ specfile-0.35.0.tar.gz -> specfile-0.35.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/specfile-0.35.0/CHANGELOG.md new/specfile-0.35.1/CHANGELOG.md --- old/specfile-0.35.0/CHANGELOG.md 2025-04-13 21:43:44.000000000 +0200 +++ new/specfile-0.35.1/CHANGELOG.md 2025-05-16 12:11:06.000000000 +0200 @@ -1,3 +1,7 @@ +# 0.35.1 + +- We have fixed a bug that caused changes to get lost when a spec file passed as a path was replaced or deleted. (#470) + # 0.35.0 - Added support for creating Specfile instances from file objects and strings. (#458) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/specfile-0.35.0/PKG-INFO new/specfile-0.35.1/PKG-INFO --- old/specfile-0.35.0/PKG-INFO 2025-04-13 21:43:48.549915600 +0200 +++ new/specfile-0.35.1/PKG-INFO 2025-05-16 12:11:11.908518000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.4 Name: specfile -Version: 0.35.0 +Version: 0.35.1 Summary: A library for parsing and manipulating RPM spec files. Home-page: https://github.com/packit/specfile Author: Red Hat diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/specfile-0.35.0/centos-integration-sig/python-specfile.spec new/specfile-0.35.1/centos-integration-sig/python-specfile.spec --- old/specfile-0.35.0/centos-integration-sig/python-specfile.spec 2025-04-13 21:43:44.000000000 +0200 +++ new/specfile-0.35.1/centos-integration-sig/python-specfile.spec 2025-05-16 12:11:06.000000000 +0200 @@ -7,7 +7,7 @@ in a minimal diff.} -%global base_version 0.35.0 +%global base_version 0.35.1 #global prerelease rc1 %global package_version %{base_version}%{?prerelease:~%{prerelease}} @@ -77,6 +77,9 @@ %changelog +* Fri May 16 2025 Packit Team <he...@packit.dev> - 0.35.1-1 +- New upstream release 0.35.1 + * Sun Apr 13 2025 Packit Team <he...@packit.dev> - 0.35.0-1 - New upstream release 0.35.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/specfile-0.35.0/epel10/python-specfile.spec new/specfile-0.35.1/epel10/python-specfile.spec --- old/specfile-0.35.0/epel10/python-specfile.spec 2025-04-13 21:43:44.000000000 +0200 +++ new/specfile-0.35.1/epel10/python-specfile.spec 2025-05-16 12:11:06.000000000 +0200 @@ -7,7 +7,7 @@ in a minimal diff.} -%global base_version 0.35.0 +%global base_version 0.35.1 #global prerelease rc1 %global package_version %{base_version}%{?prerelease:~%{prerelease}} @@ -77,6 +77,9 @@ %changelog +* Fri May 16 2025 Packit Team <he...@packit.dev> - 0.35.1-1 +- New upstream release 0.35.1 + * Sun Apr 13 2025 Packit Team <he...@packit.dev> - 0.35.0-1 - New upstream release 0.35.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/specfile-0.35.0/epel8/python-specfile.spec new/specfile-0.35.1/epel8/python-specfile.spec --- old/specfile-0.35.0/epel8/python-specfile.spec 2025-04-13 21:43:44.000000000 +0200 +++ new/specfile-0.35.1/epel8/python-specfile.spec 2025-05-16 12:11:06.000000000 +0200 @@ -4,7 +4,7 @@ in a minimal diff.} -%global base_version 0.35.0 +%global base_version 0.35.1 #global prerelease rc1 %global package_version %{base_version}%{?prerelease:~%{prerelease}} @@ -68,6 +68,9 @@ %changelog +* Fri May 16 2025 Packit Team <he...@packit.dev> - 0.35.1-1 +- New upstream release 0.35.1 + * Sun Apr 13 2025 Packit Team <he...@packit.dev> - 0.35.0-1 - New upstream release 0.35.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/specfile-0.35.0/fedora/python-specfile.spec new/specfile-0.35.1/fedora/python-specfile.spec --- old/specfile-0.35.0/fedora/python-specfile.spec 2025-04-13 21:43:44.000000000 +0200 +++ new/specfile-0.35.1/fedora/python-specfile.spec 2025-05-16 12:11:06.000000000 +0200 @@ -7,7 +7,7 @@ in a minimal diff.} -%global base_version 0.35.0 +%global base_version 0.35.1 #global prerelease rc1 %global package_version %{base_version}%{?prerelease:~%{prerelease}} @@ -77,6 +77,9 @@ %changelog +* Fri May 16 2025 Packit Team <he...@packit.dev> - 0.35.1-1 +- New upstream release 0.35.1 + * Sun Apr 13 2025 Packit Team <he...@packit.dev> - 0.35.0-1 - New upstream release 0.35.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/specfile-0.35.0/plans/packit-integration.fmf new/specfile-0.35.1/plans/packit-integration.fmf --- old/specfile-0.35.0/plans/packit-integration.fmf 2025-04-13 21:43:44.000000000 +0200 +++ new/specfile-0.35.1/plans/packit-integration.fmf 2025-05-16 12:11:06.000000000 +0200 @@ -26,6 +26,8 @@ - how: shell script: pip3 install build 'deepdiff < 8.0.0' # version 8.0.0 depends on numpy, avoid it - - when: "distro == rhel-8 or distro == centos-8 or distro == centos-stream-8" + - when: > + distro == rhel-8 or distro == centos-8 or distro == centos-stream-8 or + distro == rhel-9 or distro == centos-9 or distro == centos-stream-9 because: "packit doesn't support EL 8" enabled: false diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/specfile-0.35.0/specfile/specfile.py new/specfile-0.35.1/specfile/specfile.py --- old/specfile-0.35.0/specfile/specfile.py 2025-04-13 21:43:44.000000000 +0200 +++ new/specfile-0.35.1/specfile/specfile.py 2025-05-16 12:11:06.000000000 +0200 @@ -202,6 +202,12 @@ content = raw_content.decode(**cls.ENCODING_ARGS) return content.splitlines(), content.endswith("\n") + def _reopen_named_file(self) -> None: + if not self.path: + return + self._file.close() + self._file = self.path.open("r+", **self.ENCODING_ARGS) + @property def path(self) -> Optional[Path]: """Path to the spec file.""" @@ -263,21 +269,17 @@ def reload(self) -> None: """Reloads the spec file content.""" - try: - path = Path(cast(FileIO, self._file).name) - except AttributeError: - pass - else: - # reopen the path in case the original file has been deleted/replaced - self._file.close() - self._file = path.open("r+", **self.ENCODING_ARGS) + # reopen the path in case the original file has been deleted/replaced + self._reopen_named_file() self._lines, self._trailing_newline = self._read_lines(self._file) def save(self) -> None: """Saves the spec file content.""" + content = str(self) + # reopen the path in case the original file has been deleted/replaced + self._reopen_named_file() self._file.seek(0) self._file.truncate(0) - content = str(self) try: self._file.write(content) except TypeError: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/specfile-0.35.0/specfile.egg-info/PKG-INFO new/specfile-0.35.1/specfile.egg-info/PKG-INFO --- old/specfile-0.35.0/specfile.egg-info/PKG-INFO 2025-04-13 21:43:48.000000000 +0200 +++ new/specfile-0.35.1/specfile.egg-info/PKG-INFO 2025-05-16 12:11:11.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.4 Name: specfile -Version: 0.35.0 +Version: 0.35.1 Summary: A library for parsing and manipulating RPM spec files. Home-page: https://github.com/packit/specfile Author: Red Hat diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/specfile-0.35.0/tests/integration/test_specfile.py new/specfile-0.35.1/tests/integration/test_specfile.py --- old/specfile-0.35.0/tests/integration/test_specfile.py 2025-04-13 21:43:44.000000000 +0200 +++ new/specfile-0.35.1/tests/integration/test_specfile.py 2025-05-16 12:11:06.000000000 +0200 @@ -710,3 +710,21 @@ after_reload = spec assert str(before_reload) != str(after_reload) + + +def test_save_after_inode_change(specfile_factory, spec_minimal): + spec = specfile_factory(spec_minimal) + if spec.path is None: + return + inode = spec_minimal.stat().st_ino + content = spec_minimal.read_bytes() + spec_minimal.unlink() + spec_minimal.write_bytes(content) + assert spec_minimal.stat().st_ino != inode + spec.version = "0.2" + spec.save() + assert all( + line.endswith("0.2") + for line in spec_minimal.read_text().splitlines() + if line.startswith("Version:") + )