From 10336f101cd2798c8eb64335f8cc57baadea6454 Mon Sep 17 00:00:00 2001 From: jbj Date: Thu, 30 Sep 2004 20:18:40 +0000 Subject: [PATCH] - add Disttag: syntax to spec file parser and header content. - define Suggests:/Enhances: and Priority: tag values. CVS patchset: 7424 CVS date: 2004/09/30 20:18:40 --- CHANGES | 2 ++ build/parsePreamble.c | 13 +++++++++---- lib/rpmlib.h | 8 ++++++++ 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index a6541ae..55a8f7a 100644 --- a/CHANGES +++ b/CHANGES @@ -8,6 +8,8 @@ - add --all-name option (finds every lang file); drop defattr() from *.lang files (arekm,mkochano,pascalek,wiget@PLD). - add type to tag array. + - add Disttag: syntax to spec file parser and header content. + - define Suggests:/Enhances: and Priority: tag values. 4.3.1 -> 4.3.2: - use /etc/selinux/targeted/contexts/files/file_contexts for now. diff --git a/build/parsePreamble.c b/build/parsePreamble.c index 16d3b12..d14e2ce 100644 --- a/build/parsePreamble.c +++ b/build/parsePreamble.c @@ -30,6 +30,7 @@ static rpmTag copyTagsDuringParse[] = { RPMTAG_CHANGELOGTEXT, RPMTAG_PREFIXES, RPMTAG_RHNPLATFORM, + RPMTAG_DISTTAG, 0 }; @@ -458,8 +459,8 @@ extern int noLang; /** */ /*@-boundswrite@*/ -static int handlePreambleTag(Spec spec, Package pkg, int tag, const char *macro, - const char *lang) +static int handlePreambleTag(Spec spec, Package pkg, rpmTag tag, + const char *macro, const char *lang) /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies spec->macros, spec->st, spec->buildRootURL, spec->sources, spec->numSources, spec->noSource, @@ -513,6 +514,7 @@ static int handlePreambleTag(Spec spec, Package pkg, int tag, const char *macro, case RPMTAG_RELEASE: case RPMTAG_URL: case RPMTAG_RHNPLATFORM: + case RPMTAG_DISTTAG: SINGLE_TOKEN_ONLY; /* These macros are for backward compatibility */ if (tag == RPMTAG_VERSION) { @@ -775,6 +777,7 @@ static struct PreambleRec_s preambleList[] = { {RPMTAG_AUTOPROV, 0, 0, "autoprov"}, {RPMTAG_DOCDIR, 0, 0, "docdir"}, {RPMTAG_RHNPLATFORM, 0, 0, "rhnplatform"}, + {RPMTAG_DISTTAG, 0, 0, "disttag"}, /*@-nullassign@*/ /* LCL: can't add null annotation */ {0, 0, 0, 0} /*@=nullassign@*/ @@ -794,7 +797,7 @@ static inline void initPreambleList(void) /** */ /*@-boundswrite@*/ -static int findPreambleTag(Spec spec, /*@out@*/int * tag, +static int findPreambleTag(Spec spec, /*@out@*/rpmTag * tag, /*@null@*/ /*@out@*/ const char ** macro, /*@out@*/ char * lang) /*@modifies *tag, *macro, *lang @*/ { @@ -855,7 +858,7 @@ static int findPreambleTag(Spec spec, /*@out@*/int * tag, int parsePreamble(Spec spec, int initialPackage) { int nextPart; - int tag, rc, xx; + int rc, xx; char *name, *linep; int flag; Package pkg; @@ -897,6 +900,8 @@ int parsePreamble(Spec spec, int initialPackage) return rc; while (! (nextPart = isPart(spec->line))) { const char * macro; + rpmTag tag; + /* Skip blank lines */ linep = spec->line; SKIPSPACE(linep); diff --git a/lib/rpmlib.h b/lib/rpmlib.h index b7f6edc..d82a62e 100644 --- a/lib/rpmlib.h +++ b/lib/rpmlib.h @@ -429,6 +429,14 @@ typedef enum rpmTag_e { RPMTAG_POSTTRANS = 1152, /* s */ RPMTAG_PRETRANSPROG = 1153, /* s */ RPMTAG_POSTTRANSPROG = 1154, /* s */ + RPMTAG_DISTTAG = 1155, /* s */ + RPMTAG_SUGGESTSNAME = 1156, /* s[] extension placeholder */ + RPMTAG_SUGGESTSVERSION = 1157, /* s[] extension placeholder */ + RPMTAG_SUGGESTSFLAGS = 1158, /* i extension placeholder */ + RPMTAG_ENHANCESNAME = 1159, /* s[] extension placeholder */ + RPMTAG_ENHANCESVERSION = 1160, /* s[] extension placeholder */ + RPMTAG_ENHANCESFLAGS = 1161, /* i extension placeholder */ + RPMTAG_PRIORITY = 1162, /* i extension placeholder */ /*@-enummemuse@*/ RPMTAG_FIRSTFREE_TAG /*!< internal */ /*@=enummemuse@*/ -- 2.7.4