summaryrefslogtreecommitdiffstats
path: root/src/update.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/update.c')
-rw-r--r--src/update.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/update.c b/src/update.c
index abf4021..5bf7295 100644
--- a/src/update.c
+++ b/src/update.c
@@ -15,21 +15,16 @@
#include "apk_database.h"
#include "apk_version.h"
-static int update_main(void *ctx, int argc, char **argv)
+static int update_main(void *ctx, struct apk_database *db, int argc, char **argv)
{
- struct apk_database db;
-
- apk_flags |= APK_UPDATE_CACHE;
- if (apk_db_open(&db, apk_root, APK_OPENF_READ) < 0)
- return -1;
- apk_db_close(&db);
-
return 0;
}
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,
+ .forced_flags = APK_UPDATE_CACHE,
.main = update_main,
};