diff options
author | Timo Teräs <timo.teras@iki.fi> | 2015-12-10 14:30:57 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2015-12-10 14:30:57 +0200 |
commit | 2a066169bd60419576f065fbe3532d671dabb085 (patch) | |
tree | 9cca9d34564339fcb0c3a4d1ef233a42e1e610a4 /src/commit.c | |
parent | 8a41fd98a420dacb1390af553e6e3c56a3580bc1 (diff) | |
download | apk-tools-2a066169bd60419576f065fbe3532d671dabb085.tar.gz apk-tools-2a066169bd60419576f065fbe3532d671dabb085.tar.bz2 apk-tools-2a066169bd60419576f065fbe3532d671dabb085.tar.xz apk-tools-2a066169bd60419576f065fbe3532d671dabb085.zip |
commit: self-conflict error and satisfies printing
- self-conflicts when the exact same version of a name is provided
twice is now properly detected and diagnozed
- don't print redundant satisfies diagnostic
Diffstat (limited to 'src/commit.c')
-rw-r--r-- | src/commit.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/commit.c b/src/commit.c index 4b9ea11..deb38de 100644 --- a/src/commit.c +++ b/src/commit.c @@ -401,6 +401,7 @@ static void print_conflicts(struct print_state *ps, struct apk_package *pkg) struct apk_provider *p; struct apk_dependency *d; char tmp[256]; + int once; foreach_array_item(p, pkg->name->providers) { if (p->pkg == pkg || !p->pkg->marked) @@ -409,11 +410,17 @@ static void print_conflicts(struct print_state *ps, struct apk_package *pkg) apk_print_indented_fmt(&ps->i, PKG_VER_FMT, PKG_VER_PRINTF(p->pkg)); } foreach_array_item(d, pkg->provides) { + once = 1; foreach_array_item(p, d->name->providers) { if (!p->pkg->marked) continue; - if (p->pkg == pkg && p->version == d->version) + if (d->version == &apk_null_blob && + p->version == &apk_null_blob) continue; + if (once && p->pkg == pkg) { + once = 0; + continue; + } label_start(ps, "conflicts:"); apk_print_indented_fmt( &ps->i, PKG_VER_FMT "[%s]", @@ -442,8 +449,9 @@ static void print_dep(struct apk_package *pkg0, struct apk_dependency *d0, struc static void print_deps(struct print_state *ps, struct apk_package *pkg, int match) { ps->match = match; - apk_pkg_foreach_matching_dependency(NULL, ps->world, match, pkg, print_dep, ps); - apk_pkg_foreach_reverse_dependency(pkg, match, print_dep, ps); + match |= APK_FOREACH_MARKED | APK_FOREACH_DEP; + apk_pkg_foreach_matching_dependency(NULL, ps->world, match|apk_foreach_genid(), pkg, print_dep, ps); + apk_pkg_foreach_reverse_dependency(pkg, match|apk_foreach_genid(), print_dep, ps); label_end(ps); } @@ -456,9 +464,9 @@ static void analyze_package(struct print_state *ps, struct apk_package *pkg, uns print_pinning_errors(ps, pkg, tag); print_conflicts(ps, pkg); - print_deps(ps, pkg, APK_DEP_CONFLICTS | APK_FOREACH_MARKED); + print_deps(ps, pkg, APK_DEP_CONFLICTS); if (ps->label == NULL) - print_deps(ps, pkg, APK_DEP_SATISFIES | APK_FOREACH_MARKED); + print_deps(ps, pkg, APK_DEP_SATISFIES); } static void analyze_name(struct print_state *ps, struct apk_name *name) |