Skip to content

Commit

Permalink
Enhance requires with version information from the build root.
Browse files Browse the repository at this point in the history
For shared objects without versioned symbols, this additional
information allows rpm to track minor-version dependencies.
  • Loading branch information
gordonmessmer committed Jan 29, 2023
1 parent a9ac172 commit 369bf9b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion macros.in
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ Supplements: (%{name} = %{version}-%{release} and langpacks-%{1})\
#%__find_provides %{_rpmconfigdir}/rpmdeps --provides
#%__find_requires %{_rpmconfigdir}/rpmdeps --requires
%__find_provides %{_rpmconfigdir}/find-provides
%__find_requires %{_rpmconfigdir}/find-requires
%__find_requires %{_rpmconfigdir}/enhance-requires
#%__find_conflicts ???
#%__find_obsoletes ???

Expand Down
2 changes: 1 addition & 1 deletion scripts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ install(PROGRAMS
brp-strip-static-archive brp-elfperms brp-remove-la-files
check-files check-prereqs
check-buildroot check-rpaths check-rpaths-worker
find-lang.sh find-requires find-provides
find-lang.sh enhance-requires find-requires find-provides
perl.prov perl.req
pkgconfigdeps.sh
ocamldeps.sh
Expand Down
15 changes: 15 additions & 0 deletions scripts/enhance-requires
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

version_deps () {
while read dep
do
if [[ "${dep}" =~ ^[^\(]*\(\) ]] && rpm -q --whatprovides "${dep}" &> /dev/null
then
printf "($dep with %s)\n" "$(rpm -q --whatprovides "${dep}" --qf '%{NAME} >= %{VERSION}')"
else
printf "%s\n" "${dep}"
fi
done
}

/usr/lib/rpm/find-requires | version_deps

0 comments on commit 369bf9b

Please sign in to comment.