rpm
5.4.15
|
Top level dispatcher for spec file parsing. More...
#include "system.h"
#include <rpmio_internal.h>
#include <rpmcb.h>
#include <argv.h>
#include <rpmbuild.h>
#include "rpmds.h"
#include "rpmts.h"
#include "debug.h"
Go to the source code of this file.
Data Structures | |
struct | PartRec |
Macros | |
#define | _RPMTAG_INTERNAL /* XXX rpmTags->aTags */ |
Functions | |
static void | initParts (struct PartRec *p) |
rpmParseState | isPart (Spec spec) |
Check line for section separator, return next parser state. More... | |
static int | matchTok (const char *token, const char *line) |
void | handleComments (char *s) |
Truncate comment lines. More... | |
static void | forceIncludeFile (Spec spec, const char *fileName) |
static int | restoreFirstChar (Spec spec) |
static int | copyNextLineFromOFI (Spec spec, OFI_t *ofi, rpmStripFlags strip) |
static int | copyNextLineFinish (Spec spec, int strip) |
static int | readLineFromOFI (Spec spec, OFI_t *ofi) |
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... | |
static int | genSourceRpmName (Spec spec) |
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... | |
Variables | |
static struct PartRec | partList [] |
int | noLang |
Top level dispatcher for spec file parsing.
Definition in file parseSpec.c.
#define _RPMTAG_INTERNAL /* XXX rpmTags->aTags */ |
Definition at line 12 of file parseSpec.c.
void closeSpec | ( | Spec | spec | ) |
Stop reading from spec file, freeing resources.
spec | spec file control structure |
Definition at line 487 of file parseSpec.c.
References _free(), Fclose(), OpenFileInfo::fd, OpenFileInfo::fileName, Spec_s::fileStack, and OpenFileInfo::next.
Referenced by parseSpec(), and specFini().
|
static |
Definition at line 257 of file parseSpec.c.
References handleComments(), Spec_s::line, Spec_s::nextline, Spec_s::nextpeekc, STRIP_COMMENTS, STRIP_TRAILINGSPACE, and xisspace().
Referenced by readLine().
|
static |
Definition at line 178 of file parseSpec.c.
References _, expandMacros(), Spec_s::lbuf, Spec_s::lbuf_len, Spec_s::lbufPtr, Spec_s::lineNum, Spec_s::macros, Spec_s::nextline, ReadLevelEntry::reading, OpenFileInfo::readPtr, Spec_s::readStack, rpmlog(), RPMLOG_ERR, RPMRC_FAIL, and STRIP_NOEXPAND.
Referenced by readLine().
|
static |
Definition at line 151 of file parseSpec.c.
References OpenFileInfo::fileName, Spec_s::fileStack, newOpenFileInfo(), OpenFileInfo::next, and xstrdup().
Referenced by readLine().
|
inlinestatic |
Definition at line 502 of file parseSpec.c.
References _free(), Package_s::header, headerNEVRA(), Spec_s::noSource, Spec_s::packages, snprintf(), Spec_s::sourceRpmName, and xstrdup().
Referenced by parseSpec().
void handleComments | ( | char * | s | ) |
Truncate comment lines.
s | skip white space, truncate line at '#' |
Definition at line 142 of file parseSpec.c.
References SKIPSPACE.
Referenced by copyNextLineFinish(), and processPackageFiles().
|
inlinestatic |
Definition at line 57 of file parseSpec.c.
References PartRec::len, and PartRec::token.
Referenced by isPart().
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, 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().
|
static |
Definition at line 120 of file parseSpec.c.
References b, SKIPNONSPACE, SKIPSPACE, and xstrncasecmp().
Referenced by readLine().
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 530 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(), Spec_s::macros, 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, RPMTAG_ARCH, RPMTAG_DESCRIPTION, RPMTAG_NVRA, RPMTAG_OS, RPMTAG_PLATFORM, RPMTAG_REQUIRENAME, RPMTAG_SOURCERPM, 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(), rpmts_parse_spec(), and spec_Parse().
int readLine | ( | Spec | spec, |
rpmStripFlags | strip | ||
) |
Read next line from spec file.
spec | spec file control structure |
strip | truncate comments? |
Definition at line 351 of file parseSpec.c.
References _, _free(), copyNextLineFinish(), copyNextLineFromOFI(), OpenFileInfo::fileName, Spec_s::fileStack, forceIncludeFile(), Spec_s::line, OpenFileInfo::lineNum, matchTok(), ReadLevelEntry::next, Spec_s::parsed, parseExpressionBoolean(), ReadLevelEntry::reading, readLineFromOFI(), Spec_s::readStack, restoreFirstChar(), rpmExpand(), rpmiobAppend(), rpmiobNew(), rpmlog(), RPMLOG_ERR, RPMRC_FAIL, SKIPNONSPACE, SKIPSPACE, STRIP_NOEXPAND, xisspace(), and xmalloc.
Referenced by parseBuildInstallClean(), parseChangelog(), parseDescription(), parseFiles(), parsePreamble(), parsePrep(), and parseScript().
Definition at line 289 of file parseSpec.c.
References _, _free(), Fclose(), OpenFileInfo::fd, fdGetFp(), Ferror(), OpenFileInfo::fileName, Spec_s::fileStack, Fopen(), Fstrerror(), OpenFileInfo::lineNum, Spec_s::lineNum, ReadLevelEntry::next, OpenFileInfo::next, OpenFileInfo::readBuf, OpenFileInfo::readPtr, Spec_s::readStack, rpmlog(), RPMLOG_ERR, RPMRC_FAIL, Spec_s::sl, speclines_s::sl_lines, speclines_s::sl_nalloc, speclines_s::sl_nlines, xrealloc, and xstrdup().
Referenced by readLine().
|
static |
Definition at line 164 of file parseSpec.c.
References Spec_s::nextline, and Spec_s::nextpeekc.
Referenced by readLine().
|
static |
Referenced by isPart().