From 592400f58bd11940aaddac443847fcc560910f0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 6 Oct 2023 11:59:15 +0200 Subject: [PATCH] Remove a no longer needed workaround for RPM <= 4.16 warning This removes an ugly hack that was used to get rid of: warning: Macro %1 defined but not used within scope I've noticed the %_pythonname_obsoletes generator does not expand %1 on non-RHELs and yet the warning is not shown. When debugging the missing warning, I've noticed it is never shown at all. According to RPM upstream, the warning was an undesired artifact: https://github.com/rpm-software-management/rpm/discussions/2501 It was purposefully removed starting with RPM 4.17. --- pythonname.attr | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/pythonname.attr b/pythonname.attr index 07d8df5..205570a 100644 --- a/pythonname.attr +++ b/pythonname.attr @@ -1,9 +1,6 @@ %__pythonname_provides() %{lua: local python = require 'fedora.srpm.python' - -- this macro is called for each file in a package, the path being in %1 - -- but we don't need to know the path, so we would get for each file: Macro %1 defined but not used within scope - -- in here, we expand %name conditionally on %1 to suppress the warning - local name = rpm.expand('%{?1:%{name}}') + local name = rpm.expand('%{name}') local evr = rpm.expand('%{?epoch:%{epoch}:}%{version}-%{release}') local provides = python.python_altprovides_once(name, evr) -- provides is either an array/table or nil @@ -23,10 +20,7 @@ -- In Fedora this is not needed as we don't ship ecosystem packages -- for alternative Python interpreters. local python = require 'fedora.srpm.python' - -- this macro is called for each file in a package, the path being in %1 - -- but we don't need to know the path, so we would get for each file: Macro %1 defined but not used within scope - -- in here, we expand %name conditionally on %1 to suppress the warning - local name = rpm.expand('%{?1:%{name}}') + local name = rpm.expand('%{name}') local evr = rpm.expand('%{?epoch:%{epoch}:}%{version}-%{release}') local obsoletes = python.python_altobsoletes_once(name, evr) -- obsoletes is either an array/table or nil