summaryrefslogtreecommitdiff
path: root/src/apk.c
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-12-07 10:41:13 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2015-12-07 12:50:32 +0000
commitc43bfed8deaa0dab47c54db9b8f374853d345a6b (patch)
tree0a257c0462ea99483946b142b1dd03424add1496 /src/apk.c
parent14b74c4dc097ff71280e99edc651b685b9582950 (diff)
downloadapk-tools-c43bfed8deaa0dab47c54db9b8f374853d345a6b.tar.gz
apk-tools-c43bfed8deaa0dab47c54db9b8f374853d345a6b.tar.bz2
apk-tools-c43bfed8deaa0dab47c54db9b8f374853d345a6b.tar.xz
apk-tools-c43bfed8deaa0dab47c54db9b8f374853d345a6b.zip
db: add support for --no-cache
Implement --no-cache. The index is read directly from network and not cached. This is useful for docker, where you install a set of packages and directly after purge the cache. (see https://github.com/gliderlabs/docker-alpine/blob/1fc9e59d1689fc4eaf930ec66389fe58062fccec/builder/scripts/apk-install) fixes #4905
Diffstat (limited to 'src/apk.c')
-rw-r--r--src/apk.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/apk.c b/src/apk.c
index 8632587..91673d8 100644
--- a/src/apk.c
+++ b/src/apk.c
@@ -124,6 +124,9 @@ static int option_parse_global(void *ctx, struct apk_db_options *dbopts, int opt
case 0x109:
apk_flags |= APK_NO_NETWORK;
break;
+ case 0x115:
+ apk_flags |= APK_NO_CACHE;
+ break;
case 0x112:
dbopts->arch = optarg;
break;
@@ -173,6 +176,7 @@ static const struct apk_option options_global[] = {
{ 0x108, "repositories-file", "Override repositories file",
required_argument, "REPOFILE" },
{ 0x109, "no-network", "Do not use network (cache is still used)" },
+ { 0x115, "no-cache", "Read uncached index from network" },
{ 0x112, "arch", "Use architecture with --root",
required_argument, "ARCH" },
{ 0x114, "print-arch", "Print default arch and exit" },