From dbec3664232852425d9e966058cb02e6c5f6689c Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Mon, 29 Mar 2010 09:35:25 +0300 Subject: [PATCH] Oops, being a bit too strict on dependency qualifiers - Forgot how nasty hack parseBits() was... its abusing multilang support and the multilang support passes "C" if no lang is specified, which certainly isn't a valid qualifier. Make multilang vs tag with optional qualifiers different types in PreambleRec, which allows handling this more sanely - Additionally build-dependencies dont take any qualifiers now --- build/parsePreamble.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/build/parsePreamble.c b/build/parsePreamble.c index eb6385a..1a0e79d 100644 --- a/build/parsePreamble.c +++ b/build/parsePreamble.c @@ -685,7 +685,7 @@ static int handlePreambleTag(rpmSpec spec, Package pkg, rpmTag tag, */ typedef const struct PreambleRec_s { rpmTag tag; - int multiLang; + int type; int deprecated; size_t len; const char * token; @@ -716,8 +716,8 @@ static struct PreambleRec_s const preambleList[] = { {RPMTAG_EXCLUSIVEOS, 0, 0, LEN_AND_STR("exclusiveos")}, {RPMTAG_ICON, 0, 0, LEN_AND_STR("icon")}, {RPMTAG_PROVIDEFLAGS, 0, 0, LEN_AND_STR("provides")}, - {RPMTAG_REQUIREFLAGS, 1, 0, LEN_AND_STR("requires")}, - {RPMTAG_PREREQ, 1, 1, LEN_AND_STR("prereq")}, + {RPMTAG_REQUIREFLAGS, 2, 0, LEN_AND_STR("requires")}, + {RPMTAG_PREREQ, 2, 1, LEN_AND_STR("prereq")}, {RPMTAG_CONFLICTFLAGS, 0, 0, LEN_AND_STR("conflicts")}, {RPMTAG_OBSOLETEFLAGS, 0, 0, LEN_AND_STR("obsoletes")}, {RPMTAG_PREFIXES, 0, 0, LEN_AND_STR("prefixes")}, @@ -726,8 +726,8 @@ static struct PreambleRec_s const preambleList[] = { {RPMTAG_BUILDARCHS, 0, 0, LEN_AND_STR("buildarchitectures")}, {RPMTAG_BUILDARCHS, 0, 0, LEN_AND_STR("buildarch")}, {RPMTAG_BUILDCONFLICTS, 0, 0, LEN_AND_STR("buildconflicts")}, - {RPMTAG_BUILDPREREQ, 1, 1, LEN_AND_STR("buildprereq")}, - {RPMTAG_BUILDREQUIRES, 1, 0, LEN_AND_STR("buildrequires")}, + {RPMTAG_BUILDPREREQ, 0, 1, LEN_AND_STR("buildprereq")}, + {RPMTAG_BUILDREQUIRES, 0, 0, LEN_AND_STR("buildrequires")}, {RPMTAG_AUTOREQPROV, 0, 0, LEN_AND_STR("autoreqprov")}, {RPMTAG_AUTOREQ, 0, 0, LEN_AND_STR("autoreq")}, {RPMTAG_AUTOPROV, 0, 0, LEN_AND_STR("autoprov")}, @@ -760,7 +760,7 @@ static int findPreambleTag(rpmSpec spec,rpmTag * tag, s = spec->line + p->len; SKIPSPACE(s); - switch (p->multiLang) { + switch (p->type) { default: case 0: /* Unless this is a source or a patch, a ':' better be next */ @@ -770,8 +770,10 @@ static int findPreambleTag(rpmSpec spec,rpmTag * tag, *lang = '\0'; break; case 1: /* Parse optional ( ). */ + case 2: if (*s == ':') { - strcpy(lang, RPMBUILD_DEFAULT_LANG); + /* Type 1 is multilang, 2 is qualifiers with no defaults */ + strcpy(lang, (p->type == 1) ? RPMBUILD_DEFAULT_LANG : ""); break; } if (*s != '(') return 1; -- 2.7.4