Dependency generator hooks and extending default requires/provides

Sandro Mani manisandro at
Wed Jul 1 22:27:58 UTC 2015


I'm looking at extending the requires and provides strings returned by 
rpmdeps (background: [1]), and it was suggested to me to use dependency 
generator hooks to accomplish this [2].

My initial experiment is

$ cat /usr/lib/rpm/fileattrs/mpi.attrs
# the path to your provides generating script
%__mpi_provides %{_rpmconfigdir}/mpi.prov
# the path to your requires generating script
%__mpi_requires %{_rpmconfigdir}/mpi.req
# a regular expression that paths in an RPM
# must match to trigger the generator
%__mpi_path ^%{_prefix}/lib(64)/(openmpi|mpich)/.*$

$ cat /usr/lib/rpm/mpi.prov
/usr/lib/rpm/rpmdeps --provides

$ cat /usr/lib/rpm/mpi.req
/usr/lib/rpm/rpmdeps --requires

This however triggers what appears to be an endless recursion of calls 
mpi.prov -> rpmdeps -> mpi.prov -> rpmdeps -> etc

(Trivial packages which demostrate this issue (rpmbuild & install rpm-mpi-hooks, then rpmbuild mpihooktest):

Without any knowledge of the rpm codebase, I figure what is happening is that rpmdeps internally honours %__mpi_provides, which causes the endless loop.

So my question: is there any way to write dependency generator hooks which take the output of stock rpmdeps --requires resp. --provides and extend it with some additional text?



More information about the Rpm-list mailing list