state, update: fixes

cute-signatures
Timo Teras 2009-08-06 14:50:51 +03:00
parent ecdacd1503
commit 974a00bc5f
2 changed files with 4 additions and 2 deletions

View File

@ -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 */

View File

@ -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,
};