canonize also provided filenames for symlinked system dirs

This commit is contained in:
Miroslav Lichvar 2014-05-06 11:07:27 +02:00
parent 9009fe9463
commit 84a0e5627f
2 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,22 @@
commit 13926c11f6b33aa1ade43dddfea194cb4210760b
Author: Miroslav Lichvar <mlichvar@redhat.com>
Date: Tue May 6 10:19:26 2014 +0200
canonize also provided filenames for symlinked system dirs
This is needed with packages which provide a filename in a symlinked
system dir, but don't include it.
diff --git a/rpm.c b/rpm.c
index 38bc26f..9f10ddb 100644
--- a/rpm.c
+++ b/rpm.c
@@ -124,6 +124,8 @@ static int rpm_read_provs(const struct repo *repo, struct pkgs *p, uint firstpid
provides = rpmdsNew(header, RPMTAG_PROVIDENAME, 0);
while (rpmdsNext(provides) != -1) {
prov = rpmdsN(provides);
+ if (prov[0] == '/')
+ prov = get_cpath(rd, prov);
provflags = rpmdsFlags(provides);
provver = rpmdsEVR(provides);
provflags &= RPMSENSE_LESS | RPMSENSE_GREATER |

View File

@ -7,6 +7,7 @@ Group: Applications/System
License: GPLv2+
URL: https://fedorahosted.org/rpmreaper/
Source0: https://fedorahosted.org/released/%{name}/%{name}-%{version}.tar.gz
Patch1: rpmreaper-provfilename.patch
BuildRequires: ncurses-devel rpm-devel
Requires: less rpm
@ -17,6 +18,7 @@ allows removing unnecessary packages and their dependencies from the system.
%prep
%setup -q
%patch1 -p1 -b .provfilename
%build
make %{?_smp_mflags} EXTRA_CFLAGS="$RPM_OPT_FLAGS"