summaryrefslogtreecommitdiff
path: root/src/commit.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2013-06-14 21:37:38 +0300
committerTimo Teräs <timo.teras@iki.fi>2013-06-14 21:37:38 +0300
commitac0c7457c26dd4424ec6282293f3ebbcc1e63886 (patch)
tree15eb440e00ee23448516055787631c58c5ec9431 /src/commit.c
parent56b623b9e21c1dddffaaa37cfb4aeaca27917cbe (diff)
downloadapk-tools-ac0c7457c26dd4424ec6282293f3ebbcc1e63886.tar.gz
apk-tools-ac0c7457c26dd4424ec6282293f3ebbcc1e63886.tar.bz2
apk-tools-ac0c7457c26dd4424ec6282293f3ebbcc1e63886.tar.xz
apk-tools-ac0c7457c26dd4424ec6282293f3ebbcc1e63886.zip
errors: detect self-conflicts properly
and add the provided version information to the conflicts. fixes the final test case that was broken. hooray.
Diffstat (limited to 'src/commit.c')
-rw-r--r--src/commit.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/commit.c b/src/commit.c
index b8bf1a7..c0996f2 100644
--- a/src/commit.c
+++ b/src/commit.c
@@ -430,6 +430,7 @@ static void print_conflicts(struct print_state *ps, struct apk_package *pkg)
{
struct apk_provider *p;
struct apk_dependency *d;
+ char tmp[256];
foreach_array_item(p, pkg->name->providers) {
if (p->pkg == pkg || !p->pkg->marked)
@@ -439,14 +440,15 @@ static void print_conflicts(struct print_state *ps, struct apk_package *pkg)
}
foreach_array_item(d, pkg->provides) {
foreach_array_item(p, d->name->providers) {
- if (p->pkg == pkg || !p->pkg->marked)
+ if (!p->pkg->marked)
+ continue;
+ if (p->pkg == pkg && p->version == d->version)
continue;
label_start(ps, "conflicts:");
apk_print_indented_fmt(
- &ps->i,
- PKG_VER_FMT "[%s]",
+ &ps->i, PKG_VER_FMT "[%s]",
PKG_VER_PRINTF(p->pkg),
- d->name->name);
+ apk_dep_snprintf(tmp, sizeof(tmp), d));
}
}
label_end(ps);