summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2014-10-06 14:09:50 +0300
committerTimo Teräs <timo.teras@iki.fi>2014-10-06 14:09:50 +0300
commitf911f7043becd562d2adfafcb26e192023b9c73f (patch)
treeb916284c3216a088c642f5eeacd8688ea69bb8d5 /src
parentac39e84d53228bccfd4b371ec3ee3350ceca0f28 (diff)
downloadapk-tools-f911f7043becd562d2adfafcb26e192023b9c73f.tar.gz
apk-tools-f911f7043becd562d2adfafcb26e192023b9c73f.tar.bz2
apk-tools-f911f7043becd562d2adfafcb26e192023b9c73f.tar.xz
apk-tools-f911f7043becd562d2adfafcb26e192023b9c73f.zip
index: fix warning about package names without provider
It's real only if there's a package with actual dependency (conflicts and install_if dependencies do not count).
Diffstat (limited to 'src')
-rw-r--r--src/apk_database.h2
-rw-r--r--src/database.c1
-rw-r--r--src/index.c17
3 files changed, 11 insertions, 9 deletions
diff --git a/src/apk_database.h b/src/apk_database.h
index 74af494..23a2dd6 100644
--- a/src/apk_database.h
+++ b/src/apk_database.h
@@ -92,8 +92,8 @@ struct apk_name {
struct apk_provider_array *providers;
struct apk_name_array *rdepends;
struct apk_name_array *rinstall_if;
+ unsigned is_dependency : 1;
unsigned int foreach_genid;
-
union {
struct apk_solver_name_state ss;
void *state_ptr;
diff --git a/src/database.c b/src/database.c
index 3f1b6f6..25b076d 100644
--- a/src/database.c
+++ b/src/database.c
@@ -498,6 +498,7 @@ static void apk_db_pkg_rdepends(struct apk_database *db, struct apk_package *pkg
foreach_array_item(d, pkg->depends) {
rname = d->name;
+ rname->is_dependency |= !d->conflict;
foreach_array_item(rd, rname->rdepends)
if (*rd == pkg->name)
goto rdeps_done;
diff --git a/src/index.c b/src/index.c
index 4a97911..a783095 100644
--- a/src/index.c
+++ b/src/index.c
@@ -74,14 +74,15 @@ static int warn_if_no_providers(apk_hash_item item, void *ctx)
struct counts *counts = (struct counts *) ctx;
struct apk_name *name = (struct apk_name *) item;
- if (name->providers->num == 0) {
- if (++counts->unsatisfied < 10) {
- apk_warning("No provider for dependency '%s'",
- name->name);
- } else if (counts->unsatisfied == 10) {
- apk_warning("Too many unsatisfiable dependencies, "
- "not reporting the rest.");
- }
+ if (!name->is_dependency) return 0;
+ if (name->providers->num) return 0;
+
+ if (++counts->unsatisfied < 10) {
+ apk_warning("No provider for dependency '%s'",
+ name->name);
+ } else if (counts->unsatisfied == 10) {
+ apk_warning("Too many unsatisfiable dependencies, "
+ "not reporting the rest.");
}
return 0;