From 0e82d5911dad844dee876047e0195d96277b8152 Mon Sep 17 00:00:00 2001 From: Miro Hrončok Date: Jun 15 2020 10:20:58 +0000 Subject: Allow to combine %pycached with other macros (e.g. %exclude or %ghost) Previous implementation allowed for only one argument to be passed to the %pycached macro, which made it impossible to combine it with other macros. Current implementation allows to pass other macros as arguments to %pycached. Example: %pycached %exclude /path/to/foo.py For macro expansion limitations, the opposite order is not possible. That is to be documented in the guidelines: https://pagure.io/packaging-committee/pull-request/986 Resolves https://bugzilla.redhat.com/show_bug.cgi?id=1838992 Co-authored-by: Marcel Plch --- diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index fa0b3f3..ca69ec5 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros Version: 7 -Release: 24 +Release: 25 Summary: Extra Packages for Enterprise Linux RPM macros Group: System Environment/Base @@ -52,6 +52,9 @@ install -Dpm 755 %{SOURCE2} \ %changelog +* Mon Jun 15 2020 Miro Hrončok - 7-25 +- Allow to combine %%pycached with other macros (e.g. %%exclude or %%ghost) (#1838992) + * Sat Dec 28 2019 Miro Hrončok - 7-24 - Add the %%pycached macro diff --git a/macros.epel-rpm-macros b/macros.epel-rpm-macros index 7cf8795..270475a 100644 --- a/macros.epel-rpm-macros +++ b/macros.epel-rpm-macros @@ -55,7 +55,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}") else