summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2009-08-06 17:04:40 +0300
committerTimo Teras <timo.teras@iki.fi>2009-08-06 17:04:40 +0300
commit8ae244db7d3b13bd1f5f87479127158afee99576 (patch)
tree676350955c63b8d5611f9bc23ca94297853aa2ac /src
parentba005f2e97b025d91758f513e808717e4baa4287 (diff)
downloadapk-tools-8ae244db7d3b13bd1f5f87479127158afee99576.tar.gz
apk-tools-8ae244db7d3b13bd1f5f87479127158afee99576.tar.bz2
apk-tools-8ae244db7d3b13bd1f5f87479127158afee99576.tar.xz
apk-tools-8ae244db7d3b13bd1f5f87479127158afee99576.zip
add: world needs to be updated before state instantiation
otherwise old world deps are used and unintended results will happen.
Diffstat (limited to 'src')
-rw-r--r--src/add.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/add.c b/src/add.c
index 4cc81b2..cb4c1eb 100644
--- a/src/add.c
+++ b/src/add.c
@@ -114,6 +114,7 @@ static int add_main(void *ctx, struct apk_database *db, int argc, char **argv)
if (virtpkg) {
apk_deps_add(&virtpkg->depends, &dep);
} else {
+ apk_deps_add(&db->world, &dep);
dep.name->flags |= APK_NAME_TOPLEVEL;
}
apk_deps_add(&pkgs, &dep);
@@ -136,8 +137,6 @@ static int add_main(void *ctx, struct apk_database *db, int argc, char **argv)
if (!(apk_flags & APK_FORCE))
goto err;
}
- if (!virtpkg)
- apk_deps_add(&db->world, &pkgs->item[i]);
}
r = apk_state_commit(state, db);
err: