summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2018-11-02 17:41:34 +0200
committerTimo Teräs <timo.teras@iki.fi>2018-11-02 17:41:34 +0200
commitb06e3b991dbe2cb5f9ca65ed50a443a5ecaaf383 (patch)
tree2dfebf1054e4b54e440f9979a3cf576885c0f958
parent31338affc2cd3e095949e987fdf3716ce7b376ab (diff)
downloadapk-tools-b06e3b991dbe2cb5f9ca65ed50a443a5ecaaf383.tar.bz2
apk-tools-b06e3b991dbe2cb5f9ca65ed50a443a5ecaaf383.tar.xz
fix error reporting for virtual package addition
Move addition of virtual package after the dependencies have been parsed as then the reverse dependency structers can be populated correctly.
-rw-r--r--src/add.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/add.c b/src/add.c
index 23b8dd4..946dc55 100644
--- a/src/add.c
+++ b/src/add.c
@@ -116,7 +116,6 @@ static int add_main(void *ctx, struct apk_database *db, struct apk_string_array
virtpkg->version = apk_blob_atomize(APK_BLOB_STR("0"));
virtpkg->description = strdup("virtual meta package");
virtpkg->arch = apk_blob_atomize(APK_BLOB_STR("noarch"));
- virtpkg = apk_db_pkg_add(db, virtpkg);
}
foreach_array_item(parg, args) {
@@ -160,6 +159,7 @@ static int add_main(void *ctx, struct apk_database *db, struct apk_string_array
}
}
if (virtpkg) {
+ virtpkg = apk_db_pkg_add(db, virtpkg);
apk_deps_add(&world, &virtdep);
apk_solver_set_name_flags(virtdep.name,
actx->solver_flags,