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 2026-06-15 19:44:18
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-specfile (Old)
 and      /work/SRC/openSUSE:Factory/.python-specfile.new.1981 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-specfile"

Mon Jun 15 19:44:18 2026 rev:42 rq:1359306 version:0.41.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-specfile/python-specfile.changes  
2026-04-28 16:40:09.470943717 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-specfile.new.1981/python-specfile.changes    
    2026-06-15 19:47:37.673936553 +0200
@@ -1,0 +2,8 @@
+Sun Jun 14 19:48:21 UTC 2026 - Dirk Müller <[email protected]>
+
+- update to 0.41.0:
+  * Fixed an issue where the value of a tag could have been
+    incorrectly expanded if the spec file contained a macro
+    definition shadowing the tag name
+
+-------------------------------------------------------------------

Old:
----
  specfile-0.40.2.tar.gz

New:
----
  specfile-0.41.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-specfile.spec ++++++
--- /var/tmp/diff_new_pack.kmJmIF/_old  2026-06-15 19:47:38.709980088 +0200
+++ /var/tmp/diff_new_pack.kmJmIF/_new  2026-06-15 19:47:38.713980257 +0200
@@ -18,7 +18,7 @@
 
 %{?sle15_python_module_pythons}
 Name:           python-specfile
-Version:        0.40.2
+Version:        0.41.0
 Release:        0
 Summary:        A library for parsing and manipulating RPM spec files
 License:        MIT

++++++ specfile-0.40.2.tar.gz -> specfile-0.41.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/specfile-0.40.2/.github/workflows/check-release-notes.yml 
new/specfile-0.41.0/.github/workflows/check-release-notes.yml
--- old/specfile-0.40.2/.github/workflows/check-release-notes.yml       
2026-04-23 11:56:58.000000000 +0200
+++ new/specfile-0.41.0/.github/workflows/check-release-notes.yml       
2026-05-29 11:13:52.000000000 +0200
@@ -10,6 +10,6 @@
 jobs:
   check_release_notes:
     name: Notes are either written, or there are none
-    uses: packit/.github/.github/workflows/check-release-notes.yml@main
+    uses: 
packit/.github/.github/workflows/check-release-notes.yml@2837c96caf71966609451ad0323552ef4be11a23
 # main
     with:
       description: ${{ github.event.pull_request.body }}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/specfile-0.40.2/.github/workflows/do-release.yml 
new/specfile-0.41.0/.github/workflows/do-release.yml
--- old/specfile-0.40.2/.github/workflows/do-release.yml        2026-04-23 
11:56:58.000000000 +0200
+++ new/specfile-0.41.0/.github/workflows/do-release.yml        2026-05-29 
11:13:52.000000000 +0200
@@ -11,7 +11,7 @@
     if: github.event.pull_request.merged == true && 
contains(github.event.pull_request.labels.*.name, 'release') && 
github.repository_owner == 'packit'
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
       - name: Create GitHub release
         run: |
           VERSION=$(grep -oP '^# \K[0-9.]+([.\-_]?[a-zA-Z0-9.\-_]+)?' 
CHANGELOG.md | head -n 1)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/specfile-0.40.2/.github/workflows/prepare-release.yml 
new/specfile-0.41.0/.github/workflows/prepare-release.yml
--- old/specfile-0.40.2/.github/workflows/prepare-release.yml   2026-04-23 
11:56:58.000000000 +0200
+++ new/specfile-0.41.0/.github/workflows/prepare-release.yml   2026-05-29 
11:13:52.000000000 +0200
@@ -16,18 +16,18 @@
       contents: write
 
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
         with:
           fetch-depth: 0
       - name: Prepare release content
-        uses: packit/prepare-release@v3
+        uses: packit/prepare-release@8e32a3a2fc5b1c33b5dca1620c073d5a7dffd5a5 
# v3
         with:
           version: ${{ inputs.version }}
           specfiles: 
fedora/python-specfile.spec,epel8/python-specfile.spec,centos-integration-sig/python-specfile.spec
           prerelease_suffix_pattern: 
"([.\\-_]?)(a(lpha)?|b(eta)?|r?c|pre(view)?)([.\\-_]?\\d+)?"
           prerelease_suffix_macro: prerelease
       - name: Create Pull Request
-        uses: peter-evans/create-pull-request@v7
+        uses: 
peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676 # v7
         with:
           labels: release
           commit-message: Release ${{ inputs.version }}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/specfile-0.40.2/.github/workflows/pypi-publish.yml 
new/specfile-0.41.0/.github/workflows/pypi-publish.yml
--- old/specfile-0.40.2/.github/workflows/pypi-publish.yml      2026-04-23 
11:56:58.000000000 +0200
+++ new/specfile-0.41.0/.github/workflows/pypi-publish.yml      2026-05-29 
11:13:52.000000000 +0200
@@ -16,11 +16,11 @@
     runs-on: ubuntu-latest
 
     steps:
-      - uses: actions/checkout@v4
+      - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
         with:
           persist-credentials: false
 
-      - uses: actions/setup-python@v5
+      - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # 
v5
 
       - name: Get history and tags for SCM versioning to work
         run: |
@@ -34,7 +34,7 @@
           python -m build
 
       - name: Store the distribution packages
-        uses: actions/upload-artifact@v4
+        uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 
# v4
         with:
           name: python-package-distributions
           path: dist/
@@ -52,13 +52,13 @@
 
     steps:
       - name: Download all the dists
-        uses: actions/download-artifact@v4
+        uses: 
actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
         with:
           name: python-package-distributions
           path: dist/
 
       - name: Publish 📦 to PyPI
         # https://github.com/pypa/gh-action-pypi-publish
-        uses: pypa/gh-action-pypi-publish@release/v1
+        uses: 
pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
         with:
           verbose: true
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/specfile-0.40.2/.pre-commit-config.yaml 
new/specfile-0.41.0/.pre-commit-config.yaml
--- old/specfile-0.40.2/.pre-commit-config.yaml 2026-04-23 11:56:58.000000000 
+0200
+++ new/specfile-0.41.0/.pre-commit-config.yaml 2026-05-29 11:13:52.000000000 
+0200
@@ -7,8 +7,8 @@
     rev: v3.21.2
     hooks:
       - id: pyupgrade
-  - repo: https://github.com/psf/black
-    rev: 25.1.0
+  - repo: https://github.com/psf/black-pre-commit-mirror
+    rev: 26.5.0
     hooks:
       - id: black
   - repo: https://github.com/pre-commit/mirrors-prettier
@@ -16,7 +16,7 @@
     hooks:
       - id: prettier
   - repo: https://github.com/pre-commit/pre-commit-hooks
-    rev: v5.0.0
+    rev: v6.0.0
     hooks:
       - id: check-added-large-files
       - id: check-ast
@@ -32,7 +32,7 @@
       - id: mixed-line-ending
       - id: trailing-whitespace
   - repo: https://github.com/PyCQA/flake8
-    rev: 7.1.2
+    rev: 7.3.0
     hooks:
       - id: flake8
         args:
@@ -40,12 +40,12 @@
           # https://github.com/PyCQA/pycodestyle/issues/373
           - --extend-ignore=E203
   - repo: https://github.com/PyCQA/isort
-    rev: 6.0.1
+    rev: 9.0.0a3
     hooks:
       - id: isort
         args: [--profile, black]
   - repo: https://github.com/pre-commit/mirrors-mypy
-    rev: v1.15.0
+    rev: v2.1.0
     hooks:
       - id: mypy
         args: [--show-error-codes, --ignore-missing-imports]
@@ -57,25 +57,25 @@
           # This file is overridden by a type stub
         exclude: "specfile/context_management.py"
   - repo: https://github.com/teemtee/tmt.git
-    rev: 1.66.0
+    rev: 1.73.0
     hooks:
       - id: tmt-lint
         # linting of the reverse-dependency tests requires internet access
         stages: [manual, pre-push]
   - repo: https://github.com/packit/pre-commit-hooks
-    rev: v1.2.0
+    rev: v1.3.0
     hooks:
       - id: check-rebase
         args:
           - https://github.com/packit/specfile.git
         stages: [manual, pre-push]
   - repo: https://github.com/python-jsonschema/check-jsonschema
-    rev: 0.31.3
+    rev: 0.37.2
     hooks:
       - id: check-github-workflows
         args: ["--verbose"]
   - repo: https://github.com/Lucas-C/pre-commit-hooks
-    rev: v1.5.5
+    rev: v1.5.6
     hooks:
       - id: insert-license
         files: \.py$
@@ -85,7 +85,7 @@
           - --comment-style
           - "#"
   - repo: https://github.com/crate-ci/typos
-    rev: v1.36.2
+    rev: v1
     hooks:
       - id: typos
         args: [--config, _typos.toml]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/specfile-0.40.2/CHANGELOG.md 
new/specfile-0.41.0/CHANGELOG.md
--- old/specfile-0.40.2/CHANGELOG.md    2026-04-23 11:56:58.000000000 +0200
+++ new/specfile-0.41.0/CHANGELOG.md    2026-05-29 11:13:52.000000000 +0200
@@ -1,3 +1,16 @@
+# 0.41.0
+
+- Fixed an issue where the value of a tag could have been incorrectly expanded 
if the spec file contained a macro definition shadowing the tag name, e.g.:
+
+```
+%global release 12
+%global release_string %{release}%{?dist}
+
+Release: %{release_string}
+```
+
+In this case, with `dist` being `.fc44`, `Specfile.expanded_release` returned 
`12.fc44.fc44` instead of `12.fc44`. (#539)
+
 # 0.40.2
 
 - Trailing whitespaces at the end of specfile sections are now ignored during 
parsing. (#531)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/specfile-0.40.2/PKG-INFO new/specfile-0.41.0/PKG-INFO
--- old/specfile-0.40.2/PKG-INFO        2026-04-23 11:57:08.665053100 +0200
+++ new/specfile-0.41.0/PKG-INFO        2026-05-29 11:14:00.713505500 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.4
 Name: specfile
-Version: 0.40.2
+Version: 0.41.0
 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.40.2/centos-integration-sig/python-specfile.spec 
new/specfile-0.41.0/centos-integration-sig/python-specfile.spec
--- old/specfile-0.40.2/centos-integration-sig/python-specfile.spec     
2026-04-23 11:56:58.000000000 +0200
+++ new/specfile-0.41.0/centos-integration-sig/python-specfile.spec     
2026-05-29 11:13:52.000000000 +0200
@@ -7,7 +7,7 @@
 in a minimal diff.}
 
 
-%global base_version 0.40.2
+%global base_version 0.41.0
 #global prerelease   rc1
 
 %global package_version %{base_version}%{?prerelease:~%{prerelease}}
@@ -81,6 +81,9 @@
 
 
 %changelog
+* Fri May 29 2026 Packit Team <[email protected]> - 0.41.0-1
+- New upstream release 0.41.0
+
 * Thu Apr 23 2026 Packit Team <[email protected]> - 0.40.2-1
 - New upstream release 0.40.2
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/specfile-0.40.2/epel8/python-specfile.spec 
new/specfile-0.41.0/epel8/python-specfile.spec
--- old/specfile-0.40.2/epel8/python-specfile.spec      2026-04-23 
11:56:58.000000000 +0200
+++ new/specfile-0.41.0/epel8/python-specfile.spec      2026-05-29 
11:13:52.000000000 +0200
@@ -4,7 +4,7 @@
 in a minimal diff.}
 
 
-%global base_version 0.40.2
+%global base_version 0.41.0
 #global prerelease   rc1
 
 %global package_version %{base_version}%{?prerelease:~%{prerelease}}
@@ -72,6 +72,9 @@
 
 
 %changelog
+* Fri May 29 2026 Packit Team <[email protected]> - 0.41.0-1
+- New upstream release 0.41.0
+
 * Thu Apr 23 2026 Packit Team <[email protected]> - 0.40.2-1
 - New upstream release 0.40.2
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/specfile-0.40.2/fedora/python-specfile.spec 
new/specfile-0.41.0/fedora/python-specfile.spec
--- old/specfile-0.40.2/fedora/python-specfile.spec     2026-04-23 
11:56:58.000000000 +0200
+++ new/specfile-0.41.0/fedora/python-specfile.spec     2026-05-29 
11:13:52.000000000 +0200
@@ -7,7 +7,7 @@
 in a minimal diff.}
 
 
-%global base_version 0.40.2
+%global base_version 0.41.0
 #global prerelease   rc1
 
 %global package_version %{base_version}%{?prerelease:~%{prerelease}}
@@ -81,6 +81,9 @@
 
 
 %changelog
+* Fri May 29 2026 Packit Team <[email protected]> - 0.41.0-1
+- New upstream release 0.41.0
+
 * Thu Apr 23 2026 Packit Team <[email protected]> - 0.40.2-1
 - New upstream release 0.40.2
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/specfile-0.40.2/specfile/specfile.py 
new/specfile-0.41.0/specfile/specfile.py
--- old/specfile-0.40.2/specfile/specfile.py    2026-04-23 11:56:58.000000000 
+0200
+++ new/specfile-0.41.0/specfile/specfile.py    2026-05-29 11:13:52.000000000 
+0200
@@ -637,8 +637,12 @@
                         except AttributeError:
                             evr = ""
                         evr += f"{tags.version.expanded_value}-"
+                        release_value = tags.release.value
+                        self.expand(release_value, extra_macros=[("dist", "")])
+                        rpm.delMacro("release")
                         evr += self.expand(
-                            tags.release.value, extra_macros=[("dist", "")]
+                            release_value,
+                            skip_parsing=True,
                         )
                 with self.changelog(section) as changelog:
                     if changelog is None:
@@ -799,7 +803,10 @@
     @property
     def expanded_release(self) -> str:
         """Release string without the dist suffix with macros expanded."""
-        return self.expand(self.release, extra_macros=[("dist", "")])
+        release = self.release
+        self.expand(release, extra_macros=[("dist", "")])
+        rpm.delMacro("release")
+        return self.expand(release, skip_parsing=True)
 
     def set_version_and_release(self, version: str, release: str = "1") -> 
None:
         """
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/specfile-0.40.2/specfile/tags.py 
new/specfile-0.41.0/specfile/tags.py
--- old/specfile-0.40.2/specfile/tags.py        2026-04-23 11:56:58.000000000 
+0200
+++ new/specfile-0.41.0/specfile/tags.py        2026-05-29 11:13:52.000000000 
+0200
@@ -16,6 +16,8 @@
     overload,
 )
 
+import rpm
+
 from specfile.conditions import process_conditions
 from specfile.constants import TAG_NAMES, TAGS_WITH_ARG
 from specfile.formatter import formatted
@@ -284,7 +286,20 @@
     def expanded_value(self) -> Optional[str]:
         """Value of the tag after expanding macros."""
         if self._context:
-            return self._context.expand(self.value)
+            # Ensure the macro context is up-to-date
+            self._context.expand("%{nil}")
+            # After parsing, RPM redefines tag macros (e.g. %{release}) to the
+            # expanded tag value, which can cause circular expansion when the
+            # tag value references the same macro indirectly. Pop RPM's
+            # definition to expose the user's original definition underneath.
+            rpm.delMacro(self.name.lower())
+            result = self._context.expand(self.value, skip_parsing=True)
+            # delMacro left the macro stack dirty, invalidate the parse cache
+            # so the next _parse call re-parses and restores tag macros
+            from specfile.spec_parser import SpecParser
+
+            SpecParser._last_parse_hash = None
+            return result
         return Macros.expand(self.value)
 
     def get_position(self, container: "Tags") -> int:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/specfile-0.40.2/specfile.egg-info/PKG-INFO 
new/specfile-0.41.0/specfile.egg-info/PKG-INFO
--- old/specfile-0.40.2/specfile.egg-info/PKG-INFO      2026-04-23 
11:57:08.000000000 +0200
+++ new/specfile-0.41.0/specfile.egg-info/PKG-INFO      2026-05-29 
11:14:00.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.4
 Name: specfile
-Version: 0.40.2
+Version: 0.41.0
 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.40.2/tests/integration/test_specfile.py 
new/specfile-0.41.0/tests/integration/test_specfile.py
--- old/specfile-0.40.2/tests/integration/test_specfile.py      2026-04-23 
11:56:58.000000000 +0200
+++ new/specfile-0.41.0/tests/integration/test_specfile.py      2026-05-29 
11:13:52.000000000 +0200
@@ -10,6 +10,7 @@
 
 import specfile.specfile
 from specfile.exceptions import RPMException, SpecfileException
+from specfile.macro_definitions import CommentOutStyle, MacroDefinition
 from specfile.prep import AutopatchMacro, AutosetupMacro, PatchMacro, 
SetupMacro
 from specfile.sections import Section
 from specfile.specfile import Specfile, SpecParser
@@ -591,14 +592,14 @@
     spec2 = copy.deepcopy(spec1)
     flexmock(SpecParser).should_call("_do_parse").never()
     assert spec1.expanded_name == "test"
-    flexmock(SpecParser).should_call("_do_parse").once()
+    flexmock(SpecParser).should_call("_do_parse").twice()
     assert spec2.expanded_name == "test"
     assert spec2.expanded_version == "0.1.2~rc2"
-    flexmock(SpecParser).should_call("_do_parse").once()
+    flexmock(SpecParser).should_call("_do_parse").twice()
     assert spec1.expanded_version == "0.1.2~rc2"
     with spec1.macro_definitions() as md:
         md[0].body = "28"
-    flexmock(SpecParser).should_call("_do_parse").once()
+    flexmock(SpecParser).should_call("_do_parse").twice()
     assert spec1.expanded_name == "test"
     assert spec1.expanded_version == "28.1.2~rc2"
     flexmock(SpecParser).should_receive("id").and_return(12345)
@@ -776,3 +777,29 @@
     ]:
         assert spec1.expand(expr) != ""
         assert spec2.expand(expr) == ""
+
+
+def test_circular_expansion(specfile_factory, spec_macros):
+    spec = specfile_factory(spec_macros)
+    with spec.macro_definitions() as md:
+        md.release.body = "1"
+        md.insert(
+            md.find("release") + 1,
+            MacroDefinition(
+                "release_string",
+                "%{release}%{?dist}",
+                False,
+                False,
+                CommentOutStyle.DNL,
+                ("", " ", " ", ""),
+            ),
+        )
+    with spec.tags() as tags:
+        tags.release.value = "%{release_string}"
+    dist = spec.expand("%{?dist}")
+    with spec.tags() as tags:
+        assert tags.release.expanded_value == f"1{dist}"
+        assert tags.version.expanded_value == "0.1.2~rc2"
+    assert spec.expanded_release == "1"
+    with spec.sources() as sources:
+        assert "0.1.2~rc2" in sources[0].expanded_location
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/specfile-0.40.2/tests/unit/test_formatter.py 
new/specfile-0.41.0/tests/unit/test_formatter.py
--- old/specfile-0.40.2/tests/unit/test_formatter.py    2026-04-23 
11:56:58.000000000 +0200
+++ new/specfile-0.41.0/tests/unit/test_formatter.py    2026-05-29 
11:13:52.000000000 +0200
@@ -25,8 +25,7 @@
             "func1('first argument', True, func2(kwarg={42: ['nested list item 
1', "
             "'nested list item 2', 'nested list item 3']}), 0, indent='    ', "
             "spec=<rpm.spec object at 0x7fe1ae1a6b30>)",
-            textwrap.dedent(
-                """\
+            textwrap.dedent("""\
                 func1(
                     'first argument',
                     True,
@@ -42,8 +41,7 @@
                     0,
                     indent='    ',
                     spec=<rpm.spec object at 0x7fe1ae1a6b30>,
-                )"""
-            ),
+                )"""),
         ),
     ],
 )

Reply via email to