summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2009-04-16 15:37:53 +0300
committerTimo Teras <timo.teras@iki.fi>2009-04-16 15:37:53 +0300
commit4e08c8762139305c1f522b075529d50c1ececafd (patch)
tree4756a354e8f2c2d5e974d70e535e8eaa347e6cca /src
parentd6f4fcacd1da9e8dbf0504e443e5d68f062fdca4 (diff)
downloadapk-tools-4e08c8762139305c1f522b075529d50c1ececafd.tar.gz
apk-tools-4e08c8762139305c1f522b075529d50c1ececafd.tar.bz2
apk-tools-4e08c8762139305c1f522b075529d50c1ececafd.tar.xz
apk-tools-4e08c8762139305c1f522b075529d50c1ececafd.zip
del: first remove all targets from world, and then calculate changes
Diffstat (limited to 'src')
-rw-r--r--src/del.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/del.c b/src/del.c
index e980d71..00938b7 100644
--- a/src/del.c
+++ b/src/del.c
@@ -27,13 +27,11 @@ static int del_main(void *ctx, int argc, char **argv)
if (db.world == NULL)
goto out;
- state = apk_state_new(&db);
for (i = 0; i < argc; i++) {
- struct apk_dependency dep;
-
name = apk_db_get_name(&db, APK_BLOB_STR(argv[i]));
/* Remove from world, so we get proper changeset */
+ name->flags &= ~APK_NAME_TOPLEVEL;
for (j = 0; j < db.world->num; j++) {
if (strcmp(db.world->item[j].name->name,
argv[i]) == 0) {
@@ -43,8 +41,13 @@ static int del_main(void *ctx, int argc, char **argv)
apk_dependency_array_resize(db.world, db.world->num-1);
}
}
- name->flags &= ~APK_NAME_TOPLEVEL;
+ }
+ state = apk_state_new(&db);
+ for (i = 0; i < argc; i++) {
+ struct apk_dependency dep;
+
+ name = apk_db_get_name(&db, APK_BLOB_STR(argv[i]));
dep = (struct apk_dependency) {
.name = name,
.result_mask = APK_DEPMASK_CONFLICT,