summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2014-03-27 11:44:11 +0100
committerMichael Schroeder <mls@suse.de>2014-03-27 11:44:11 +0100
commitd50ba044c8a10b9979998c2147a4f9973588a8ff (patch)
treecef61b131630a9d0fcf5a422e8a00ce261f6e4b5 /ext
parent456e342d1b39c19b133a5e76cdf4f4d98f88a9f4 (diff)
downloadlibsolv-d50ba044c8a10b9979998c2147a4f9973588a8ff.tar.gz
libsolv-d50ba044c8a10b9979998c2147a4f9973588a8ff.tar.bz2
libsolv-d50ba044c8a10b9979998c2147a4f9973588a8ff.zip
autopattern: always chose the lexicographical first one if there are two pattern/product provides
Diffstat (limited to 'ext')
-rw-r--r--ext/repo_autopattern.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/ext/repo_autopattern.c b/ext/repo_autopattern.c
index 01238aa..c947aef 100644
--- a/ext/repo_autopattern.c
+++ b/ext/repo_autopattern.c
@@ -133,15 +133,28 @@ repo_add_autopattern(Repo *repo, int flags)
if (rd->name == pattern_id)
{
const char *evrstr = pool_id2str(pool, rd->evr);
- if (evrstr[0] == '.')
+ if (evrstr[0] == '.') /* hack to allow provides that do not create a pattern */
continue;
+ if (patq2.count && patq2.elements[patq2.count - 2] == p)
+ {
+ /* hmm, two provides. choose by evrstr */
+ if (strcmp(evrstr, pool_id2str(pool, patq2.elements[patq2.count - 1])) >= 0)
+ continue;
+ patq2.count -= 2;
+ }
queue_push2(&patq2, p, rd->evr);
- break;
}
if (rd->name == product_id)
{
+ const char *evrstr = pool_id2str(pool, rd->evr);
+ if (prdq2.count && prdq2.elements[prdq2.count - 2] == p)
+ {
+ /* hmm, two provides. choose by evrstr */
+ if (strcmp(evrstr, pool_id2str(pool, prdq2.elements[prdq2.count - 1])) >= 0)
+ continue;
+ prdq2.count -= 2;
+ }
queue_push2(&prdq2, p, rd->evr);
- break;
}
}
}