From feb9889f22639c214606dcb387af6d0a51ea5e85 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 8 Oct 2010 08:39:23 -0500 Subject: Add epoch support to pacman/libalpm This will allow for better control of what was previously the 'force' option in a PKGBUILD and transferred into the built package. Signed-off-by: Dan McGee --- lib/libalpm/be_sync.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lib/libalpm/be_sync.c') 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) { -- cgit v1.2.3