summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2012-02-11 18:07:52 +1000
committerAllan McRae <allan@archlinux.org>2013-02-09 12:43:37 +1000
commit17d4ec5ed8d9b71df3dbd50cbc5f633bfd1b0404 (patch)
treee437390835e48888a397f4ae26f80d76644f6c27
parent711b6d39111347489e40c1a637c15b3d22f01d3d (diff)
downloadpacman-17d4ec5ed8d9b71df3dbd50cbc5f633bfd1b0404.tar.xz
Skip reading sync db deltas files if UseDelta is unset
Signed-off-by: Allan McRae <allan@archlinux.org>
-rw-r--r--lib/libalpm/be_sync.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libalpm/be_sync.c b/lib/libalpm/be_sync.c
index 36725251..92be9491 100644
--- a/lib/libalpm/be_sync.c
+++ b/lib/libalpm/be_sync.c
@@ -535,7 +535,7 @@ static int sync_db_read(alpm_db_t *db, struct archive *archive,
}
if(strcmp(filename, "desc") == 0 || strcmp(filename, "depends") == 0
- || strcmp(filename, "deltas") == 0) {
+ || (strcmp(filename, "deltas") == 0 && db->handle->deltaratio > 0.0) ) {
int ret;
while((ret = _alpm_archive_fgets(archive, &buf)) == ARCHIVE_OK) {
char *line = buf.line;
@@ -621,6 +621,8 @@ static int sync_db_read(alpm_db_t *db, struct archive *archive,
goto error;
}
*likely_pkg = pkg;
+ } else if(strcmp(filename, "deltas") == 0) {
+ /* skip reading delta files if UseDelta is unset */
} else if(strcmp(filename, "files") == 0) {
/* currently do nothing with this file */
} else {