rpm
5.2.1
|
![]() |
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... | |
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 |
Defines | |
#define | PART_BASE 100 |
Spec file parser states. | |
Typedefs | |
typedef enum rpmBuildFlags_e | rpmBuildFlags |
Bit(s) to control buildSpec() operation. | |
typedef enum rpmStripFlags_e | rpmStripFlags |
Spec file parser stripping flags. | |
typedef struct Package_s * | Package |
typedef struct Source * | SpecSource |
typedef struct ReadLevelEntry | RLE_t |
typedef struct OpenFileInfo | OFI_t |
typedef struct spectag_s * | spectag |
typedef struct spectags_s * | spectags |
typedef struct speclines_s * | speclines |
typedef struct Spec_s * | Spec |
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. | |
const char * | getUname (uid_t uid) |
Return cached user name from user id. | |
const char * | getUnameS (const char *uname) |
Return cached user name. | |
uid_t | getUidS (const char *uname) |
Return cached user id. | |
const char * | getGname (gid_t gid) |
Return cached group name from group id. | |
const char * | getGnameS (const char *gname) |
Return cached group name. | |
gid_t | getGidS (const char *gname) |
Return cached group id. | |
const char * | buildHost (void) |
Return build hostname. | |
rpmuint32_t * | getBuildTime (void) |
Return build time stamp. | |
int | readLine (Spec spec, rpmStripFlags strip) |
Read next line from spec file. | |
void | closeSpec (Spec spec) |
Stop reading from spec file, freeing resources. | |
void | handleComments (char *s) |
Truncate comment lines. | |
rpmParseState | isPart (Spec spec) |
Check line for section separator, return next parser state. | |
int | parseNum (const char *line, rpmuint32_t *res) |
Parse a number. | |
void | addChangelogEntry (Header h, time_t time, const char *name, const char *text) |
Add changelog entry to header. | |
int | parseBuildInstallClean (Spec spec, rpmParseState parsePart) |
Parse %build/%install/%clean section(s) of a spec file. | |
int | parseChangelog (Spec spec) |
Parse %changelog section of a spec file. | |
int | parseDescription (Spec spec) |
Parse %description section of a spec file. | |
int | parseFiles (Spec spec) |
Parse %files section of a spec file. | |
int | parsePreamble (Spec spec, int initialPackage) |
Parse tags from preamble of a spec file. | |
int | parsePrep (Spec spec, int verify) |
Parse %prep section of a spec file. | |
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. | |
int | parseScript (Spec spec, int parsePart) |
Parse %pre et al scriptlets from a spec file. | |
int | parseExpressionBoolean (Spec spec, const char *expr) |
Evaluate boolean expression. | |
char * | parseExpressionString (Spec spec, const char *expr) |
Evaluate string expression. | |
rpmRC | doScript (Spec spec, int what, const char *name, rpmiob iob, int test) |
Run a build script, assembled from spec file scriptlet section. | |
rpmRC | lookupPackage (Spec spec, const char *name, int flag, Package *pkg) |
Find sub-package control structure by name. | |
Package | newPackage (Spec spec) |
Create and initialize package control structure. | |
Package | freePackages (Package packages) |
Destroy all packages associated with spec file. | |
Package | freePackage (Package pkg) |
Destroy package control structure. | |
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. | |
int | rpmlibNeedsFeature (Header h, const char *feature, const char *featureEVR) |
Add rpmlib feature dependency. | |
rpmRC | processBinaryFiles (Spec spec, int installSpecialDoc, int test) |
Post-build processing for binary package(s). | |
int | initSourceHeader (Spec spec, rpmiob *sfp) |
Create and initialize header for source package. | |
int | processSourceFiles (Spec spec) |
Post-build processing for source package. | |
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. | |
rpmRC | buildSpec (rpmts ts, Spec spec, int what, int test) |
Build stages state machine driver. | |
rpmRC | packageBinaries (Spec spec) |
Generate binary package(s). | |
rpmRC | packageSources (Spec spec) |
Generate source package. | |
Spec | newSpec (void) |
Create and initialize Spec structure. | |
Spec | freeSpec (Spec spec) |
Destroy Spec structure. | |
int | rpmspecQuery (rpmts ts, QVA_t qva, const char *arg) |
Function to query spec file(s). | |
struct OpenFileInfo * | newOpenFileInfo (void) |
spectag | stashSt (Spec spec, Header h, rpmTag tag, const char *lang) |
stashSt. | |
int | addSource (Spec spec, Package pkg, const char *field, rpmTag tag) |
addSource. | |
int | parseNoSource (Spec spec, const char *field, rpmTag tag) |
parseNoSource. | |
int | SpecSourceCount (Spec spec) |
Return the count of source set in specfile. | |
SpecSource | getSource (Spec spec, int num) |
Return a source control structure. | |
const char * | specSourceName (SpecSource source) |
Return a ptr to the source file name. | |
const char * | specFullSourceName (SpecSource source) |
Return a ptr to the full url of the source. | |
int | specSourceNum (SpecSource source) |
Return the spec or source patch number. | |
int | specSourceFlags (SpecSource source) |
Return flags set for the source. | |
const char * | getSourceDir (rpmfileAttrs attr) |
Return the macro directory location from source file flags. |
#define PART_BASE 100 |
Spec file parser states.
Definition at line 54 of file rpmbuild.h.
typedef struct OpenFileInfo OFI_t |
typedef struct ReadLevelEntry RLE_t |
typedef enum rpmBuildFlags_e rpmBuildFlags |
Bit(s) to control buildSpec() operation.
typedef enum rpmStripFlags_e rpmStripFlags |
Spec file parser stripping flags.
Definition at line 18 of file rpmtypes.h.
typedef struct speclines_s * speclines |
typedef struct Source* SpecSource |
typedef struct spectags_s * spectags |
enum rpmBuildFlags_e |
Bit(s) to control buildSpec() operation.
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 24 of file rpmbuild.h.
enum rpmStripFlags_e |
Spec file parser stripping flags.
Definition at line 88 of file rpmbuild.h.
void addChangelogEntry | ( | Header | h, |
time_t | time, | ||
const char * | name, | ||
const char * | text | ||
) |
Add changelog entry to header.
h | header |
time | time of change |
name | person who made the change |
text | description of change |
Definition at line 17 of file parseChangelog.c.
References alloca(), _HE_s::append, rpmDataType_u::argv, _HE_s::c, headerPut(), name, _HE_s::p, RPM_STRING_ARRAY_TYPE, RPM_UINT32_TYPE, _HE_s::t, _HE_s::tag, and rpmDataType_u::ui32p.
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.
spec | spec file control structure |
h | header |
tagN | tag, 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) |
Definition at line 14 of file reqprov.c.
References _free(), alloca(), _HE_s::append, rpmDataType_u::argv, _HE_s::c, headerGet(), headerPut(), _HE_s::p, RPM_STRING_ARRAY_TYPE, RPM_UINT32_TYPE, RPMSENSE_SENSEMASK, _HE_s::t, _HE_s::tag, and rpmDataType_u::ui32p.
Referenced by parseRCPOT(), parseScript(), and rpmlibNeedsFeature().
addSource.
spec | spec file control structure |
pkg | package control |
field | field to parse |
tag | tag |
Definition at line 333 of file spec.c.
References _, _free(), addMacro(), Source::flags, Source::fullSource, getSourceDir(), Spec_s::line, Spec_s::lineNum, Spec_s::macros, Source::next, Source::num, Spec_s::numSources, parseNum(), Spec_s::recursing, RMIL_SPEC, RPMFILE_ICON, RPMFILE_PATCH, RPMFILE_SOURCE, rpmGenPath(), rpmlog(), RPMLOG_ERR, rpmluaPop(), rpmluaPushTable(), rpmluaSetVar(), RPMLUAV_STRING, rpmluavFree(), rpmluavNew(), rpmluavSetListMode(), rpmluavSetValue(), RPMRC_FAIL, RPMRC_OK, SKIPSPACE, Source::source, Spec_s::sources, xmalloc(), and xstrdup().
Referenced by handlePreambleTag().
const char* buildHost | ( | void | ) |
Return build hostname.
Definition at line 206 of file names.c.
References _, rpmlog(), and RPMLOG_WARNING.
Referenced by rpmlibMarkers(), and writeRPM().
Build stages state machine driver.
ts | transaction set |
spec | spec file control structure |
what | bit(s) to enable stages of build |
test | don't execute scripts or package if testing |
Definition at line 334 of file build.c.
References _, _free(), Spec_s::BACount, Spec_s::BASpecs, buildSpec(), doRmSource(), doScript(), packageBinaries(), packageSources(), processBinaryFiles(), processSourceFiles(), Spec_s::recursing, Rmdir(), RPMBUILD_BUILD, RPMBUILD_CHECK, RPMBUILD_CLEAN, RPMBUILD_FILECHECK, RPMBUILD_INSTALL, RPMBUILD_PACKAGEBINARY, RPMBUILD_PACKAGESOURCE, RPMBUILD_PREP, RPMBUILD_RMBUILD, RPMBUILD_RMSOURCE, RPMBUILD_RMSPEC, RPMBUILD_TRACK, rpmGetPath(), rpmlog(), RPMLOG_NOTICE, rpmlogGetNrecs(), rpmlogPrint(), RPMRC_OK, Spec_s::specFile, and Unlink().
Referenced by buildSpec().
void closeSpec | ( | Spec | spec | ) |
Stop reading from spec file, freeing resources.
spec | spec file control structure |
Definition at line 477 of file parseSpec.c.
References _free(), Fclose(), OpenFileInfo::fd, OpenFileInfo::fileName, Spec_s::fileStack, and OpenFileInfo::next.
Referenced by freeSpec(), and parseSpec().
Run a build script, assembled from spec file scriptlet section.
spec | spec file control structure |
what | type of script |
name | name of scriptlet section |
iob | lines that compose script body |
test | don't execute scripts or package if testing |
Definition at line 89 of file build.c.
References Spec_s::rootURL, and rpmGenPath().
Referenced by buildSpec(), and processPackageFiles().
void freeNames | ( | void | ) |
Destroy package control structure.
pkg | package control structure |
Definition at line 183 of file spec.c.
References _free(), Package_s::cpioList, Package_s::ds, Package_s::fileFile, Package_s::fileList, freeTriggerFiles(), Package_s::header, headerFree(), Package_s::postInFile, Package_s::postUnFile, Package_s::preInFile, Package_s::preUnFile, rpmdsFree(), rpmfiFree(), rpmiobFree(), Package_s::sanityCheckFile, Package_s::specialDoc, Package_s::triggerFiles, and Package_s::verifyFile.
Referenced by freePackages().
Destroy all packages associated with spec file.
packages | package control structure chain |
Definition at line 213 of file spec.c.
References freePackage(), and Package_s::next.
Referenced by freeSpec().
Destroy Spec structure.
spec | spec file control structure |
Definition at line 591 of file spec.c.
References _free(), Spec_s::BACount, Spec_s::BANames, Spec_s::BASpecs, Spec_s::build, Spec_s::buildSubdir, Spec_s::check, Spec_s::clean, closeSpec(), Spec_s::cookie, Spec_s::foo, freePackages(), freeSl(), freeSources(), freeSpec(), freeSt(), headerFree(), Spec_s::install, Spec_s::lbuf, ReadLevelEntry::next, Spec_s::nfoo, Spec_s::packages, Spec_s::passPhrase, Spec_s::prep, Spec_s::readStack, Spec_s::recursing, Spec_s::rootURL, rpmfiFree(), rpmiobFree(), rpmluaDelVar(), Spec_s::sl, Spec_s::sourceCpioList, Spec_s::sourceHeader, Spec_s::sourcePkgId, Spec_s::sourceRpmName, Spec_s::sources, Spec_s::specFile, Spec_s::st, and tagStoreFree().
Referenced by _specQuery(), freeSpec(), parseSpec(), and spec_dealloc().
rpmuint32_t* getBuildTime | ( | void | ) |
Return build time stamp.
Definition at line 197 of file names.c.
Referenced by rpmlibMarkers(), and writeRPM().
gid_t getGidS | ( | const char * | gname | ) |
const char* getGname | ( | gid_t | gid | ) |
Return cached group name from group id.
gid | group id |
Definition at line 119 of file names.c.
References _, gid_used, gids, gnames, rpmlog(), RPMLOG_CRIT, and xstrdup().
Referenced by addFile(), checkOwners(), and processSourceFiles().
const char* getGnameS | ( | const char * | gname | ) |
SpecSource getSource | ( | Spec | spec, |
int | num | ||
) |
Return a source control structure.
spec | spec file control structure |
num | the number of the wanted source (starting from 0) |
Definition at line 247 of file spec.c.
References Source::next, Source::num, and Spec_s::sources.
const char* getSourceDir | ( | rpmfileAttrs | attr | ) |
Return the macro directory location from source file flags.
attr | rpmfileAttrs from source |
Definition at line 24 of file build.c.
Referenced by addSource(), doUntar(), initSourceHeader(), isSpecFile(), and prepFetch().
uid_t getUidS | ( | const char * | uname | ) |
const char* getUname | ( | uid_t | uid | ) |
Return cached user name from user id.
uid | user id |
Definition at line 41 of file names.c.
References _, rpmlog(), RPMLOG_CRIT, uid_used, uids, unames, and xstrdup().
Referenced by addFile(), checkOwners(), and processSourceFiles().
const char* getUnameS | ( | const char * | uname | ) |
void handleComments | ( | char * | s | ) |
Truncate comment lines.
s | skip white space, truncate line at '#' |
Definition at line 139 of file parseSpec.c.
References SKIPSPACE.
Referenced by copyNextLineFinish(), and processPackageFiles().
Create and initialize header for source package.
spec | spec file control structure |
*sfp | srpm file list (may be NULL) |
Definition at line 2531 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(), Source::next, Spec_s::nfoo, 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(), Source::source, Spec_s::sourceHdrInit, Spec_s::sourceHeader, Spec_s::sources, Spec_s::specFile, rpmDataType_u::str, _HE_s::t, _HE_s::tag, tagValue(), rpmDataType_u::ui32p, and xstrcasecmp().
Referenced by _specQuery(), and processSourceFiles().
rpmParseState isPart | ( | Spec | spec | ) |
Check line for section separator, return next parser state.
spec | spec file control structure |
Definition at line 64 of file parseSpec.c.
References _free(), argvSearch(), argvStrcasecmp(), Spec_s::foo, initParts(), PartRec::len, Spec_s::line, Spec_s::nfoo, PartRec::part, PART_ARBITRARY, PART_NONE, partList, rpmTags, tagCanonicalize(), tagGenerate(), tagName(), PartRec::token, xisspace(), xrealloc(), xstrdup(), and xstrncasecmp().
Referenced by parseBuildInstallClean(), parseChangelog(), parseDescription(), parseFiles(), parsePreamble(), parsePrep(), and parseScript().
Find sub-package control structure by name.
spec | spec file control structure |
name | (sub-)package name |
flag | if PART_SUBNAME, then 1st package name is prepended |
pkg | package control structure |
Definition at line 70 of file spec.c.
References _free(), alloca(), Package_s::header, headerGet(), Package_s::next, _HE_s::p, Spec_s::packages, PART_SUBNAME, rpmDataType_u::ptr, rpmExpand(), RPMRC_FAIL, RPMRC_OK, rpmDataType_u::str, _HE_s::tag, and xstrdup().
Referenced by parseDescription(), parseFiles(), parsePreamble(), and parseScript().
struct OpenFileInfo* newOpenFileInfo | ( | void | ) | [read] |
Definition at line 668 of file spec.c.
References OpenFileInfo::fd, OpenFileInfo::fileName, OpenFileInfo::lineNum, OpenFileInfo::next, OpenFileInfo::readBuf, OpenFileInfo::readPtr, and xmalloc().
Referenced by forceIncludeFile(), and parseSpec().
Create and initialize package control structure.
spec | spec file control structure |
Definition at line 144 of file spec.c.
References _rpmbuildFlags, Package_s::autoProv, Package_s::autoReq, Package_s::cpioList, Package_s::ds, Package_s::fileFile, Package_s::fileList, Package_s::header, headerNew(), Package_s::next, Package_s::postInFile, Package_s::postUnFile, Package_s::preInFile, Package_s::preUnFile, Package_s::sanityCheckFile, Package_s::specialDoc, Package_s::triggerFiles, Package_s::verifyFile, and xcalloc().
Referenced by parsePreamble().
Spec newSpec | ( | void | ) |
Create and initialize Spec structure.
Definition at line 530 of file spec.c.
References Spec_s::_parseRCPOT, Spec_s::anyarch, Spec_s::BACount, Spec_s::BANames, Spec_s::BASpecs, Spec_s::build, Spec_s::buildSubdir, Spec_s::check, Spec_s::clean, Spec_s::cookie, Spec_s::fileStack, Spec_s::foo, Spec_s::force, headerNew(), Spec_s::install, Spec_s::lbuf, Spec_s::lbuf_len, Spec_s::line, Spec_s::lineNum, Spec_s::macros, newSl(), newSt(), ReadLevelEntry::next, Spec_s::nextline, Spec_s::nextpeekc, Spec_s::nfoo, Spec_s::noSource, Spec_s::numSources, Spec_s::packages, parseRCPOT(), Spec_s::passPhrase, Spec_s::prep, ReadLevelEntry::reading, Spec_s::readStack, Spec_s::recursing, Spec_s::rootURL, rpmExpandNumeric(), rpmGlobalMacroContext, Spec_s::sl, Spec_s::sourceCpioList, Spec_s::sourceHeader, Spec_s::sourcePkgId, Spec_s::sourceRpmName, Spec_s::sources, Spec_s::specFile, Spec_s::st, Spec_s::timeCheck, Spec_s::toplevel, and xcalloc().
Referenced by parseSpec().
Generate binary package(s).
spec | spec file control structure |
Definition at line 1066 of file pack.c.
References _, _free(), _rpmbuildFlags, alloca(), _HE_s::c, Spec_s::cookie, Package_s::cpioList, errno, fdFree(), fdNew(), Package_s::fileList, Package_s::header, headerCopyTags(), headerGet(), headerPut(), headerSprintf(), Package_s::next, _HE_s::p, Spec_s::packages, Spec_s::passPhrase, rpmDataType_u::ptr, RPM_BIN_TYPE, RPM_STRING_TYPE, rpmExpand(), rpmfiFree(), rpmfiLink(), rpmGetPath(), rpmHeaderFormats, rpmioMkpath(), rpmlibMarkers(), rpmlog(), RPMLOG_ERR, RPMRC_FAIL, RPMRC_OK, Spec_s::sourcePkgId, Stat(), rpmDataType_u::str, _HE_s::t, _HE_s::tag, and writeRPM().
Referenced by buildSpec().
Generate source package.
spec | spec file control structure |
Definition at line 1181 of file pack.c.
References _free(), alloca(), rpmDataType_u::argv, argvCount(), argvFree(), _HE_s::c, Spec_s::cookie, fdFree(), fdNew(), headerPut(), _HE_s::p, Spec_s::passPhrase, RPM_STRING_ARRAY_TYPE, RPM_UINT32_TYPE, rpmfiFree(), rpmfiLink(), rpmGetMacroEntries(), rpmGetPath(), rpmioMkpath(), rpmlibMarkers(), RPMRC_FAIL, RPMRC_OK, Spec_s::sourceCpioList, Spec_s::sourceHeader, Spec_s::sourcePkgId, Spec_s::sourceRpmName, _HE_s::t, _HE_s::tag, rpmDataType_u::ui32p, and writeRPM().
Referenced by buildSpec().
int parseBuildInstallClean | ( | Spec | spec, |
rpmParseState | parsePart | ||
) |
Parse %build/%install/%clean section(s) of a spec file.
spec | spec file control structure |
parsePart | current rpmParseState |
Definition at line 14 of file parseBuildInstallClean.c.
References _, _free(), Spec_s::build, Spec_s::check, Spec_s::clean, Spec_s::foo, Spec_s::install, isPart(), Spec_s::line, Spec_s::lineNum, Spec_s::nfoo, PART_ARBITRARY, PART_BUILD, PART_CHECK, PART_CLEAN, PART_INSTALL, PART_NONE, readLine(), rpmExpand(), rpmiobAppend(), rpmiobNew(), rpmlog(), RPMLOG_ERR, RPMRC_FAIL, RPMRC_OK, and STRIP_NOTHING.
Referenced by parseSpec().
int parseChangelog | ( | Spec | spec | ) |
Parse %changelog section of a spec file.
spec | spec file control structure |
Definition at line 263 of file parseChangelog.c.
References _free(), addChangelog(), Package_s::header, isPart(), Spec_s::line, Spec_s::packages, PART_NONE, readLine(), rpmiobAppend(), rpmiobFree(), rpmiobNew(), RPMRC_OK, STRIP_COMMENTS, STRIP_NOEXPAND, xstrdup(), and xstrtolocale().
Referenced by parseSpec().
int parseDescription | ( | Spec | spec | ) |
Parse %description section of a spec file.
spec | spec file control structure |
Definition at line 32 of file parseDescription.c.
References _, _free(), alloca(), Package_s::header, headerAddI18NString(), headerDel(), headerGet(), isPart(), lang, Spec_s::line, Spec_s::lineNum, lookupPackage(), noLang, optionsTable, _HE_s::p, PART_NAME, PART_NONE, PART_SUBNAME, rpmDataType_u::ptr, readLine(), RPM_STRING_TYPE, RPMBUILD_DEFAULT_LANG, rpmiobAppend(), rpmiobFree(), rpmiobNew(), rpmiobRTrim(), rpmiobStr(), rpmlog(), RPMLOG_ERR, RPMRC_FAIL, RPMRC_OK, stashSt(), STRIP_COMMENTS, STRIP_TRAILINGSPACE, _HE_s::t, spectag_s::t_nlines, and _HE_s::tag.
Referenced by parseSpec().
int parseExpressionBoolean | ( | Spec | spec, |
const char * | expr | ||
) |
Evaluate boolean expression.
spec | spec file control structure |
expr | expression to parse |
Definition at line 679 of file expression.c.
References _, _free(), _value::data, DEBUG, doLogical(), _value::i, _parseState::nextToken, _parseState::p, rdToken(), rpmlog(), RPMLOG_ERR, _value::s, _parseState::spec, _parseState::str, TOK_EOF, _parseState::tokenValue, _value::type, valueFree(), and xstrdup().
Referenced by readLine().
char* parseExpressionString | ( | Spec | spec, |
const char * | expr | ||
) |
Evaluate string expression.
spec | spec file control structure |
expr | expression to parse |
Definition at line 726 of file expression.c.
References _, _free(), _value::data, DEBUG, doLogical(), _value::i, _parseState::nextToken, _parseState::p, rdToken(), rpmlog(), RPMLOG_ERR, _value::s, _parseState::spec, _parseState::str, TOK_EOF, _parseState::tokenValue, _value::type, valueFree(), and xstrdup().
int parseFiles | ( | Spec | spec | ) |
Parse %files section of a spec file.
spec | spec file control structure |
Definition at line 28 of file parseFiles.c.
References _, _free(), file, Package_s::fileFile, Package_s::fileList, isPart(), Spec_s::line, Spec_s::lineNum, lookupPackage(), optionsTable, PART_NAME, PART_NONE, PART_SUBNAME, readLine(), rpmGetPath(), rpmiobAppend(), rpmiobNew(), rpmlog(), RPMLOG_ERR, RPMRC_FAIL, RPMRC_OK, and STRIP_COMMENTS.
Referenced by parseSpec().
parseNoSource.
spec | spec file control structure |
field | field to parse |
tag | tag |
Definition at line 289 of file spec.c.
References _, findSource(), Source::flags, Spec_s::lineNum, name, Source::num, parseNum(), RPMFILE_GHOST, RPMFILE_PATCH, RPMFILE_SOURCE, rpmlog(), RPMLOG_ERR, RPMRC_FAIL, RPMRC_OK, SKIPNONWHITE, and SKIPWHITE.
Referenced by handlePreambleTag().
int parseNum | ( | const char * | line, |
rpmuint32_t * | res | ||
) |
Parse a number.
line | from spec file |
res | pointer to int |
Definition at line 11 of file misc.c.
Referenced by addSource(), doPatchMacro(), doSetupMacro(), handlePreambleTag(), and parseNoSource().
int parsePreamble | ( | Spec | spec, |
int | initialPackage | ||
) |
Parse tags from preamble of a spec file.
spec | spec file control structure |
initialPackage |
Definition at line 1094 of file parsePreamble.c.
References _, _free(), addMacro(), alloca(), Spec_s::anyarch, Spec_s::BANames, _HE_s::c, checkForDuplicates(), checkForRequired(), checkForValidArchitectures(), copyTagsDuringParse, fillOutMainPackage(), findPreambleTag(), handlePreambleTag(), Package_s::header, headerCopyTags(), headerGet(), headerPut(), isPart(), lang, Spec_s::line, Spec_s::lineNum, lookupPackage(), Spec_s::macros, newPackage(), Package_s::next, _HE_s::p, Spec_s::packages, parseSimplePart(), PART_BUILDARCHITECTURES, PART_NONE, PART_SUBNAME, rpmDataType_u::ptr, readLine(), Spec_s::recursing, RMIL_SPEC, RPM_STRING_TYPE, RPM_UINT32_TYPE, rpmExpand(), rpmlog(), RPMLOG_ERR, RPMRC_FAIL, RPMRC_OK, SKIPSPACE, rpmDataType_u::str, STRIP_COMMENTS, STRIP_TRAILINGSPACE, _HE_s::t, _HE_s::tag, PreambleRec_s::tag, Spec_s::toplevel, and rpmDataType_u::ui32p.
Referenced by parseSpec().
int parsePrep | ( | Spec | spec, |
int | verify | ||
) |
Parse %prep section of a spec file.
spec | spec file control structure |
verify | verify existence of sources/patches? |
Definition at line 841 of file parsePrep.c.
References _, argvFree(), argvSplit(), doPatchMacro(), doSetupMacro(), Spec_s::force, isPart(), Spec_s::line, Spec_s::lineNum, PART_NONE, Spec_s::prep, prepFetch(), readLine(), rpmiobAppend(), rpmiobFree(), rpmiobNew(), rpmiobStr(), rpmlog(), RPMLOG_ERR, RPMRC_FAIL, and STRIP_NOTHING.
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.
spec | spec file control structure |
pkg | package control structure |
field | text to parse (e.g. "foo < 0:1.2-3, bar = 5:6.7") |
tagN | tag, identifies type of dependency |
index | (0 always) |
tagflags | dependency flags already known from context |
Definition at line 20 of file parseReqs.c.
References _, _free(), addReqProv(), alloca(), Package_s::header, Spec_s::line, Spec_s::lineNum, rpmEVRflags(), rpmEVRparse(), rpmlog(), RPMLOG_ERR, RPMRC_FAIL, RPMRC_OK, RPMSENSE_SENSEMASK, SKIPNONWHITE, SKIPWHITE, Spec_s::sourceHeader, xisalnum(), xmalloc(), and xstrdup().
Referenced by handlePreambleTag(), newSpec(), and parseScript().
int parseScript | ( | Spec | spec, |
int | parsePart | ||
) |
Parse %pre et al scriptlets from a spec file.
spec | spec file control structure |
parsePart | current rpmParseState |
Definition at line 74 of file parseScript.c.
References _, _free(), addReqProv(), addTriggerIndex(), alloca(), rpmDataType_u::argv, _HE_s::c, file, Package_s::header, headerIsEntry(), headerPut(), isPart(), Spec_s::line, Spec_s::lineNum, lookupPackage(), optionsTable, _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, Package_s::postInFile, Package_s::postTransFile, Package_s::postUnFile, Package_s::preInFile, Package_s::preTransFile, Package_s::preUnFile, prog, readLine(), RPM_STRING_ARRAY_TYPE, RPM_STRING_TYPE, rpmExpandNumeric(), rpmiobAppend(), rpmiobFree(), rpmiobNew(), rpmiobRTrim(), rpmiobStr(), rpmlibNeedsFeature(), rpmlog(), RPMLOG_ERR, rpmluaCheckScript(), RPMRC_FAIL, RPMRC_OK, Package_s::sanityCheckFile, rpmDataType_u::str, STRIP_NOTHING, _HE_s::t, _HE_s::tag, Package_s::verifyFile, and xstrdup().
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.
ts | transaction set (spec file control in ts->spec) |
specFile | |
rootURL | |
recursing | parse is recursive? |
passPhrase | |
cookie | |
anyarch | |
force | |
verify |
Definition at line 520 of file parseSpec.c.
References _, _free(), addMacro(), alloca(), Spec_s::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, freeSpec(), genSourceRpmName(), Package_s::header, headerGet(), headerIsEntry(), headerPut(), newOpenFileInfo(), newSpec(), Package_s::next, Package_s::noarch, _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, RMIL_RPMRC, RMIL_SPEC, Spec_s::rootURL, RPM_STRING_TYPE, rpmdsThis(), rpmExpand(), rpmExpandNumeric(), rpmGetPath(), rpmlog(), RPMLOG_ERR, RPMRC_FAIL, RPMSENSE_EQUAL, rpmtsSetSpec(), Spec_s::sourceRpmName, Spec_s::specFile, rpmDataType_u::str, _HE_s::t, _HE_s::tag, Spec_s::timeCheck, Spec_s::toplevel, xcalloc(), and xstrdup().
Referenced by _specQuery(), parseSpec(), and spec_Parse().
Post-build processing for binary package(s).
spec | spec file control structure |
installSpecialDoc | |
test | don't execute scripts or package if testing |
Definition at line 3111 of file files.c.
References _, _free(), alloca(), checkDuplicateFiles(), checkUnpackagedFiles(), checkUnpackagedSubdirs(), Package_s::fileList, Package_s::header, headerGet(), headerMacrosLoad(), headerMacrosUnload(), Package_s::next, _HE_s::p, Spec_s::packages, processPackageFiles(), processScriptFiles(), providePackageNVR(), rpmDataType_u::ptr, rpmfcGenerateDepends(), rpmlog(), RPMLOG_NOTICE, RPMRC_FAIL, RPMRC_OK, rpmDataType_u::str, and _HE_s::tag.
Referenced by buildSpec().
int processSourceFiles | ( | Spec | spec | ) |
Post-build processing for source package.
spec | spec file control structure |
Definition at line 2714 of file files.c.
References _, AttrRec_s::ar_fmode, AttrRec_s::ar_fmodestr, AttrRec_s::ar_group, AttrRec_s::ar_user, argvFree(), argvSplit(), FileList_s::buildRootURL, FileList_s::def_ar, FileListRec_s::diskURL, errno, FileList_s::fileList, FileList_s::fileListRecsUsed, FileListRec_s::fileURL, FileListRec_s::fl_st, FileListRec_s::flags, freeFileList(), genCpioListAndHeader(), getGname(), getGnameS(), getUname(), getUnameS(), FileListRec_s::gname, initSourceHeader(), FileListRec_s::langs, Spec_s::numSources, parseForAttr(), FileList_s::prefix, FileList_s::processingFailed, rpmExpand(), RPMFILE_GHOST, RPMFILE_SPECFILE, rpmiobFree(), rpmiobNew(), rpmiobStr(), rpmlog(), RPMLOG_ERR, RPMVERIFY_ALL, SKIPSPACE, snprintf(), Spec_s::sourceCpioList, Spec_s::sourceHeader, Stat(), FileList_s::totalFileSize, FileListRec_s::uname, urlPath(), FileListRec_s::verifyFlags, xcalloc(), and xstrdup().
Referenced by buildSpec().
int readLine | ( | Spec | spec, |
rpmStripFlags | strip | ||
) |
Read next line from spec file.
spec | spec file control structure |
strip | truncate comments? |
Definition at line 348 of file parseSpec.c.
References _, _free(), copyNextLineFinish(), copyNextLineFromOFI(), OpenFileInfo::fileName, Spec_s::fileStack, forceIncludeFile(), Spec_s::line, OpenFileInfo::lineNum, matchTok(), ReadLevelEntry::next, parseExpressionBoolean(), ReadLevelEntry::reading, readLineFromOFI(), Spec_s::readStack, restoreFirstChar(), rpmExpand(), rpmlog(), RPMLOG_ERR, RPMRC_FAIL, SKIPNONSPACE, SKIPSPACE, STRIP_NOEXPAND, xisspace(), and xmalloc().
Referenced by parseBuildInstallClean(), parseChangelog(), parseDescription(), parseFiles(), parsePreamble(), parsePrep(), and parseScript().
int rpmlibNeedsFeature | ( | Header | h, |
const char * | feature, | ||
const char * | featureEVR | ||
) |
Add rpmlib feature dependency.
h | header |
feature | rpm feature name (i.e. "rpmlib(Foo)" for feature Foo) |
featureEVR | rpm feature epoch/version/release |
Definition at line 149 of file reqprov.c.
References addReqProv(), alloca(), RPMSENSE_EQUAL, RPMSENSE_LESS, and stpcpy().
Referenced by genCpioListAndHeader(), getDigestAlgo(), parseScript(), processPackageFiles(), and writeRPM().
Function to query spec file(s).
ts | transaction set |
qva | parsed query/verify options |
arg | query argument |
Definition at line 922 of file spec.c.
References _, _specQuery(), alloca(), rpmQVKArguments_s::qva_showPackage, rpmcliTargets, rpmFreeMacros(), rpmFreeRpmrc(), rpmlog(), RPMLOG_DEBUG, and rpmReadConfigFiles().
Referenced by main().
const char* specFullSourceName | ( | SpecSource | source | ) |
Return a ptr to the full url of the source.
source | SpecSource control structure |
Definition at line 270 of file spec.c.
References Source::fullSource.
int SpecSourceCount | ( | Spec | spec | ) |
Return the count of source set in specfile.
spec | spec file control structure |
Definition at line 240 of file spec.c.
References Spec_s::numSources.
int specSourceFlags | ( | SpecSource | source | ) |
Return flags set for the source.
source | SpecSource control structure |
Definition at line 284 of file spec.c.
References Source::flags.
const char* specSourceName | ( | SpecSource | source | ) |
Return a ptr to the source file name.
source | SpecSource control structure |
Definition at line 263 of file spec.c.
References Source::source.
int specSourceNum | ( | SpecSource | source | ) |
Return the spec or source patch number.
source | SpecSource control structure |
Definition at line 277 of file spec.c.
References Source::num.
stashSt.
spec | spec file control structure |
h | header |
tag | tag |
lang | locale |
Definition at line 519 of file parsePreamble.c.
References _free(), alloca(), headerGet(), Spec_s::lineNum, _HE_s::p, rpmDataType_u::ptr, RPMBUILD_DEFAULT_LANG, Spec_s::st, spectags_s::st_nalloc, spectags_s::st_ntags, spectags_s::st_t, rpmDataType_u::str, spectag_s::t_lang, spectag_s::t_msgid, spectag_s::t_nlines, spectag_s::t_startx, spectag_s::t_tag, _HE_s::tag, tagName(), xrealloc(), and xstrdup().
Referenced by handlePreambleTag(), and parseDescription().