From 9b876fff09f2af10cba6824bec03d8fe3e167b5b Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 28 Jan 2011 17:34:06 -0600 Subject: Ignore known but unused package descfile fields We explicitly place 'pkgbase' (and used to place 'force') fields inside PKGINFO files, so ignore them silently instead of printing an error for them. Also make the error message for unknown keys actually contain the key. Signed-off-by: Dan McGee --- lib/libalpm/be_package.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/libalpm') diff --git a/lib/libalpm/be_package.c b/lib/libalpm/be_package.c index c272bd47..fa757214 100644 --- a/lib/libalpm/be_package.c +++ b/lib/libalpm/be_package.c @@ -180,6 +180,8 @@ static int parse_descfile(struct archive *a, pmpkg_t *newpkg) if(strcmp(key, "pkgname") == 0) { STRDUP(newpkg->name, ptr, RET_ERR(PM_ERR_MEMORY, -1)); newpkg->name_hash = _alpm_hash_sdbm(newpkg->name); + } else if(strcmp(key, "pkgbase") == 0) { + /* not used atm */ } else if(strcmp(key, "pkgver") == 0) { STRDUP(newpkg->version, ptr, RET_ERR(PM_ERR_MEMORY, -1)); } else if(strcmp(key, "pkgdesc") == 0) { @@ -212,11 +214,13 @@ static int parse_descfile(struct archive *a, pmpkg_t *newpkg) newpkg->provides = alpm_list_add(newpkg->provides, strdup(ptr)); } else if(strcmp(key, "backup") == 0) { newpkg->backup = alpm_list_add(newpkg->backup, strdup(ptr)); + } else if(strcmp(key, "force") == 0) { + /* deprecated, skip it */ } else if(strcmp(key, "makepkgopt") == 0) { /* not used atm */ } else { - _alpm_log(PM_LOG_DEBUG, "%s: syntax error in description file line %d\n", - newpkg->name ? newpkg->name : "error", linenum); + _alpm_log(PM_LOG_DEBUG, "%s: unknown key '%s' in description file line %d\n", + newpkg->name ? newpkg->name : "error", key, linenum); } } line[0] = '\0'; -- cgit v1.2.3-24-g4f1b