summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2009-04-15 16:38:22 +0300
committerTimo Teras <timo.teras@iki.fi>2009-04-15 16:38:22 +0300
commit6f7719d3f481c8f1f71e3ed58bfa7a2f7bf00a69 (patch)
tree40deaec0a716b23666744f97ff850a6462cc45d7
parent55b7b89e6585a935e3ab66fdab68e49d11616f1e (diff)
downloadapk-tools-6f7719d3f481c8f1f71e3ed58bfa7a2f7bf00a69.tar.bz2
apk-tools-6f7719d3f481c8f1f71e3ed58bfa7a2f7bf00a69.tar.xz
state: fix installation of package broken by autoclean patch
-rw-r--r--src/state.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/state.c b/src/state.c
index c3452a6..5125567 100644
--- a/src/state.c
+++ b/src/state.c
@@ -364,7 +364,6 @@ static int for_each_broken_reverse_depency(struct apk_state *state,
static int delete_broken_package(struct apk_state *state,
struct apk_package *pkg)
-
{
return apk_state_lock_name(state, pkg->name, NULL);
}
@@ -390,7 +389,9 @@ int apk_state_lock_name(struct apk_state *state,
if (name->id >= state->num_names)
return -1;
- if ((name->flags & APK_NAME_TOPLEVEL) && !(apk_flags & APK_FORCE)) {
+ if (newpkg == NULL &&
+ (name->flags & APK_NAME_TOPLEVEL) &&
+ !(apk_flags & APK_FORCE)) {
apk_error("Not deleting top level dependency '%s'. "
"Use -f to override.", name->name);
return -1;