1

I am learning rpm/rpmbuild and I see strange behavior difference in RPM v4.4.2.3 and RPM v4.14.
I created an rpmrc file which has below content

macrofiles:/home/rmehta/rpmtest/rpmmacros

and rpmmacros has below contents

%_name Rakesh

When I execute rpmbuild --rcfile /home/rmehta/rpmtest/rpmrc --eval %_name it gives different output for both RPM versions For RPM version 4.4.2.3 (SLES-15) it prints Rakesh
For RPM version 4.14.3 (SLES-11) it prints %_name

My question is why this difference and why for RPM v4.14.3 its not reading the rcfile.

I tried same with RPM v4.11(openSUSE) and its behaviour is same as RPM v4.14.3.

  • Have you tried `--eval '%{_name}'` on the command line? Just a shot in the dark, sorry. Does `--showrc` give you anything useful to compare? – Aaron D. Marasco Apr 19 '22 at 19:58
  • @AaronD.Marasco Thanks for replying. I already tried `--eval '%{_name}'` but it has same result as `--eval %_name` On comparing output with `--showrc` flag, there are many difference but below are some differences which I believe are important
    1) With RPM v4.4 there is no Macro path, which is there for RPM v4.14 as below
    Macro Path: /usr/lib/rpm/macros:/usr/lib/rpm/macros.d/macros.*:/usr/lib/rpm/platform/%{_target}/macros:/usr/lib/rpm/fileattrs/*.attr:/usr/lib/rpm/suse/macros:/etc/ rpm/macros.*:/etc/rpm/macros:/etc/rpm/%{_target}/macros:~/.rpmmacros
    – Rakesh Mehta Apr 20 '22 at 08:02
  • 2) With RPM v4.4 the _name macro is defined as `-14: _name Rakesh` which is missing for RPM v4.14 3) With RPM v4.4 there is optflags : -O2 which is missing for RPM v4.14 4) For both it has > RPMRC VALUES: macrofiles : /home/rmehta/rpmtest/rpmmacros – Rakesh Mehta Apr 20 '22 at 08:09
  • Sorry no idea why. – Aaron D. Marasco Apr 20 '22 at 19:33

0 Answers0