#include "system.h"
#include <rpmio_internal.h>
#include <rpmbuild.h>
#include "debug.h"
Go to the source code of this file.
Data Structures | ||||
struct | tokenBits_s | |||
struct | optionalTag | |||
struct | PreambleRec_s | |||
Defines | ||||
#define | SINGLE_TOKEN_ONLY | |||
Typedefs | ||||
typedef tokenBits_s * | tokenBits | |||
typedef PreambleRec_s * | PreambleRec | |||
Functions | ||||
static void | addOrAppendListEntry (Header h, int_32 tag, char *line) | |||
static int | parseSimplePart (char *line, char **name, int *flag) | |||
static int | parseYesNo (const char *s) | |||
static int | parseBits (const char *s, const tokenBits tokbits, rpmsenseFlags *bp) | |||
static char * | findLastChar (char *s) | |||
static int | isMemberInEntry (Header h, const char *name, rpmTag tag) | |||
static int | checkForValidArchitectures (Spec spec) | |||
static int | checkForRequired (Header h, const char *NVR) | |||
Check that required tags are present in header. | ||||
static int | checkForDuplicates (Header h, const char *NVR) | |||
Check that no duplicate tags are present in header. | ||||
static void | fillOutMainPackage (Header h) | |||
static int | readIcon (Header h, const char *file) | |||
spectag | stashSt (Spec spec, Header h, int tag, const char *lang) | |||
| ||||
static int | handlePreambleTag (Spec spec, Package pkg, rpmTag tag, const char *macro, const char *lang) | |||
static void | initPreambleList (void) | |||
static int | findPreambleTag (Spec spec, rpmTag *tag, const char **macro, char *lang) | |||
int | parsePreamble (Spec spec, int initialPackage) | |||
Parse tags from preamble of a spec file. | ||||
Variables | ||||
static rpmTag | copyTagsDuringParse [] | |||
static rpmTag | requiredTags [] | |||
static struct tokenBits_s | installScriptBits [] | |||
static struct tokenBits_s | buildScriptBits [] | |||
static struct optionalTag | optionalTags [] | |||
int | noLang | |||
static struct PreambleRec_s | preambleList [] |
Definition in file parsePreamble.c.
#define SINGLE_TOKEN_ONLY |
Value:
if (multiToken) { \ rpmError(RPMERR_BADSPEC, _("line %d: Tag takes single token only: %s\n"), \ spec->lineNum, spec->line); \ return RPMERR_BADSPEC; \ }
Definition at line 449 of file parsePreamble.c.
Referenced by handlePreambleTag().
typedef struct PreambleRec_s * PreambleRec |
typedef struct tokenBits_s * tokenBits |
Definition at line 53 of file parsePreamble.c.
References _free(), argv, headerAddOrAppendEntry(), and RPM_STRING_ARRAY_TYPE.
Referenced by handlePreambleTag().
static int checkForDuplicates | ( | Header | h, | |
const char * | NVR | |||
) | [static] |
Check that no duplicate tags are present in header.
h | header | |
NVR | package name-version-release |
Definition at line 299 of file parsePreamble.c.
References _, headerFreeIterator(), headerInitIterator(), headerNextIterator(), RPMERR_BADSPEC, rpmError, and tagName().
Referenced by parsePreamble().
static int checkForRequired | ( | Header | h, | |
const char * | NVR | |||
) | [static] |
Check that required tags are present in header.
h | header | |
NVR | package name-version-release |
Definition at line 273 of file parsePreamble.c.
References _, headerIsEntry(), requiredTags, RPMERR_BADSPEC, rpmError, and tagName().
Referenced by parsePreamble().
static int checkForValidArchitectures | ( | Spec | spec | ) | [static] |
Definition at line 229 of file parsePreamble.c.
References _, Spec_s::buildRestrictions, isMemberInEntry(), RPMERR_BADSPEC, rpmError, rpmExpand(), rpmGetArchInfo(), rpmGetOsInfo(), RPMTAG_EXCLUDEARCH, RPMTAG_EXCLUDEOS, RPMTAG_EXCLUSIVEARCH, and RPMTAG_EXCLUSIVEOS.
Referenced by parsePreamble().
static void fillOutMainPackage | ( | Header | h | ) | [static] |
Definition at line 338 of file parsePreamble.c.
References _free(), headerAddEntry(), headerIsEntry(), optionalTags, optionalTag::ot_mac, optionalTag::ot_tag, RPM_STRING_TYPE, and rpmExpand().
Referenced by parsePreamble().
static char* findLastChar | ( | char * | s | ) | [inline, static] |
Definition at line 186 of file parsePreamble.c.
References xisspace().
Referenced by handlePreambleTag().
Definition at line 805 of file parsePreamble.c.
References _, initPreambleList(), PreambleRec_s::len, Spec_s::line, PreambleRec_s::obsolete, preambleList, RPMERR_BADSPEC, rpmError, PreambleRec_s::token, and xstrncasecmp().
Referenced by parsePreamble().
static int handlePreambleTag | ( | Spec | spec, | |
Package | pkg, | |||
rpmTag | tag, | |||
const char * | macro, | |||
const char * | lang | |||
) | [static] |
Definition at line 463 of file parsePreamble.c.
References _, _free(), addMacro(), addOrAppendListEntry(), addSource(), Package_s::autoProv, Package_s::autoReq, Spec_s::BACount, Spec_s::BANames, Spec_s::buildRestrictions, Spec_s::buildRootURL, buildScriptBits, delMacro(), findLastChar(), Spec_s::gotBuildRootURL, Package_s::header, headerAddEntry(), headerAddI18NString(), headerFreeData(), headerGetEntryMinMemory(), installScriptBits, Spec_s::line, Spec_s::lineNum, Spec_s::macros, noLang, Spec_s::noSource, parseBits(), parseNoSource(), parseNum(), parseRCPOT(), parseYesNo(), readIcon(), RMIL_OLDSPEC, RMIL_SPEC, Spec_s::rootURL, RPM_INT32_TYPE, RPM_STRING_TYPE, RPMBUILD_DEFAULT_LANG, RPMERR_BADSPEC, RPMERR_INTERNAL, rpmError, rpmGenPath(), RPMSENSE_ANY, RPMTAG_AUTOPROV, RPMTAG_AUTOREQ, RPMTAG_AUTOREQPROV, RPMTAG_BUILDARCHS, RPMTAG_BUILDCONFLICTS, RPMTAG_BUILDPREREQ, RPMTAG_BUILDREQUIRES, RPMTAG_BUILDROOT, RPMTAG_CONFLICTFLAGS, RPMTAG_CVSID, RPMTAG_DISTRIBUTION, RPMTAG_DISTTAG, RPMTAG_DOCDIR, RPMTAG_EPOCH, RPMTAG_EXCLUDEARCH, RPMTAG_EXCLUDEOS, RPMTAG_EXCLUSIVEARCH, RPMTAG_EXCLUSIVEOS, RPMTAG_GROUP, RPMTAG_ICON, RPMTAG_LICENSE, RPMTAG_NAME, RPMTAG_NOPATCH, RPMTAG_NOSOURCE, RPMTAG_OBSOLETEFLAGS, RPMTAG_PACKAGER, RPMTAG_PATCH, RPMTAG_PREFIXES, RPMTAG_PREREQ, RPMTAG_PROVIDEFLAGS, RPMTAG_RELEASE, RPMTAG_REQUIREFLAGS, RPMTAG_RHNPLATFORM, RPMTAG_SOURCE, RPMTAG_SUMMARY, RPMTAG_URL, RPMTAG_VENDOR, RPMTAG_VERSION, SINGLE_TOKEN_ONLY, SKIPNONSPACE, SKIPSPACE, stashSt(), tagName(), and urlPath().
Referenced by parsePreamble().
static void initPreambleList | ( | void | ) | [inline, static] |
Definition at line 793 of file parsePreamble.c.
References PreambleRec_s::len, preambleList, and PreambleRec_s::token.
Referenced by findPreambleTag().
Definition at line 206 of file parsePreamble.c.
References headerFreeData(), headerGetEntryMinMemory(), and xstrcasecmp().
Referenced by checkForValidArchitectures().
static int parseBits | ( | const char * | s, | |
const tokenBits | tokbits, | |||
rpmsenseFlags * | bp | |||
) | [static] |
Definition at line 149 of file parsePreamble.c.
References tokenBits_s::bits, tokenBits_s::name, RPMERR_BADSPEC, RPMSENSE_ANY, xisalpha(), and xisspace().
Referenced by handlePreambleTag().
static int parseSimplePart | ( | char * | line, | |
char ** | name, | |||
int * | flag | |||
) | [static] |
Definition at line 72 of file parsePreamble.c.
References PART_NAME, and PART_SUBNAME.
Referenced by parsePreamble().
static int parseYesNo | ( | const char * | s | ) | [inline, static] |
Definition at line 106 of file parsePreamble.c.
References xstrcasecmp().
Referenced by handlePreambleTag().
static int readIcon | ( | Header | h, | |
const char * | file | |||
) | [static] |
Definition at line 359 of file parsePreamble.c.
References _, _free(), Fclose(), fdSize(), Ferror(), Fopen(), Fread(), Fstrerror(), headerAddEntry(), RPM_BIN_TYPE, RPMERR_BADSPEC, rpmError, rpmGetPath(), RPMTAG_GIF, RPMTAG_XPM, and xmalloc().
Referenced by handlePreambleTag().
struct tokenBits_s buildScriptBits[] [static] |
Initial value:
{ { "prep", RPMSENSE_SCRIPT_PREP }, { "build", RPMSENSE_SCRIPT_BUILD }, { "install", RPMSENSE_SCRIPT_INSTALL }, { "clean", RPMSENSE_SCRIPT_CLEAN }, { NULL, 0 } }
Definition at line 138 of file parsePreamble.c.
Referenced by handlePreambleTag().
rpmTag copyTagsDuringParse[] [static] |
Initial value:
{ RPMTAG_EPOCH, RPMTAG_VERSION, RPMTAG_RELEASE, RPMTAG_LICENSE, RPMTAG_PACKAGER, RPMTAG_DISTRIBUTION, RPMTAG_DISTURL, RPMTAG_VENDOR, RPMTAG_ICON, RPMTAG_URL, RPMTAG_CHANGELOGTIME, RPMTAG_CHANGELOGNAME, RPMTAG_CHANGELOGTEXT, RPMTAG_PREFIXES, RPMTAG_RHNPLATFORM, RPMTAG_DISTTAG, RPMTAG_CVSID, 0 }
Definition at line 17 of file parsePreamble.c.
Referenced by parsePreamble().
struct tokenBits_s installScriptBits[] [static] |
Initial value:
{ { "interp", RPMSENSE_INTERP }, { "prereq", RPMSENSE_PREREQ }, { "preun", RPMSENSE_SCRIPT_PREUN }, { "pre", RPMSENSE_SCRIPT_PRE }, { "postun", RPMSENSE_SCRIPT_POSTUN }, { "post", RPMSENSE_SCRIPT_POST }, { "rpmlib", RPMSENSE_RPMLIB }, { "verify", RPMSENSE_SCRIPT_VERIFY }, { NULL, 0 } }
Definition at line 123 of file parsePreamble.c.
Referenced by handlePreambleTag().
struct optionalTag optionalTags[] [static] |
Referenced by fillOutMainPackage().
struct PreambleRec_s preambleList[] [static] |
Definition at line 741 of file parsePreamble.c.
Referenced by findPreambleTag(), and initPreambleList().
rpmTag requiredTags[] [static] |