diff options
author | Timo Teras <timo.teras@iki.fi> | 2009-04-16 15:37:53 +0300 |
---|---|---|
committer | Timo Teras <timo.teras@iki.fi> | 2009-04-16 15:37:53 +0300 |
commit | 4e08c8762139305c1f522b075529d50c1ececafd (patch) | |
tree | 4756a354e8f2c2d5e974d70e535e8eaa347e6cca | |
parent | d6f4fcacd1da9e8dbf0504e443e5d68f062fdca4 (diff) | |
download | apk-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
-rw-r--r-- | src/del.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -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, |