rpm  4.5
Data Structures | Macros | Typedefs | Functions | Variables
parsePreamble.c File Reference

Parse tags in global section from spec file. More...

#include "system.h"
#include <rpmio_internal.h>
#include <rpmbuild.h>
#include "debug.h"
Include dependency graph for parsePreamble.c:

Go to the source code of this file.

Data Structures

struct  tokenBits_s
 
struct  optionalTag
 
struct  PreambleRec_s
 

Macros

#define _RPMEVR_INTERNAL
 
#define SINGLE_TOKEN_ONLY
 

Typedefs

typedef struct tokenBits_stokenBits
 
typedef struct PreambleRec_sPreambleRec
 

Functions

static void addOrAppendListEntry (Header h, int_32 tag, char *line)
 
static int parseSimplePart (char *line, char **name, rpmParseState *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. More...
 
static int checkForDuplicates (Header h, const char *NVR)
 Check that no duplicate tags are present in header. More...
 
static void fillOutMainPackage (Header h)
 
static int doIcon (Spec spec, Header h)
 
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 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. More...
 

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 []
 

Detailed Description

Parse tags in global section from spec file.

Definition in file parsePreamble.c.

Macro Definition Documentation

#define _RPMEVR_INTERNAL

Definition at line 9 of 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 477 of file parsePreamble.c.

Referenced by handlePreambleTag().

Typedef Documentation

typedef struct PreambleRec_s * PreambleRec
typedef struct tokenBits_s * tokenBits

Function Documentation

static void addOrAppendListEntry ( Header  h,
int_32  tag,
char *  line 
)
static

Definition at line 60 of file parsePreamble.c.

References _free(), 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.

Parameters
hheader
NVRpackage name-version-release
Returns
0 if OK

Definition at line 297 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.

Parameters
hheader
NVRpackage name-version-release
Returns
0 if OK

Definition at line 271 of file parsePreamble.c.

References _, headerIsEntry(), requiredTags, RPMERR_BADSPEC, rpmError, and tagName().

Referenced by parsePreamble().

static int checkForValidArchitectures ( Spec  spec)
static
static int doIcon ( Spec  spec,
Header  h 
)
static
static void fillOutMainPackage ( Header  h)
static
static char* findLastChar ( char *  s)
inlinestatic

Definition at line 195 of file parsePreamble.c.

Referenced by handlePreambleTag().

static int findPreambleTag ( Spec  spec,
rpmTag tag,
const char **  macro,
char *  lang 
)
static
static int handlePreambleTag ( Spec  spec,
Package  pkg,
rpmTag  tag,
const char *  macro,
const char *  lang 
)
static

Definition at line 491 of file parsePreamble.c.

References _, _free(), addMacro(), addOrAppendListEntry(), addSource(), Package_s::autoProv, Package_s::autoReq, Spec_s::BACount, Spec_s::BANames, delMacro(), doIcon(), findLastChar(), Package_s::header, headerAddEntry(), headerAddI18NString(), headerFreeData(), headerGetEntryMinMemory(), Spec_s::line, Spec_s::lineNum, Spec_s::macros, noLang, Spec_s::noSource, Source::num, parseBits(), parseNoSource(), parseNum(), parseRCPOT(), parseYesNo(), 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_BUILDENHANCES, RPMTAG_BUILDOBSOLETES, RPMTAG_BUILDPLATFORMS, RPMTAG_BUILDPREREQ, RPMTAG_BUILDPROVIDES, RPMTAG_BUILDREQUIRES, RPMTAG_BUILDROOT, RPMTAG_BUILDSUGGESTS, RPMTAG_CONFLICTFLAGS, RPMTAG_CVSID, RPMTAG_DISTRIBUTION, RPMTAG_DISTTAG, RPMTAG_DOCDIR, RPMTAG_ENHANCESFLAGS, RPMTAG_EPOCH, RPMTAG_EXCLUDEARCH, RPMTAG_EXCLUDEOS, RPMTAG_EXCLUSIVEARCH, RPMTAG_EXCLUSIVEOS, RPMTAG_GROUP, RPMTAG_ICON, RPMTAG_KEYWORDS, RPMTAG_LICENSE, RPMTAG_NAME, RPMTAG_NOPATCH, RPMTAG_NOSOURCE, RPMTAG_OBSOLETEFLAGS, RPMTAG_PACKAGER, RPMTAG_PATCH, RPMTAG_PREFIXES, RPMTAG_PREREQ, RPMTAG_PROVIDEFLAGS, RPMTAG_RELEASE, RPMTAG_REPOTAG, RPMTAG_REQUIREFLAGS, RPMTAG_SOURCE, RPMTAG_SUGGESTSFLAGS, RPMTAG_SUMMARY, RPMTAG_URL, RPMTAG_VARIANTS, RPMTAG_VENDOR, RPMTAG_VERSION, RPMTAG_XMAJOR, RPMTAG_XMINOR, SINGLE_TOKEN_ONLY, SKIPNONSPACE, SKIPSPACE, Spec_s::sourceHeader, stashSt(), tagName(), and urlPath().

Referenced by parsePreamble().

static int isMemberInEntry ( Header  h,
const char *  name,
rpmTag  tag 
)
static

Definition at line 211 of file parsePreamble.c.

References headerFreeData(), headerGetEntryMinMemory(), and xstrcasecmp().

Referenced by checkForValidArchitectures().

static int parseBits ( const char *  s,
const tokenBits  tokbits,
rpmsenseFlags bp 
)
static
static int parseSimplePart ( char *  line,
char **  name,
rpmParseState flag 
)
static

Definition at line 79 of file parsePreamble.c.

References PART_NAME, and PART_SUBNAME.

Referenced by parsePreamble().

static int parseYesNo ( const char *  s)
inlinestatic

Definition at line 114 of file parsePreamble.c.

References xstrcasecmp().

Referenced by handlePreambleTag().

Variable Documentation

struct tokenBits_s buildScriptBits[]
static
Initial value:
= {
{ "prep", RPMSENSE_SCRIPT_PREP },
{ "build", RPMSENSE_SCRIPT_BUILD },
{ "install", RPMSENSE_SCRIPT_INSTALL },
{ "clean", RPMSENSE_SCRIPT_CLEAN },
{ "hint", RPMSENSE_MISSINGOK },
{ NULL, 0 }
}

Definition at line 146 of file parsePreamble.c.

rpmTag copyTagsDuringParse[]
static
struct tokenBits_s installScriptBits[]
static
Initial value:
= {
{ "interp", RPMSENSE_INTERP },
{ "preun", RPMSENSE_SCRIPT_PREUN },
{ "pre", RPMSENSE_SCRIPT_PRE },
{ "postun", RPMSENSE_SCRIPT_POSTUN },
{ "post", RPMSENSE_SCRIPT_POST },
{ "rpmlib", RPMSENSE_RPMLIB },
{ "verify", RPMSENSE_SCRIPT_VERIFY },
{ "hint", RPMSENSE_MISSINGOK },
{ NULL, 0 }
}

Definition at line 131 of file parsePreamble.c.

int noLang

Definition at line 52 of file poptBT.c.

struct optionalTag optionalTags[]
static
Initial value:
= {
{ RPMTAG_VENDOR, "%{vendor}" },
{ RPMTAG_PACKAGER, "%{packager}" },
{ RPMTAG_DISTRIBUTION, "%{distribution}" },
{ RPMTAG_DISTURL, "%{disturl}" },
{ -1, NULL }
}

Referenced by fillOutMainPackage().

struct PreambleRec_s preambleList[]
static

Definition at line 772 of file parsePreamble.c.

rpmTag requiredTags[]
static
Initial value:

Definition at line 48 of file parsePreamble.c.

Referenced by checkForRequired().