diff options
author | Timo Teras <timo.teras@iki.fi> | 2009-04-16 16:32:04 +0300 |
---|---|---|
committer | Timo Teras <timo.teras@iki.fi> | 2009-04-16 16:32:04 +0300 |
commit | 968dfbb8b376de2dc6f2441dc3966d1416ad0046 (patch) | |
tree | 021e129316464433327a8f863aafbff3cbae14a8 /src/del.c | |
parent | 4e08c8762139305c1f522b075529d50c1ececafd (diff) | |
download | apk-tools-968dfbb8b376de2dc6f2441dc3966d1416ad0046.tar.gz apk-tools-968dfbb8b376de2dc6f2441dc3966d1416ad0046.tar.bz2 apk-tools-968dfbb8b376de2dc6f2441dc3966d1416ad0046.tar.xz apk-tools-968dfbb8b376de2dc6f2441dc3966d1416ad0046.zip |
pkg: apk_deps_del helper introduced
Diffstat (limited to 'src/del.c')
-rw-r--r-- | src/del.c | 14 |
1 files changed, 2 insertions, 12 deletions
@@ -19,7 +19,7 @@ static int del_main(void *ctx, int argc, char **argv) struct apk_database db; struct apk_state *state; struct apk_name *name; - int i, j, r; + int i, r; if (apk_db_open(&db, apk_root, APK_OPENF_WRITE) < 0) return -1; @@ -29,18 +29,8 @@ static int del_main(void *ctx, int argc, char **argv) for (i = 0; i < argc; i++) { 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) { - db.world->item[j] = - db.world->item[db.world->num-1]; - db.world = - apk_dependency_array_resize(db.world, db.world->num-1); - } - } + apk_deps_del(&db.world, name); } state = apk_state_new(&db); |