summaryrefslogtreecommitdiff
path: root/src/database.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2018-07-18 13:28:49 +0300
committerTimo Teräs <timo.teras@iki.fi>2018-07-18 13:29:13 +0300
commite1a05c74cb8ae6ab41ee960343cc64a0a9af95a5 (patch)
tree41fddfc3ceb222fe145c5d66f96e06fb39961a46 /src/database.c
parentd609ef3c6cec438f32383ffb03081a36583402a5 (diff)
downloadapk-tools-e1a05c74cb8ae6ab41ee960343cc64a0a9af95a5.tar.gz
apk-tools-e1a05c74cb8ae6ab41ee960343cc64a0a9af95a5.tar.bz2
apk-tools-e1a05c74cb8ae6ab41ee960343cc64a0a9af95a5.tar.xz
apk-tools-e1a05c74cb8ae6ab41ee960343cc64a0a9af95a5.zip
prevent automatic repository index update for 'apk del'
ref #9063
Diffstat (limited to 'src/database.c')
-rw-r--r--src/database.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/database.c b/src/database.c
index db34ed3..70a1053 100644
--- a/src/database.c
+++ b/src/database.c
@@ -1519,7 +1519,9 @@ int apk_db_open(struct apk_database *db, struct apk_db_options *dbopts)
r = -1;
goto ret_r;
}
- if (dbopts->open_flags & APK_OPENF_WRITE) db->open_write = 1;
+ if ((dbopts->open_flags & APK_OPENF_WRITE) &&
+ !(dbopts->open_flags & APK_OPENF_NO_AUTOUPDATE))
+ db->autoupdate = 1;
if (!dbopts->cache_dir) dbopts->cache_dir = "etc/apk/cache";
apk_db_setup_repositories(db, dbopts->cache_dir);
@@ -2266,7 +2268,7 @@ int apk_db_add_repository(apk_database_t _db, apk_blob_t _repository)
r = apk_repo_format_real_url(db, repo, NULL, buf, sizeof(buf));
if (r == 0) apk_message("fetch %s", buf);
} else {
- if (db->open_write) apk_repository_update(db, repo);
+ if (db->autoupdate) apk_repository_update(db, repo);
r = apk_repo_format_cache_index(APK_BLOB_BUF(buf), repo);
}
} else {