|
Lubos Kardos |
ea526e |
From 9c1e995043a999dcac05a74aa8bcf934122d40ba Mon Sep 17 00:00:00 2001
|
|
Lubos Kardos |
ea526e |
From: Lubos Kardos <lkardos@redhat.com>
|
|
Lubos Kardos |
ea526e |
Date: Thu, 14 Apr 2016 13:12:51 +0200
|
|
Lubos Kardos |
ea526e |
Subject: [PATCH] Make creating index records consistent for rich and rich-weak
|
|
Lubos Kardos |
ea526e |
deps
|
|
Lubos Kardos |
ea526e |
|
|
Lubos Kardos |
ea526e |
If a package contains a rich require dependency then this rich
|
|
Lubos Kardos |
ea526e |
dependency is parsed and also subdependencies are stored into the
|
|
Lubos Kardos |
ea526e |
require index. For example for rich dependency "(A and B)" the whole
|
|
Lubos Kardos |
ea526e |
string "(A and B)" is stored into the index Requirename but
|
|
Lubos Kardos |
ea526e |
subdependcies "A" and "B" are stored into index too. Previously this
|
|
Lubos Kardos |
ea526e |
parsing and storing subdependencies was done only for require rich
|
|
Lubos Kardos |
ea526e |
dependencies. Now it is done also for weak rich dependecies (suggests,
|
|
Lubos Kardos |
ea526e |
supplements and recommends).
|
|
Lubos Kardos |
ea526e |
(rhbz:1325982)
|
|
Lubos Kardos |
ea526e |
---
|
|
Lubos Kardos |
ea526e |
lib/rpmdb.c | 16 +++++++++++++---
|
|
Lubos Kardos |
ea526e |
1 file changed, 13 insertions(+), 3 deletions(-)
|
|
Lubos Kardos |
ea526e |
|
|
Lubos Kardos |
ea526e |
diff --git a/lib/rpmdb.c b/lib/rpmdb.c
|
|
Lubos Kardos |
ea526e |
index 7992d9c..334c4d9 100644
|
|
Lubos Kardos |
ea526e |
--- a/lib/rpmdb.c
|
|
Lubos Kardos |
ea526e |
+++ b/lib/rpmdb.c
|
|
Lubos Kardos |
ea526e |
@@ -2342,9 +2342,19 @@ static rpmRC tag2index(dbiIndex dbi, rpmTagVal rpmtag,
|
|
Lubos Kardos |
ea526e |
|
|
Lubos Kardos |
ea526e |
rc += idxupdate(dbi, dbc, key, keylen, &rec);
|
|
Lubos Kardos |
ea526e |
|
|
Lubos Kardos |
ea526e |
- if ((rpmtag == RPMTAG_REQUIRENAME || rpmtag == RPMTAG_CONFLICTNAME) && *(char *)key == '(') {
|
|
Lubos Kardos |
ea526e |
- if (rpmtdType(&tagdata) == RPM_STRING_ARRAY_TYPE) {
|
|
Lubos Kardos |
ea526e |
- rc += updateRichDep(dbi, dbc, rpmtdGetString(&tagdata), &rec, idxupdate);
|
|
Lubos Kardos |
ea526e |
+ if (*(char *)key == '(') {
|
|
Lubos Kardos |
ea526e |
+ switch (rpmtag) {
|
|
Lubos Kardos |
ea526e |
+ case RPMTAG_REQUIRENAME:
|
|
Lubos Kardos |
ea526e |
+ case RPMTAG_CONFLICTNAME:
|
|
Lubos Kardos |
ea526e |
+ case RPMTAG_SUGGESTNAME:
|
|
Lubos Kardos |
ea526e |
+ case RPMTAG_SUPPLEMENTNAME:
|
|
Lubos Kardos |
ea526e |
+ case RPMTAG_RECOMMENDNAME:
|
|
Lubos Kardos |
ea526e |
+ if (rpmtdType(&tagdata) == RPM_STRING_ARRAY_TYPE) {
|
|
Lubos Kardos |
ea526e |
+ rc += updateRichDep(dbi, dbc, rpmtdGetString(&tagdata),
|
|
Lubos Kardos |
ea526e |
+ &rec, idxupdate);
|
|
Lubos Kardos |
ea526e |
+ }
|
|
Lubos Kardos |
ea526e |
+ default:
|
|
Lubos Kardos |
ea526e |
+ break;
|
|
Lubos Kardos |
ea526e |
}
|
|
Lubos Kardos |
ea526e |
}
|
|
Lubos Kardos |
ea526e |
}
|
|
Lubos Kardos |
ea526e |
--
|
|
Lubos Kardos |
ea526e |
1.9.3
|
|
Lubos Kardos |
ea526e |
|