#517 pre-push hook fails to expand RPM font macro
Closed: Invalid by onosek. Opened by jjames.

I just tried to push a minor update to the fontawesome-fonts package, but the pre-push hook prevented me from doing so:

$ git push
Source file '60-%{fontpkgname1}.conf' was neither listed in the 'sources' file nor tracked in git. Push operation was cancelled
Hint: this check (.git/hooks/pre-push script) can be bypassed by adding the argument '--no-verify' argument to the push command.
error: failed to push some refs to 'ssh://pkgs.fedoraproject.org/rpms/fontawesome-fonts'

It is true that the %fontpkgname1 macro is not defined in the spec file. It is defined through some RPM macro voodoo contained in the fonts-rpm-macros package. The file does exist, but the pre-push hook failed to properly expand the macro so that it could match filenames.


This can be replicated with spectool directly, even with fonts-rpm-macros installed:

$ spectool fontawesome-fonts.spec 
Source0: https://github.com/FortAwesome/Font-Awesome/archive/6.4.0/Font-Awesome-6.4.0.tar.gz
Source1: trademarks.py
Source2: README-Trademarks.txt
Source3: 60-%{fontpkgname1}.conf
Source4: 60-%{fontpkgname2}.conf
Patch0: fontawesome-fonts-opentype-css.patch

Interesting. It looks like RPM itself is not expanding the macros:

$ python3
Python 3.11.2 (main, Feb  8 2023, 00:00:00) [GCC 12.2.1 20221121 (Red Hat 12.2.1-4)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import rpm
>>> spec=rpm.spec('fontawesome-fonts.spec')
>>> spec.sources
[('fontawesome-fonts-opentype-css.patch', 0, 2), ('60-%{fontpkgname2}.conf', 4, 1), ('60-%{fontpkgname1}.conf', 3, 1), ('README-Trademarks.txt', 2, 1), ('trademarks.py', 1, 1), ('https://github.com/FortAwesome/Font-Awesome/archive/6.4.0/Font-Awesome-6.4.0.tar.gz', 0, 1)]

I will take this up with the RPM folks. Thank you @lsedlar .

I am closing it because it is an other tool's issue.
Additionally, rpkg since rpkg-1.66-5 is passing arguments (and thus processing macros) to spectool during pre-push check.

Metadata Update from @onosek:
- Issue close_status updated to: Invalid
- Issue status updated to: Closed (was: Open)

Metadata