Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages  

build/spec.c File Reference

Handle spec data structure. More...

#include "system.h"
#include "buildio.h"
#include "rpmds.h"
#include "rpmfi.h"
#include "rpmts.h"
#include "debug.h"

Go to the source code of this file.

Defines

#define SKIPWHITE(_x)   {while(*(_x) && (xisspace(*_x) || *(_x) == ',')) (_x)++;}
#define SKIPNONWHITE(_x)   {while(*(_x) &&!(xisspace(*_x) || *(_x) == ',')) (_x)++;}

Functions

TriggerFileEntryfreeTriggerFiles (struct TriggerFileEntry *p)
SourcefreeSources (struct Source *s)
 Destroy source component chain.

int lookupPackage (Spec spec, const char *name, int flag, Package *pkg)
Package newPackage (Spec spec)
Package freePackage (Package pkg)
Package freePackages (Package packages)
SourcefindSource (Spec spec, int num, int flag)
int parseNoSource (Spec spec, const char *field, int tag)
int addSource (Spec spec, Package pkg, const char *field, int tag)
speclines freeSl (speclines sl)
spectags freeSt (spectags st)
Spec newSpec (void)
Spec freeSpec (Spec spec)
OpenFileInfonewOpenFileInfo (void)
void printNewSpecfile (Spec spec)
 Print copy of spec file, filling in Group/Description/Summary from specspo.

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

Variables

int specedit
speclines newSl (void)
spectags newSt (void)


Detailed Description

Handle spec data structure.

Definition in file spec.c.


Define Documentation

#define SKIPNONWHITE _x       {while(*(_x) &&!(xisspace(*_x) || *(_x) == ',')) (_x)++;}
 

Definition at line 20 of file spec.c.

#define SKIPWHITE _x       {while(*(_x) && (xisspace(*_x) || *(_x) == ',')) (_x)++;}
 

Definition at line 19 of file spec.c.


Function Documentation

int addSource Spec    spec,
Package    pkg,
const char *    field,
int    tag
 

Parameters:
spec  spec file control structure
pkg  package control
field 
tag 

Definition at line 257 of file spec.c.

References _, _free(), addMacro(), Source::flags, Source::fullSource, Package_s::icon, Spec_s::line, Spec_s::lineNum, Spec_s::macros, Source::next, Source::num, Spec_s::numSources, parseNum(), RMIL_SPEC, RPMBUILD_ISICON, RPMBUILD_ISPATCH, RPMBUILD_ISSOURCE, RPMERR_BADSPEC, rpmError, rpmGetPath(), RPMTAG_ICON, RPMTAG_PATCH, RPMTAG_SOURCE, SKIPSPACE, Source::source, Spec_s::sources, xmalloc(), and xstrdup().

Referenced by handlePreambleTag().

struct Source* findSource Spec    spec,
int    num,
int    flag
[inline, static]
 

Definition at line 199 of file spec.c.

References Source::flags, Source::next, and Source::num.

Referenced by parseNoSource().

Package freePackage Package    pkg
 

Destroy package control structure.

Parameters:
pkg  package control structure
Returns:
NULL

Definition at line 157 of file spec.c.

References _free(), Package_s::cpioList, Package_s::ds, Package_s::fileFile, Package_s::fileList, freeSources(), freeStringBuf(), freeTriggerFiles(), Package_s::header, headerFree(), Package_s::icon, Package_s::postInFile, Package_s::postUnFile, Package_s::preInFile, Package_s::preUnFile, rpmdsFree(), rpmfi, rpmfiFree(), Package_s::specialDoc, Package_s::triggerFiles, and Package_s::verifyFile.

Referenced by freePackages().

Package freePackages Package    packages
 

Destroy all packages associated with spec file.

Parameters:
packages  package control structure chain
Returns:
NULL

Definition at line 185 of file spec.c.

References freePackage(), and Package_s::next.

Referenced by freeSpec().

speclines freeSl speclines    sl [inline, static]
 

Definition at line 373 of file spec.c.

References _free(), speclines_s::sl_lines, and speclines_s::sl_nlines.

Referenced by freeSpec().

struct Source* freeSources struct Source   s [inline, static]
 

Destroy source component chain.

Parameters:
s  source component chain
Returns:
NULL always

Definition at line 52 of file spec.c.

References _free(), Source::fullSource, and Source::next.

Referenced by freePackage(), and freeSpec().

Spec freeSpec Spec    spec
 

Destroy Spec structure.

Parameters:
spec  spec file control structure
Returns:
NULL always

Definition at line 480 of file spec.c.

References _free(), Spec_s::BACount, Spec_s::BANames, Spec_s::BASpecs, Spec_s::build, Spec_s::buildRestrictions, Spec_s::buildRootURL, Spec_s::buildSubdir, Spec_s::check, Spec_s::clean, closeSpec(), Spec_s::cookie, OpenFileInfo::fileName, Spec_s::fileStack, freePackages(), freeSl(), freeSources(), freeSt(), freeStringBuf(), headerFree(), Spec_s::install, ReadLevelEntry::next, OpenFileInfo::next, Spec_s::packages, Spec_s::passPhrase, Spec_s::prep, Spec_s::readStack, Spec_s::recursing, Spec_s::rootURL, rpmfi, rpmfiFree(), Spec_s::sl, Spec_s::sourceCpioList, Spec_s::sourceHeader, Spec_s::sourcePkgId, Spec_s::sourceRpmName, Spec_s::sources, Spec_s::specFile, and Spec_s::st.

Referenced by buildForTarget(), parseSpec(), readRPM(), and rpmspecQuery().

spectags freeSt spectags    st [inline, static]
 

Definition at line 406 of file spec.c.

References _free(), spectags_s::st_ntags, spectags_s::st_t, spectag_s::t_lang, and spectag_s::t_msgid.

Referenced by freeSpec().

struct TriggerFileEntry* freeTriggerFiles struct TriggerFileEntry   p [inline, static]
 

Parameters:
p  trigger entry chain
Returns:
NULL always

Definition at line 30 of file spec.c.

References _free(), TriggerFileEntry::fileName, TriggerFileEntry::next, TriggerFileEntry::prog, and TriggerFileEntry::script.

Referenced by freePackage().

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

Find sub-package control structure by name.

Parameters:
spec  spec file control structure
name  (sub-)package name
flag  if PART_SUBNAME, then 1st package name is prepended
Return values:
pkg  package control structure
Returns:
0 on success, 1 on failure

Definition at line 67 of file spec.c.

References alloca(), Package_s::header, headerNVR(), Package_s::next, Spec_s::packages, and PART_SUBNAME.

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

struct OpenFileInfo* newOpenFileInfo void   
 

Definition at line 563 of file spec.c.

References OpenFileInfo::fd, OpenFileInfo::fileName, OpenFileInfo::lineNum, OpenFileInfo::next, OpenFileInfo::readBuf, OpenFileInfo::readPtr, and xmalloc().

Referenced by forceIncludeFile(), and parseSpec().

Package newPackage Spec    spec
 

Create and initialize package control structure.

Parameters:
spec  spec file control structure
Returns:
package control structure

Definition at line 109 of file spec.c.

References Package_s::autoProv, Package_s::autoReq, Package_s::cpioList, Package_s::ds, Package_s::fileFile, Package_s::fileList, Package_s::header, headerNew(), Package_s::icon, Package_s::next, Spec_s::packages, Package_s::postInFile, Package_s::postUnFile, Package_s::preInFile, Package_s::preUnFile, Package_s::specialDoc, Package_s::triggerFiles, Package_s::verifyFile, and xcalloc().

Referenced by parsePreamble(), and readRPM().

Spec newSpec void   
 

Create and initialize Spec structure.

Returns:
spec spec file control structure

Definition at line 420 of file spec.c.

References Spec_s::anyarch, Spec_s::BACount, Spec_s::BANames, Spec_s::BASpecs, Spec_s::build, Spec_s::buildRestrictions, Spec_s::buildRootURL, Spec_s::buildSubdir, Spec_s::check, Spec_s::clean, Spec_s::cookie, Spec_s::fileStack, Spec_s::force, Spec_s::gotBuildRootURL, headerNew(), Spec_s::install, Spec_s::lbuf, Spec_s::line, Spec_s::lineNum, Spec_s::macros, newSl, newSt, ReadLevelEntry::next, Spec_s::nextline, Spec_s::nextpeekc, Spec_s::noSource, Spec_s::numSources, Spec_s::packages, Spec_s::passPhrase, Spec_s::prep, ReadLevelEntry::reading, Spec_s::readStack, Spec_s::recursing, Spec_s::rootURL, 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, and xcalloc().

Referenced by parseSpec(), and readRPM().

int parseNoSource Spec    spec,
const char *    field,
int    tag
 

Parameters:
spec  spec file control structure
field 
tag 

Definition at line 211 of file spec.c.

References _, findSource(), Source::flags, Spec_s::lineNum, parseNum(), RPMBUILD_ISNO, RPMBUILD_ISPATCH, RPMBUILD_ISSOURCE, RPMERR_BADSPEC, rpmError, RPMTAG_NOSOURCE, SKIPNONWHITE, and SKIPWHITE.

Referenced by handlePreambleTag().

void printNewSpecfile Spec    spec [static]
 

Print copy of spec file, filling in Group/Description/Summary from specspo.

Parameters:
spec  spec file control structure

Definition at line 585 of file spec.c.

References _, _free(), Package_s::header, headerNVR(), headerSprintf(), Package_s::next, Spec_s::packages, RPMBUILD_DEFAULT_LANG, RPMERR_QFMT, rpmError, RPMTAG_DESCRIPTION, RPMTAG_GROUP, RPMTAG_SUMMARY, Spec_s::sl, speclines_s::sl_lines, speclines_s::sl_nlines, Spec_s::st, spectags_s::st_ntags, spectags_s::st_t, stpcpy(), spectag_s::t_lang, spectag_s::t_msgid, spectag_s::t_nlines, spectag_s::t_startx, spectag_s::t_tag, tagName(), xmalloc(), and xstrdup().

Referenced by rpmspecQuery().

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

Function to query spec file(s).

Parameters:
ts  transaction set
qva  parsed query/verify options
arg  query argument
Returns:
0 on success, else no. of failures

Definition at line 695 of file spec.c.

References _, freeSpec(), Package_s::header, Package_s::next, Spec_s::packages, parseSpec(), printNewSpecfile(), rpmQVKArguments_s::qva_showPackage, RPMERR_QUERY, rpmError, rpmts, and rpmtsSetSpec().


Variable Documentation

speclines newSl(void) [static]
 

Definition at line 355 of file spec.c.

Referenced by newSpec().

spectags newSt(void) [static]
 

Definition at line 389 of file spec.c.

Referenced by newSpec().


Generated on Sun Oct 26 13:02:04 2003 for rpm by doxygen1.2.18