Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/be_sync.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libalpm/be_sync.c')
-rw-r--r--lib/libalpm/be_sync.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/libalpm/be_sync.c b/lib/libalpm/be_sync.c
index 414a9f37..e1c76638 100644
--- a/lib/libalpm/be_sync.c
+++ b/lib/libalpm/be_sync.c
@@ -345,8 +345,17 @@ int _alpm_sync_db_read(pmdb_t *db, struct archive *archive, struct archive_entry
STRDUP(linedup, _alpm_strtrim(line), goto error);
pkg->replaces = alpm_list_add(pkg->replaces, linedup);
}
+ } else if(strcmp(line, "%EPOCH%") == 0) {
+ if(_alpm_archive_fgets(line, sizeof(line), archive) == NULL) {
+ goto error;
+ }
+ pkg->epoch = atoi(_alpm_strtrim(line));
} else if(strcmp(line, "%FORCE%") == 0) {
- pkg->force = 1;
+ /* For backward compatibility, treat force as a non-zero epoch
+ * but only if we didn't already have a known epoch value. */
+ if(!pkg->epoch) {
+ pkg->epoch = 1;
+ }
}
}
} else if(strcmp(filename, "depends") == 0) {