Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-67161

Backport "Allow parametric macros to opt out of option processing" to RPM 4.16

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: Generate New Ti...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • Icon: Story Story
    • Resolution: Done-Errata
    • Icon: Major Major
    • rhel-9.6
    • rhel-9.5
    • rpm
    • rpm-4.16.1.3-37.el9
    • None
    • rhel-swm
    • ssg_core_services
    • 22
    • 26
    • 5
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • Hide

      The special "-" parameter can be used in a macro declaration to request that no argument processing be done by RPM and that the raw argument list shall be passed to the macro for further processing instead.

      Example:

      rpm --define '%foo(-) %{*}' --eval '%foo 5 a -z -b2'
      

      should now print "5 a -z -b2" (previously, it would fail with an "error: Unknown option").

      Show
      The special "-" parameter can be used in a macro declaration to request that no argument processing be done by RPM and that the raw argument list shall be passed to the macro for further processing instead. Example: rpm --define '%foo(-) %{*}' --eval '%foo 5 a -z -b2' should now print "5 a -z -b2" (previously, it would fail with an "error: Unknown option").
    • Pass
    • None
    • Release Note Not Required
    • All
    • None

      Goal

      • As a RPM macros maintainer, I want be able to define parametric macros which opt out of option processing, so that I can backport a macro from Fedora that uses this feature.

      Acceptance criteria

      This should work:

      $ rpm --define 'mymacro(-) ... %{?**}' --eval '%mymacro -a'
      ... -a
      

      As it currently does not work with rpm-4.16.1.3-34.el9:

      $ rpm --define 'mymacro(-) ... %{?**}' --eval '%mymacro -a'
      mymacro: invalid option -- 'a'
      error: Unknown option a in mymacro(-)
      

      Upstream PR (for RPM 4.17): https://github.com/rpm-software-management/rpm/pull/1392

      I have a backport ready at https://gitlab.com/redhat/centos-stream/rpms/rpm/-/merge_requests/60

              mdomonko@redhat.com Michal Domonkos
              mhroncok@redhat.com Miro HronĨok
              packaging-team-maint packaging-team-maint
              Martin Banas Martin Banas
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: