#62 Fix error when %pycached %exclude is used.
Closed a year ago by churchyard. Opened a year ago by dormouse.
rpms/ dormouse/python-rpm-macros master  into  master

file modified
+1 -1
@@ -53,7 +53,7 @@ 

  # This only supports Python 3.5+ and will never work with Python 2.

  # Hence, it has no Python version in the name.

  %pycached() %{lua:

-   path = rpm.expand("%{?1}")

+   path = rpm.expand("%{?*}")

    if (string.sub(path, "-3") ~= ".py") then

      rpm.expand("%{error:%%pycached can only be used with paths explicitly ending with .py}")


file modified
+4 -1
@@ -1,6 +1,6 @@ 

  Name:           python-rpm-macros

  Version:        3.9

- Release:        1%{?dist}

+ Release:        2%{?dist}

  Summary:        The common Python RPM macros


  # macros and lua: MIT, compileall2.py: PSFv2
@@ -107,6 +107,9 @@ 




+ * Wed May 27 2020 Marcel Plch <mplch@redhat.com> - 3.9-2

+ - Fix error when %%pycached %%exclude is used. (#1838992)


  * Thu May 21 2020 Miro Hrončok <mhroncok@redhat.com> - 3.9-1

  - https://fedoraproject.org/wiki/Changes/Python3.9

  - Switch the %%py_dist_name macro to convert dots (".") into dashes as defined in PEP 503 (#1791530)

no initial comment

Build failed.

You need to escape the macros here with double %%.

Would you please describe the problem and how does this solve it and link to the bugzilla in the commit message? Also please add (#12345) kind of bugzilla reference to the changelog for consistency.


My understanding of the problem:
Expand with the "1" marks the first argument of the macro (%exclude) only, which then errors out as it is not a .py file.
With "*", everything is selected (%exclude /path/to/foo.py) and this whole string is then checked whether or not it ends with ".py".

That understanding is correct.

rebased onto 50fe4a5f0b45aa2b2274749e1cd7c35936b9adab

a year ago

Build failed.

Side note: The provides tests are expected to fail mid bootstrap.

rebased onto 48f45aa

a year ago

Build failed.

Pull-Request has been closed by churchyard

a year ago