Dependency generator hooks and extending default requires/provides

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


Hello

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
#!/bin/sh
/usr/lib/rpm/rpmdeps --provides

$ cat /usr/lib/rpm/mpi.req
#!/bin/sh
/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):
https://smani.fedorapeople.org/rpm-mpi-hooks-1.0-1.fc23.src.rpm
https://smani.fedorapeople.org/mpihooktest-1.0-1.fc23.src.rpm
)


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?

Thanks,
Sandro


[1] https://fedoraproject.org/wiki/Changes/RpmMPIReqProv
[2] https://lists.fedoraproject.org/pipermail/devel/2015-June/211570.html


More information about the Rpm-list mailing list