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/package.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/package.c')
-rw-r--r-- | src/package.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/package.c b/src/package.c index c59ec92..f74ca4d 100644 --- a/src/package.c +++ b/src/package.c @@ -90,6 +90,25 @@ int apk_deps_add(struct apk_dependency_array **depends, return 0; } +void apk_deps_del(struct apk_dependency_array **pdeps, + struct apk_name *name) +{ + struct apk_dependency_array *deps = *pdeps; + int i; + + if (deps == NULL) + return; + + for (i = 0; i < deps->num; i++) { + if (deps->item[i].name != name) + continue; + + deps->item[i] = deps->item[deps->num-1]; + *pdeps = apk_dependency_array_resize(deps, deps->num-1); + break; + } +} + struct parse_depend_ctx { struct apk_database *db; struct apk_dependency_array **depends; |