add: world needs to be updated before state instantiation

otherwise old world deps are used and unintended results will
happen.
cute-signatures
Timo Teras 2009-08-06 17:04:40 +03:00
parent ba005f2e97
commit 8ae244db7d
1 changed files with 1 additions and 2 deletions

View File

@ -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: