From 07f430f86097a0e248d1304509befac3298fa094 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 15 Jun 2020 12:16:08 +0200 Subject: [PATCH] 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 --- epel-rpm-macros.spec | 1 + macros.epel-rpm-macros | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index 8efc14d..f02234e 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -62,6 +62,7 @@ install -Dpm 644 %{SOURCE3} \ %changelog * Sun Jun 07 2020 Miro HronĨok - 8-12 - Backport %%py_shebang_fix, %%pytest, %%py_provides +- Allow to combine %%pycached with other macros (e.g. %%exclude or %%ghost) (#1838992) * Thu Apr 30 2020 Troy Dawson - 8-11 - Install python36-rpm-macros or python38-rpm-macros correctly diff --git a/macros.epel-rpm-macros b/macros.epel-rpm-macros index 770dc05..3aa950c 100644 --- a/macros.epel-rpm-macros +++ b/macros.epel-rpm-macros @@ -38,7 +38,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