From 369bf9b91e5e85f00f7a925e152137598fbed1ba Mon Sep 17 00:00:00 2001 From: Gordon Messmer Date: Sat, 28 Jan 2023 23:27:38 -0800 Subject: [PATCH] Enhance requires with version information from the build root. For shared objects without versioned symbols, this additional information allows rpm to track minor-version dependencies. --- macros.in | 2 +- scripts/CMakeLists.txt | 2 +- scripts/enhance-requires | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 scripts/enhance-requires diff --git a/macros.in b/macros.in index b4c2adc86a..c907de937b 100644 --- a/macros.in +++ b/macros.in @@ -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 ??? diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 6cfee631a7..cac552b665 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -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 diff --git a/scripts/enhance-requires b/scripts/enhance-requires new file mode 100644 index 0000000000..59fb7b3fca --- /dev/null +++ b/scripts/enhance-requires @@ -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