rpm  5.4.14
Files | Data Structures | Macros | Typedefs | Enumerations | Functions
RPMBUILD.
Collaboration diagram for RPMBUILD.:

Files

file  build.c
 Top-level build dispatcher.
 
file  buildio.h
 Routines to read and write packages.
 
file  expression.c
 Simple logical expression parser.
 
file  files.c
 The post-build, pre-packaging file tree walk to assemble the package manifest.
 
file  misc.c
 
file  names.c
 Simple user/group name/id cache (plus hostname and buildtime)
 
file  pack.c
 Assemble components of an RPM package.
 
file  parseBuildInstallClean.c
 Parse build/install/clean section from spec file.
 
file  parseChangelog.c
 Parse changelog section from spec file.
 
file  parseDescription.c
 Parse description section from spec file.
 
file  parseFiles.c
 Parse files section from spec file.
 
file  parsePreamble.c
 Parse tags in global section from spec file.
 
file  parsePrep.c
 Parse prep section from spec file.
 
file  parseReqs.c
 Parse dependency tag from spec file or from auto-dependency generator.
 
file  parseScript.c
 Parse install-time script section from spec file.
 
file  parseSpec.c
 Top level dispatcher for spec file parsing.
 
file  reqprov.c
 Add dependency tags to package header(s).
 
file  rpmbuild.h
 This is the only module users of librpmbuild should need to include.
 
file  rpmspec.h
 The Spec and Package data structures used during build.
 
file  spec.c
 Handle spec data structure.
 
file  rpmcli.h
 

Data Structures

struct  TriggerFileEntry
 
struct  Source
 
struct  ReadLevelEntry
 
struct  OpenFileInfo
 
struct  spectag_s
 
struct  spectags_s
 
struct  speclines_s
 
struct  Spec_s
 The structure used to store values parsed from a spec file. More...
 
struct  Package_s
 The structure used to store values for a package. More...
 

Macros

#define PART_BASE   100
 Spec file parser states. More...
 

Typedefs

typedef enum rpmBuildFlags_e rpmBuildFlags
 Bit(s) to control buildSpec() operation. More...
 
typedef enum rpmStripFlags_e rpmStripFlags
 Spec file parser stripping flags. More...
 
typedef struct Package_sPackage
 
typedef struct SourceSpecSource
 
typedef struct ReadLevelEntry RLE_t
 
typedef struct OpenFileInfo OFI_t
 
typedef struct spectag_sspectag
 
typedef struct spectags_sspectags
 
typedef struct speclines_sspeclines
 
typedef struct Spec_sSpec
 

Enumerations

enum  rpmBuildFlags_e {
  RPMBUILD_NONE = 0, RPMBUILD_PREP = (1 << 0), RPMBUILD_BUILD = (1 << 1), RPMBUILD_INSTALL = (1 << 2),
  RPMBUILD_CHECK = (1 << 3), RPMBUILD_CLEAN = (1 << 4), RPMBUILD_FILECHECK = (1 << 5), RPMBUILD_PACKAGESOURCE = (1 << 6),
  RPMBUILD_PACKAGEBINARY = (1 << 7), RPMBUILD_RMSOURCE = (1 << 8), RPMBUILD_RMBUILD = (1 << 9), RPMBUILD_STRINGBUF = (1 << 10),
  RPMBUILD_TRACK = (1 << 11), RPMBUILD_RMSPEC = (1 << 12), RPMBUILD_FETCHSOURCE = (1 << 13)
}
 Bit(s) to control buildSpec() operation. More...
 
enum  rpmStripFlags_e { STRIP_NOTHING = 0, STRIP_TRAILINGSPACE = (1 << 0), STRIP_COMMENTS = (1 << 1), STRIP_NOEXPAND = (1 << 2) }
 Spec file parser stripping flags. More...
 

Functions

void freeNames (void)
 Destroy uid/gid caches. More...
 
const char * getUname (uid_t uid)
 Return cached user name from user id. More...
 
const char * getUnameS (const char *uname)
 Return cached user name. More...
 
uid_t getUidS (const char *uname)
 Return cached user id. More...
 
const char * getGname (gid_t gid)
 Return cached group name from group id. More...
 
const char * getGnameS (const char *gname)
 Return cached group name. More...
 
gid_t getGidS (const char *gname)
 Return cached group id. More...
 
const char * buildHost (void)
 Return build hostname. More...
 
rpmuint32_tgetBuildTime (void)
 Return build time stamp. More...
 
int readLine (Spec spec, rpmStripFlags strip)
 Read next line from spec file. More...
 
void closeSpec (Spec spec)
 Stop reading from spec file, freeing resources. More...
 
void handleComments (char *s)
 Truncate comment lines. More...
 
rpmParseState isPart (Spec spec)
 Check line for section separator, return next parser state. More...
 
int parseNum (const char *line, rpmuint32_t *res)
 Parse a number. More...
 
void addChangelogEntry (Header h, time_t time, const char *name, const char *text)
 Add changelog entry to header. More...
 
int parseBuildInstallClean (Spec spec, rpmParseState parsePart)
 Parse %build/%install/%clean section(s) of a spec file. More...
 
int parseChangelog (Spec spec)
 Parse %changelog section of a spec file. More...
 
int parseDescription (Spec spec)
 Parse %description section of a spec file. More...
 
int parseFiles (Spec spec)
 Parse %files section of a spec file. More...
 
int parsePreamble (Spec spec, int initialPackage)
 Parse tags from preamble of a spec file. More...
 
int parsePrep (Spec spec, int verify)
 Parse %prep section of a spec file. More...
 
rpmRC parseRCPOT (Spec spec, Package pkg, const char *field, rpmTag tagN, rpmuint32_t index, rpmsenseFlags tagflags)
 Parse dependency relations from spec file and/or autogenerated output buffer. More...
 
int parseScript (Spec spec, int parsePart)
 Parse %pre et al scriptlets from a spec file. More...
 
int parseExpressionBoolean (Spec spec, const char *expr)
 Evaluate boolean expression. More...
 
char * parseExpressionString (Spec spec, const char *expr)
 Evaluate string expression. More...
 
rpmRC doScript (Spec spec, int what, const char *name, rpmiob iob, int test)
 Run a build script, assembled from spec file scriptlet section. More...
 
rpmRC lookupPackage (Spec spec, const char *name, int flag, Package *pkg)
 Find sub-package control structure by name. More...
 
Package freePackages (Package packages)
 Destroy all packages associated with spec file. More...
 
Package freePackage (Package pkg)
 Destroy a package control structure. More...
 
Package newPackage (Spec spec)
 Create and initialize package control structure. More...
 
int addReqProv (Spec spec, Header h, rpmTag tagN, const char *N, const char *EVR, rpmsenseFlags Flags, rpmuint32_t index)
 Add dependency to header, filtering duplicates. More...
 
int rpmlibNeedsFeature (Header h, const char *feature, const char *featureEVR)
 Add rpmlib feature dependency. More...
 
rpmRC processBinaryFiles (Spec spec, int installSpecialDoc, int test)
 Post-build processing for binary package(s). More...
 
int initSourceHeader (Spec spec, rpmiob *sfp)
 Create and initialize header for source package. More...
 
int processSourceFiles (Spec spec)
 Post-build processing for source package. More...
 
int parseSpec (rpmts ts, const char *specFile, const char *rootURL, int recursing, const char *passPhrase, const char *cookie, int anyarch, int force, int verify)
 Parse spec file into spec control structure. More...
 
rpmRC buildSpec (rpmts ts, Spec spec, int what, int test)
 Build stages state machine driver. More...
 
rpmRC packageBinaries (Spec spec)
 Generate binary package(s). More...
 
rpmRC packageSources (Spec spec)
 Generate source package. More...
 
Spec freeSpec (Spec spec)
 Destroy a spec file control structure. More...
 
Spec newSpec (void)
 Create and initialize Spec structure. More...
 
int rpmspecQuery (rpmts ts, QVA_t qva, const char *arg)
 Function to query spec file(s). More...
 
struct OpenFileInfonewOpenFileInfo (void)
 
spectag stashSt (Spec spec, Header h, rpmTag tag, const char *lang)
 stashSt. More...
 
int addSource (Spec spec, Package pkg, const char *field, rpmTag tag)
 addSource. More...
 
int parseNoSource (Spec spec, const char *field, rpmTag tag)
 parseNoSource. More...
 
int SpecSourceCount (Spec spec)
 Return the count of source set in specfile. More...
 
SpecSource getSource (Spec spec, int num)
 Return a source control structure. More...
 
const char * specSourceName (SpecSource source)
 Return a ptr to the source file name. More...
 
const char * specFullSourceName (SpecSource source)
 Return a ptr to the full url of the source. More...
 
int specSourceNum (SpecSource source)
 Return the spec or source patch number. More...
 
int specSourceFlags (SpecSource source)
 Return flags set for the source. More...
 
const char * getSourceDir (rpmfileAttrs attr)
 Return the macro directory location from source file flags. More...
 

Detailed Description

Macro Definition Documentation

#define PART_BASE   100

Spec file parser states.

Definition at line 55 of file rpmbuild.h.

Typedef Documentation

typedef struct OpenFileInfo OFI_t
typedef struct Package_s* Package

Definition at line 20 of file rpmspec.h.

typedef struct ReadLevelEntry RLE_t

Bit(s) to control buildSpec() operation.

Spec file parser stripping flags.

typedef struct Spec_s* Spec

Definition at line 23 of file rpmtypes.h.

typedef struct speclines_s * speclines
typedef struct Source* SpecSource

Definition at line 24 of file rpmspec.h.

typedef struct spectag_s * spectag
typedef struct spectags_s * spectags

Enumeration Type Documentation

Bit(s) to control buildSpec() operation.

Enumerator
RPMBUILD_NONE 
RPMBUILD_PREP 

Execute %prep.

RPMBUILD_BUILD 

Execute %build.

RPMBUILD_INSTALL 

Execute %install.

RPMBUILD_CHECK 

Execute %check.

RPMBUILD_CLEAN 

Execute %clean.

RPMBUILD_FILECHECK 

Check %files manifest.

RPMBUILD_PACKAGESOURCE 

Create source package.

RPMBUILD_PACKAGEBINARY 

Create binary package(s).

RPMBUILD_RMSOURCE 

Remove source(s) and patch(s).

RPMBUILD_RMBUILD 

Remove build sub-tree.

RPMBUILD_STRINGBUF 

only for doScript()

RPMBUILD_TRACK 

Execute %track.

RPMBUILD_RMSPEC 

Remove spec file.

RPMBUILD_FETCHSOURCE 

Fetch source(s) and patch(s).

Definition at line 25 of file rpmbuild.h.

Spec file parser stripping flags.

Enumerator
STRIP_NOTHING 
STRIP_TRAILINGSPACE 
STRIP_COMMENTS 
STRIP_NOEXPAND 

Definition at line 89 of file rpmbuild.h.

Function Documentation

void addChangelogEntry ( Header  h,
time_t  time,
const char *  name,
const char *  text 
)

Add changelog entry to header.

Todo:
addChangelogEntry should be static.
Parameters
hheader
timetime of change
nameperson who made the change
textdescription of change

Definition at line 20 of file parseChangelog.c.

References alloca(), _HE_s::append, rpmDataType_u::argv, _HE_s::c, headerPut(), memset(), name, _HE_s::p, RPM_STRING_ARRAY_TYPE, RPM_UINT32_TYPE, RPMTAG_CHANGELOGNAME, RPMTAG_CHANGELOGTEXT, RPMTAG_CHANGELOGTIME, _HE_s::t, _HE_s::tag, rpmDataType_u::ui32p, and xx.

Referenced by addChangelog().

int addReqProv ( Spec  spec,
Header  h,
rpmTag  tagN,
const char *  N,
const char *  EVR,
rpmsenseFlags  Flags,
rpmuint32_t  index 
)

Add dependency to header, filtering duplicates.

Parameters
specspec file control structure
hheader
tagNtag, identifies type of dependency
N(e.g. Requires: foo < 0:1.2-3, "foo")
EVR(e.g. Requires: foo < 0:1.2-3, "0:1.2-3")
Flags(e.g. Requires: foo < 0:1.2-3, both "Requires:" and "<")
index(0 always)
Returns
0 always

Definition at line 14 of file reqprov.c.

References _free(), alloca(), _HE_s::append, rpmDataType_u::argv, _HE_s::c, EVR, flags, Flags, headerGet(), headerMod(), headerPut(), headerSprintf(), len, memset(), N, NULL, _HE_s::p, RPM_STRING_ARRAY_TYPE, RPM_UINT32_TYPE, rpmEVRfree(), rpmEVRnew(), rpmEVRoverlap(), rpmEVRparse(), RPMSENSE_EQUAL, RPMSENSE_SENSEMASK, RPMTAG_CONFLICTFLAGS, RPMTAG_CONFLICTNAME, RPMTAG_CONFLICTVERSION, RPMTAG_OBSOLETEFLAGS, RPMTAG_OBSOLETENAME, RPMTAG_OBSOLETEVERSION, RPMTAG_PROVIDEFLAGS, RPMTAG_PROVIDENAME, RPMTAG_PROVIDEVERSION, RPMTAG_REQUIREFLAGS, RPMTAG_REQUIRENAME, RPMTAG_REQUIREVERSION, RPMTAG_TRIGGERFLAGS, RPMTAG_TRIGGERINDEX, RPMTAG_TRIGGERNAME, RPMTAG_TRIGGERVERSION, strcmp(), _HE_s::t, _HE_s::tag, rpmDataType_u::ui32p, and xx.

Referenced by parseRCPOT(), parseScript(), and rpmlibNeedsFeature().

int addSource ( Spec  spec,
Package  pkg,
const char *  field,
rpmTag  tag 
)
const char* buildHost ( void  )

Return build hostname.

Returns
build hostname

Definition at line 206 of file names.c.

References _, rpmlog(), RPMLOG_WARNING, strncpy(), and void.

Referenced by rpmlibMarkers(), and writeRPM().

rpmRC buildSpec ( rpmts  ts,
Spec  spec,
int  what,
int  test 
)
void closeSpec ( Spec  spec)

Stop reading from spec file, freeing resources.

Parameters
specspec file control structure

Definition at line 487 of file parseSpec.c.

References _free(), Fclose(), OpenFileInfo::fd, OpenFileInfo::fileName, Spec_s::fileStack, OpenFileInfo::next, and void.

Referenced by parseSpec(), and specFini().

rpmRC doScript ( Spec  spec,
int  what,
const char *  name,
rpmiob  iob,
int  test 
)

Run a build script, assembled from spec file scriptlet section.

Parameters
specspec file control structure
whattype of script
namename of scriptlet section
ioblines that compose script body
testdon't execute scripts or package if testing
Returns
RPMRC_OK on success, RPMRC_FAIL on failure

Definition at line 89 of file build.c.

References alloca(), argv, fd, i, ix, memset(), NULL, op, Spec_s::prep, rc, Spec_s::rootURL, RPMBUILD_PREP, rpmGenPath(), RPMSCRIPT_PREP, status, and u.

Referenced by buildSpec(), and processPackageFiles().

void freeNames ( void  )

Destroy uid/gid caches.

Definition at line 32 of file names.c.

References _free(), gid_used, gnames, uid_used, and unames.

Referenced by main().

Package freePackage ( Package  pkg)

Destroy a package control structure.

Todo:
Rename to pkgFree.
Parameters
pkgpackage control structure
Returns
NULL on last dereference

Referenced by freePackages().

Package freePackages ( Package  packages)

Destroy all packages associated with spec file.

Parameters
packagespackage control structure chain
Returns
NULL

Definition at line 241 of file spec.c.

References freePackage(), Package_s::next, NULL, and p.

Referenced by parsePreamble(), and specFini().

Spec freeSpec ( Spec  spec)

Destroy a spec file control structure.

Todo:
Rename to specFree.
Parameters
specspec file control structure
Returns
NULL on last dereference

Referenced by _spec_free(), _specQuery(), parseSpec(), and specFini().

rpmuint32_t* getBuildTime ( void  )

Return build time stamp.

Returns
build time stamp

Definition at line 197 of file names.c.

References NULL.

Referenced by rpmlibMarkers(), and writeRPM().

gid_t getGidS ( const char *  gname)

Return cached group id.

Todo:
Implement using hash.
Parameters
gnamegroup name
Returns
cached gid

Definition at line 170 of file names.c.

References _, gid_used, gids, gnames, NULL, rpmlog(), RPMLOG_CRIT, strcmp(), and xstrdup().

const char* getGname ( gid_t  gid)

Return cached group name from group id.

Todo:
Implement using hash.
Parameters
gidgroup id
Returns
cached group name

Definition at line 119 of file names.c.

References _, gid_used, gids, gnames, NULL, rpmlog(), RPMLOG_CRIT, and xstrdup().

Referenced by addFile(), checkOwners(), and processSourceFiles().

const char* getGnameS ( const char *  gname)

Return cached group name.

Todo:
Implement using hash.
Parameters
gnamegroup name
Returns
cached group name

Definition at line 143 of file names.c.

References _, gid_used, gids, gnames, NULL, rpmlog(), RPMLOG_CRIT, strcmp(), and xstrdup().

Referenced by addFile(), and processSourceFiles().

SpecSource getSource ( Spec  spec,
int  num 
)

Return a source control structure.

Parameters
specspec file control structure
numthe number of the wanted source (starting from 0)
Returns
a SpecSource structure, NULL if not found

Definition at line 275 of file spec.c.

References i, Source::next, NULL, Source::num, p, and Spec_s::sources.

const char* getSourceDir ( rpmfileAttrs  attr)

Return the macro directory location from source file flags.

Parameters
attrrpmfileAttrs from source
Returns
string containings macros about location, NULL on failure

Definition at line 24 of file build.c.

References _free(), F_OK, fn, NULL, RPMFILE_ICON, RPMFILE_PATCH, RPMFILE_SOURCE, and rpmGetPath().

Referenced by addSource(), doRmSource(), doUntar(), initSourceHeader(), and prepFetch().

uid_t getUidS ( const char *  uname)

Return cached user id.

Todo:
Implement using hash.
Parameters
unameuser name
Returns
cached uid

Definition at line 92 of file names.c.

References _, NULL, rpmlog(), RPMLOG_CRIT, strcmp(), uid_used, uids, unames, and xstrdup().

const char* getUname ( uid_t  uid)

Return cached user name from user id.

Todo:
Implement using hash.
Parameters
uiduser id
Returns
cached user name

Definition at line 41 of file names.c.

References _, NULL, rpmlog(), RPMLOG_CRIT, uid_used, uids, unames, and xstrdup().

Referenced by addFile(), checkOwners(), and processSourceFiles().

const char* getUnameS ( const char *  uname)

Return cached user name.

Todo:
Implement using hash.
Parameters
unameuser name
Returns
cached user name

Definition at line 65 of file names.c.

References _, NULL, rpmlog(), RPMLOG_CRIT, strcmp(), uid_used, uids, unames, and xstrdup().

Referenced by addFile(), and processSourceFiles().

void handleComments ( char *  s)

Truncate comment lines.

Parameters
sskip white space, truncate line at '#'

Definition at line 142 of file parseSpec.c.

References SKIPSPACE.

Referenced by copyNextLineFinish(), and processPackageFiles().

int initSourceHeader ( Spec  spec,
rpmiob sfp 
)

Create and initialize header for source package.

Parameters
specspec file control structure
Return values
*sfpsrpm file list (may be NULL)
Returns
0 always

Definition at line 2566 of file files.c.

References _free(), alloca(), _HE_s::append, rpmDataType_u::argv, Spec_s::BACount, Spec_s::BANames, _HE_s::c, Source::flags, Spec_s::foo, getSourceDir(), Package_s::header, HEADER_I18NTABLE, headerFini(), headerInit(), headerIsEntry(), headerNext(), headerPut(), i, memset(), Source::next, Spec_s::nfoo, NULL, Source::num, _HE_s::p, Spec_s::packages, rpmDataType_u::ptr, RPM_STRING_ARRAY_TYPE, RPM_STRING_TYPE, RPM_UINT32_TYPE, rpmExpand(), RPMFILE_GHOST, RPMFILE_PATCH, RPMFILE_SOURCE, rpmGetPath(), rpmiobAppend(), rpmiobFree(), rpmiobNew(), rpmiobStr(), RPMTAG_ARCH, RPMTAG_BUGURL, RPMTAG_BUILDARCHS, RPMTAG_CHANGELOGNAME, RPMTAG_CHANGELOGTEXT, RPMTAG_CHANGELOGTIME, RPMTAG_DESCRIPTION, RPMTAG_DISTEPOCH, RPMTAG_DISTRIBUTION, RPMTAG_DISTURL, RPMTAG_EPOCH, RPMTAG_GIF, RPMTAG_GROUP, RPMTAG_ICON, RPMTAG_LICENSE, RPMTAG_NAME, RPMTAG_NOPATCH, RPMTAG_NOSOURCE, RPMTAG_OS, RPMTAG_PACKAGER, RPMTAG_PATCH, RPMTAG_PROVIDEFLAGS, RPMTAG_PROVIDENAME, RPMTAG_PROVIDEVERSION, RPMTAG_RELEASE, RPMTAG_SOURCE, RPMTAG_SUMMARY, RPMTAG_URL, RPMTAG_VENDOR, RPMTAG_VERSION, RPMTAG_XPM, s, Source::source, Spec_s::sourceHdrInit, Spec_s::sourceHeader, Spec_s::sources, Spec_s::specFile, rpmDataType_u::str, _HE_s::t, _HE_s::tag, tag, tagValue(), rpmDataType_u::ui32p, xstrcasecmp(), and xx.

Referenced by _specQuery(), and processSourceFiles().

rpmParseState isPart ( Spec  spec)

Check line for section separator, return next parser state.

Parameters
specspec file control structure
Returns
next parser state

Definition at line 64 of file parseSpec.c.

References _free(), argvSearch(), argvStrcasecmp(), av, c, exit, Spec_s::foo, initParts(), PartRec::len, len, Spec_s::line, Spec_s::nfoo, NULL, p, PartRec::part, PART_ARBITRARY, PART_NONE, partList, rpmTags, s, tagCanonicalize(), tagGenerate(), tagName(), PartRec::token, void, xisspace(), xrealloc, xstrdup(), and xstrncasecmp().

Referenced by parseBuildInstallClean(), parseChangelog(), parseDescription(), parseFiles(), parsePreamble(), parsePrep(), and parseScript().

rpmRC lookupPackage ( Spec  spec,
const char *  name,
int  flag,
Package pkg 
)

Find sub-package control structure by name.

Parameters
specspec file control structure
name(sub-)package name
flagif PART_SUBNAME, then 1st package name is prepended
Return values
pkgpackage control structure
Returns
RPMRC_OK on success

Definition at line 78 of file spec.c.

References _free(), alloca(), assert(), exit, Package_s::header, headerGet(), memset(), n, N, Package_s::next, NULL, p, _HE_s::p, Spec_s::packages, PART_SUBNAME, rpmDataType_u::ptr, rc, rpmExpand(), RPMRC_FAIL, RPMRC_OK, RPMTAG_NAME, RPMTAG_VERSION, rpmDataType_u::str, strcmp(), _HE_s::tag, xisdigit(), xstrdup(), and xx.

Referenced by parseDescription(), parseFiles(), parsePreamble(), and parseScript().

struct OpenFileInfo* newOpenFileInfo ( void  )
Package newPackage ( Spec  spec)
Spec newSpec ( void  )
rpmRC packageBinaries ( Spec  spec)
rpmRC packageSources ( Spec  spec)
int parseBuildInstallClean ( Spec  spec,
rpmParseState  parsePart 
)

Parse %build/%install/%clean section(s) of a spec file.

Parameters
specspec file control structure
parsePartcurrent rpmParseState
Returns
>= 0 next rpmParseState, < 0 on error

Definition at line 14 of file parseBuildInstallClean.c.

References _, _free(), assert(), Spec_s::build, Spec_s::check, Spec_s::clean, Spec_s::foo, Spec_s::install, isPart(), Spec_s::line, Spec_s::lineNum, name, Spec_s::nfoo, NULL, PART_ARBITRARY, PART_BUILD, PART_CHECK, PART_CLEAN, PART_INSTALL, PART_NONE, rc, readLine(), rpmExpand(), rpmiobAppend(), rpmiobNew(), rpmlog(), RPMLOG_ERR, RPMRC_FAIL, RPMRC_OK, s, and STRIP_NOTHING.

Referenced by parseSpec().

int parseChangelog ( Spec  spec)

Parse %changelog section of a spec file.

Parameters
specspec file control structure
Returns
>= 0 next rpmParseState, < 0 on error

Definition at line 302 of file parseChangelog.c.

References _free(), addChangelog(), Spec_s::clean, Package_s::header, isPart(), Spec_s::line, NULL, Spec_s::packages, PART_CLEAN, PART_NONE, rc, readLine(), rpmiobAppend(), rpmiobFree(), rpmiobNew(), RPMRC_OK, STRIP_COMMENTS, STRIP_NOEXPAND, xstrdup(), and xstrtolocale().

Referenced by parseSpec().

int parseDescription ( Spec  spec)
int parseExpressionBoolean ( Spec  spec,
const char *  expr 
)

Evaluate boolean expression.

Parameters
specspec file control structure
exprexpression to parse
Returns

Definition at line 707 of file expression.c.

References _, _free(), _value::data, DEBUG, doLogical(), _value::i, _parseState::nextToken, NULL, _parseState::p, rdToken(), result, rpmlog(), RPMLOG_ERR, _value::s, _parseState::spec, spec, _parseState::str, TOK_EOF, _parseState::tokenValue, _value::type, valueFree(), void, and xstrdup().

Referenced by readLine().

char* parseExpressionString ( Spec  spec,
const char *  expr 
)

Evaluate string expression.

Parameters
specspec file control structure
exprexpression to parse
Returns

Definition at line 754 of file expression.c.

References _, _free(), buf, _value::data, DEBUG, doLogical(), _value::i, _parseState::nextToken, NULL, _parseState::p, rdToken(), result, rpmlog(), RPMLOG_ERR, _value::s, _parseState::spec, spec, sprintf(), _parseState::str, TOK_EOF, _parseState::tokenValue, _value::type, valueFree(), void, and xstrdup().

int parseFiles ( Spec  spec)

Parse %files section of a spec file.

Parameters
specspec file control structure
Returns
>= 0 next rpmParseState, < 0 on error

Definition at line 28 of file parseFiles.c.

References _, _free(), argv, Spec_s::clean, exit, file, Package_s::fileFile, Package_s::fileList, isPart(), Spec_s::line, Spec_s::lineNum, lookupPackage(), name, NULL, optCon, optionsTable, PART_CLEAN, PART_NAME, PART_NONE, PART_SUBNAME, poptContext, rc, readLine(), rpmGetPath(), rpmiobAppend(), rpmiobNew(), rpmlog(), RPMLOG_ERR, RPMRC_FAIL, RPMRC_OK, and STRIP_COMMENTS.

Referenced by parseSpec().

int parseNoSource ( Spec  spec,
const char *  field,
rpmTag  tag 
)

parseNoSource.

Parameters
specspec file control structure
fieldfield to parse
tagtag
Returns
0 on success

Definition at line 317 of file spec.c.

References _, f, fe, findSource(), Source::flags, Spec_s::lineNum, name, Source::num, p, parseNum(), RPMFILE_GHOST, RPMFILE_PATCH, RPMFILE_SOURCE, rpmlog(), RPMLOG_ERR, RPMRC_FAIL, RPMRC_OK, RPMTAG_NOSOURCE, SKIPNONWHITE, and SKIPWHITE.

Referenced by handlePreambleTag().

int parseNum ( const char *  line,
rpmuint32_t res 
)

Parse a number.

Parameters
linefrom spec file
Return values
respointer to int
Returns
0 on success, 1 on failure

Definition at line 11 of file misc.c.

References NULL, and rc.

Referenced by doPatchMacro(), doSetupMacro(), handlePreambleTag(), and parseNoSource().

int parsePreamble ( Spec  spec,
int  initialPackage 
)
int parsePrep ( Spec  spec,
int  verify 
)

Parse %prep section of a spec file.

Parameters
specspec file control structure
verifyverify existence of sources/patches?
Returns
>= 0 next rpmParseState, < 0 on error

Definition at line 892 of file parsePrep.c.

References _, argvFree(), argvSplit(), doPatchMacro(), doSetupMacro(), Spec_s::force, isPart(), Spec_s::line, Spec_s::lineNum, NULL, PART_NONE, Spec_s::prep, prepFetch(), rc, readLine(), res, rpmiobAppend(), rpmiobFree(), rpmiobNew(), rpmiobStr(), rpmlog(), RPMLOG_ERR, RPMRC_FAIL, STRIP_NOTHING, and xx.

Referenced by parseSpec().

rpmRC parseRCPOT ( Spec  spec,
Package  pkg,
const char *  field,
rpmTag  tagN,
rpmuint32_t  index,
rpmsenseFlags  tagflags 
)

Parse dependency relations from spec file and/or autogenerated output buffer.

Parameters
specspec file control structure
pkgpackage control structure
fieldtext to parse (e.g. "foo < 0:1.2-3, bar = 5:6.7")
tagNtag, identifies type of dependency
index(0 always)
tagflagsdependency flags already known from context
Returns
RPMRC_OK on success

Definition at line 20 of file parseReqs.c.

References _, _free(), addReqProv(), alloca(), EVR, exit, Flags, h, Package_s::header, ix, Spec_s::line, Spec_s::lineNum, memset(), N, nr, NULL, rc, rpmEVRflags(), rpmEVRparse(), rpmlog(), RPMLOG_ERR, RPMRC_FAIL, RPMRC_OK, RPMSENSE_SENSEMASK, RPMTAG_BUILDCONFLICTS, RPMTAG_BUILDENHANCES, RPMTAG_BUILDOBSOLETES, RPMTAG_BUILDPREREQ, RPMTAG_BUILDPROVIDES, RPMTAG_BUILDREQUIRES, RPMTAG_BUILDSUGGESTS, RPMTAG_CONFLICTFLAGS, RPMTAG_OBSOLETEFLAGS, RPMTAG_PREREQ, RPMTAG_PROVIDEFLAGS, RPMTAG_REQUIREFLAGS, RPMTAG_TRIGGERIN, RPMTAG_TRIGGERPOSTUN, RPMTAG_TRIGGERPREIN, RPMTAG_TRIGGERUN, SKIPNONWHITE, SKIPWHITE, Spec_s::sourceHeader, strncpy(), t, void, xisalnum(), and xmalloc.

Referenced by handlePreambleTag(), newSpec(), and parseScript().

int parseScript ( Spec  spec,
int  parsePart 
)

Parse %pre et al scriptlets from a spec file.

Parameters
specspec file control structure
parsePartcurrent rpmParseState
Returns
>= 0 next rpmParseState, < 0 on error

Definition at line 74 of file parseScript.c.

References _, _free(), addReqProv(), addTriggerIndex(), alloca(), rpmDataType_u::argv, argv, _HE_s::c, exit, file, Package_s::header, headerIsEntry(), headerPut(), isPart(), Spec_s::line, Spec_s::lineNum, lookupPackage(), memset(), name, NULL, optCon, optionsTable, p, _HE_s::p, parseRCPOT(), PART_NAME, PART_NONE, PART_POST, PART_POSTTRANS, PART_POSTUN, PART_PRE, PART_PRETRANS, PART_PREUN, PART_SANITYCHECK, PART_SUBNAME, PART_TRIGGERIN, PART_TRIGGERPOSTUN, PART_TRIGGERPREIN, PART_TRIGGERUN, PART_VERIFYSCRIPT, poptContext, Package_s::postInFile, Package_s::postTransFile, Package_s::postUnFile, Package_s::preInFile, Package_s::preTransFile, Package_s::preUnFile, prog, rc, readLine(), RPM_STRING_ARRAY_TYPE, RPM_STRING_TYPE, rpmExpandNumeric(), rpmiobAppend(), rpmiobFree(), rpmiobNew(), rpmiobRTrim(), rpmiobStr(), rpmlibNeedsFeature(), rpmlog(), RPMLOG_ERR, rpmluaCheckScript(), RPMRC_FAIL, RPMRC_OK, RPMTAG_POSTIN, RPMTAG_POSTINPROG, RPMTAG_POSTTRANS, RPMTAG_POSTTRANSPROG, RPMTAG_POSTUN, RPMTAG_POSTUNPROG, RPMTAG_PREIN, RPMTAG_PREINPROG, RPMTAG_PRETRANS, RPMTAG_PRETRANSPROG, RPMTAG_PREUN, RPMTAG_PREUNPROG, RPMTAG_REQUIRENAME, RPMTAG_SANITYCHECK, RPMTAG_SANITYCHECKPROG, RPMTAG_TRIGGERIN, RPMTAG_TRIGGERPOSTUN, RPMTAG_TRIGGERPREIN, RPMTAG_TRIGGERSCRIPTPROG, RPMTAG_TRIGGERSCRIPTS, RPMTAG_TRIGGERUN, RPMTAG_VERIFYSCRIPT, RPMTAG_VERIFYSCRIPTPROG, s, Package_s::sanityCheckFile, rpmDataType_u::str, strcmp(), STRIP_NOTHING, strncpy(), _HE_s::t, _HE_s::tag, tag, Package_s::verifyFile, void, xstrdup(), and xx.

Referenced by parseSpec().

int parseSpec ( rpmts  ts,
const char *  specFile,
const char *  rootURL,
int  recursing,
const char *  passPhrase,
const char *  cookie,
int  anyarch,
int  force,
int  verify 
)

Parse spec file into spec control structure.

Parameters
tstransaction set (spec file control in ts->spec)
specFile
rootURL
recursingparse is recursive?
passPhrase
cookie
anyarch
force
verify
Returns

Definition at line 530 of file parseSpec.c.

References _, _free(), addMacro(), alloca(), Spec_s::anyarch, anyarch, Spec_s::BACount, Spec_s::BANames, Spec_s::BASpecs, _HE_s::c, closeSpec(), Spec_s::cookie, delMacro(), Package_s::ds, OpenFileInfo::fileName, Spec_s::fileStack, Spec_s::force, force, freeSpec(), genSourceRpmName(), Package_s::header, headerGet(), headerIsEntry(), headerPut(), Spec_s::macros, memset(), newOpenFileInfo(), newSpec(), Package_s::next, Package_s::noarch, NULL, _HE_s::p, Spec_s::packages, parseBuildInstallClean(), parseChangelog(), parseDescription(), parseFiles(), parsePreamble(), parsePrep(), parseScript(), parseSpec(), PART_ARBITRARY, PART_BUILD, PART_BUILDARCHITECTURES, PART_CHANGELOG, PART_CHECK, PART_CLEAN, PART_DESCRIPTION, PART_FILES, PART_INSTALL, PART_LAST, PART_NONE, PART_POST, PART_POSTTRANS, PART_POSTUN, PART_PRE, PART_PREAMBLE, PART_PREP, PART_PRETRANS, PART_PREUN, PART_SANITYCHECK, PART_TRIGGERIN, PART_TRIGGERPOSTUN, PART_TRIGGERPREIN, PART_TRIGGERUN, PART_VERIFYSCRIPT, Spec_s::passPhrase, platform, rpmDataType_u::ptr, Spec_s::recursing, recursing, RMIL_RPMRC, RMIL_SPEC, Spec_s::rootURL, RPM_STRING_TYPE, rpmdsThis(), rpmExpand(), rpmExpandNumeric(), rpmGetPath(), rpmlog(), RPMLOG_ERR, RPMRC_FAIL, RPMSENSE_EQUAL, RPMTAG_ARCH, RPMTAG_DESCRIPTION, RPMTAG_NVRA, RPMTAG_OS, RPMTAG_PLATFORM, RPMTAG_REQUIRENAME, RPMTAG_SOURCERPM, rpmtsSetSpec(), Spec_s::sourceRpmName, spec, Spec_s::specFile, rpmDataType_u::str, strcmp(), _HE_s::t, _HE_s::tag, Spec_s::timeCheck, Spec_s::toplevel, void, xcalloc(), xstrdup(), and xx.

Referenced by _specQuery(), parseSpec(), and rpmts_parse_spec().

rpmRC processBinaryFiles ( Spec  spec,
int  installSpecialDoc,
int  test 
)

Post-build processing for binary package(s).

Parameters
specspec file control structure
installSpecialDoc
testdon't execute scripts or package if testing
Returns
RPMRC_OK on success

Definition at line 3174 of file files.c.

References _, _free(), alloca(), checkDuplicateFiles(), checkUnpackagedFiles(), checkUnpackagedSubdirs(), Package_s::fileList, Package_s::header, headerGet(), headerMacrosLoad(), headerMacrosUnload(), memset(), Package_s::next, NULL, _HE_s::p, Spec_s::packages, processPackageFiles(), processScriptFiles(), providePackageNVR(), rpmDataType_u::ptr, rc, res, rpmExpand(), rpmExpandNumeric(), rpmfcGenerateDepends(), rpmlog(), RPMLOG_NOTICE, RPMRC_FAIL, RPMRC_OK, RPMTAG_NVRA, rpmDataType_u::str, _HE_s::tag, and void.

Referenced by buildSpec().

int processSourceFiles ( Spec  spec)
int readLine ( Spec  spec,
rpmStripFlags  strip 
)
int rpmlibNeedsFeature ( Header  h,
const char *  feature,
const char *  featureEVR 
)

Add rpmlib feature dependency.

Parameters
hheader
featurerpm feature name (i.e. "rpmlib(Foo)" for feature Foo)
featureEVRrpm feature epoch/version/release
Returns
0 always

Definition at line 212 of file reqprov.c.

References addReqProv(), alloca(), NULL, RPMSENSE_EQUAL, RPMSENSE_LESS, RPMTAG_REQUIRENAME, stpcpy(), and void.

Referenced by genCpioListAndHeader(), getDigestAlgo(), parseScript(), processPackageFiles(), and writeRPM().

int rpmspecQuery ( rpmts  ts,
QVA_t  qva,
const char *  arg 
)

Function to query spec file(s).

Parameters
tstransaction set
qvaparsed query/verify options
argquery argument
Returns
0 on success, else no. of failures

Definition at line 968 of file spec.c.

References _, _specQuery(), alloca(), exit, NULL, rpmQVKArguments_s::qva_showPackage, res, rpmcliTargets, rpmFreeMacros(), rpmFreeRpmrc(), rpmlog(), RPMLOG_DEBUG, rpmReadConfigFiles(), strncpy(), t, te, and void.

Referenced by main().

const char* specFullSourceName ( SpecSource  source)

Return a ptr to the full url of the source.

Parameters
sourceSpecSource control structure
Returns
ptr to url

Definition at line 298 of file spec.c.

References Source::fullSource.

int SpecSourceCount ( Spec  spec)

Return the count of source set in specfile.

Parameters
specspec file control structure
Returns
the count of source

Definition at line 268 of file spec.c.

References Spec_s::numSources.

int specSourceFlags ( SpecSource  source)

Return flags set for the source.

Parameters
sourceSpecSource control structure
Returns
flags

Definition at line 312 of file spec.c.

References Source::flags.

const char* specSourceName ( SpecSource  source)

Return a ptr to the source file name.

Parameters
sourceSpecSource control structure
Returns
ptr to filename

Definition at line 291 of file spec.c.

References Source::source.

int specSourceNum ( SpecSource  source)

Return the spec or source patch number.

Parameters
sourceSpecSource control structure
Returns
the number of the source

Definition at line 305 of file spec.c.

References Source::num.

spectag stashSt ( Spec  spec,
Header  h,
rpmTag  tag,
const char *  lang 
)