summaryrefslogtreecommitdiffstats
path: root/src/update.c
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2009-08-06 14:25:03 +0300
committerTimo Teras <timo.teras@iki.fi>2009-08-06 14:25:03 +0300
commitecdacd15032578148489f868fd928fb502032c60 (patch)
treee8ad3d487b60017f3f4975d09bbeac4a77b8d0b7 /src/update.c
parentfac43e2d60b550425481052e521d141730a303de (diff)
downloadapk-tools-ecdacd15032578148489f868fd928fb502032c60.tar.bz2
apk-tools-ecdacd15032578148489f868fd928fb502032c60.tar.xz
all: implement database open options
so user can override trusted keys directory and repositories file.
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,
};