aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2009-08-06 14:50:51 +0300
committerTimo Teras <timo.teras@iki.fi>2009-08-06 14:50:51 +0300
commit974a00bc5f42d11da1b0f27a4c2d399147a07f10 (patch)
treec743f8dac247889f447abf57350e818ce8b03468
parentecdacd15032578148489f868fd928fb502032c60 (diff)
downloadaports-974a00bc5f42d11da1b0f27a4c2d399147a07f10.tar.bz2
aports-974a00bc5f42d11da1b0f27a4c2d399147a07f10.tar.xz
state, update: fixes
-rw-r--r--src/state.c4
-rw-r--r--src/update.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/src/state.c b/src/state.c
index d886754d28..1b1b333e20 100644
--- a/src/state.c
+++ b/src/state.c
@@ -502,7 +502,9 @@ int apk_state_lock_name(struct apk_state *state,
}
/* If the chosen package is installed, all is done here */
- if (oldpkg == newpkg && !(newpkg->name->flags & APK_NAME_REINSTALL))
+ if (oldpkg == newpkg &&
+ (newpkg == NULL ||
+ !(newpkg->name->flags & APK_NAME_REINSTALL)))
return 0;
/* Track change */
diff --git a/src/update.c b/src/update.c
index 5bf72959ee..eed5d4589c 100644
--- a/src/update.c
+++ b/src/update.c
@@ -23,7 +23,7 @@ static int update_main(void *ctx, struct apk_database *db, int argc, char **argv
static struct apk_applet apk_update = {
.name = "update",
.help = "Update repository indexes from all remote repositories.",
- .open_flags = APK_OPENF_READ | APK_OPENF_NO_STATE,
+ .open_flags = APK_OPENF_WRITE,
.forced_flags = APK_UPDATE_CACHE,
.main = update_main,
};