summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2014-10-09 19:32:48 +0300
committerTimo Teräs <timo.teras@iki.fi>2014-10-09 19:32:48 +0300
commit82713dc389c8c4e69d11dcd421d2f827bd0e6306 (patch)
treed4ae2b4c25d8cddbad5f2f5cab0860ca253cc414 /src
parent38e3f5463878a29e675be8430135e36b552c0ac1 (diff)
downloadapk-tools-82713dc389c8c4e69d11dcd421d2f827bd0e6306.tar.gz
apk-tools-82713dc389c8c4e69d11dcd421d2f827bd0e6306.tar.bz2
apk-tools-82713dc389c8c4e69d11dcd421d2f827bd0e6306.tar.xz
apk-tools-82713dc389c8c4e69d11dcd421d2f827bd0e6306.zip
db: unconditionally refresh index with --force
Diffstat (limited to 'src')
-rw-r--r--src/database.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/database.c b/src/database.c
index 3962a8e..89f944c 100644
--- a/src/database.c
+++ b/src/database.c
@@ -624,7 +624,9 @@ int apk_cache_download(struct apk_database *db, struct apk_repository *repo,
r = apk_repo_format_real_url(db, repo, pkg, url, sizeof(url));
if (r < 0) return r;
- if (fstatat(db->cache_fd, cacheitem, &st, 0) != 0) st.st_mtime = 0;
+ if ((apk_flags & APK_FORCE) ||
+ fstatat(db->cache_fd, cacheitem, &st, 0) != 0)
+ st.st_mtime = 0;
apk_message("fetch %s", url);