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"

Include dependency graph for spec.c:

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

static struct TriggerFileEntryfreeTriggerFiles (struct TriggerFileEntry *p)
static struct SourcefreeSources (struct Source *s)
 Destroy source component chain.
int 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 freePackage (Package pkg)
 Destroy package control structure.
Package freePackages (Package packages)
 Destroy all packages associated with spec file.
static struct 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)
static speclines newSl (void)
static speclines freeSl (speclines sl)
static spectags newSt (void)
static spectags freeSt (spectags st)
Spec newSpec (void)
 Create and initialize Spec structure.
Spec freeSpec (Spec spec)
 Destroy Spec structure.
OpenFileInfonewOpenFileInfo (void)
static void printNewSpecfile (Spec spec)
 Print copy of spec file, filling in Group/Description/Summary from specspo.
static int initSourceHeaderScriptlet (Header h, rpmTag progTag, rpmTag scriptTag, StringBuf sb)
 Add expanded build scriptlet to srpm header.
static int initSourceHeaderScriptlets (Spec spec)
 Add expanded build scriptlets to srpm header.
static int _specQuery (rpmts ts, QVA_t qva, const char *specName, const char *target)
 Parse a spec file, and query the resultant header.
int rpmspecQuery (rpmts ts, QVA_t qva, const char *arg)
 Function to query spec file(s).

Variables

int specedit


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

static int _specQuery rpmts  ts,
QVA_t  qva,
const char *  specName,
const char *  target
[static]
 

Parse a spec file, and query the resultant header.

Parameters:
ts rpm transaction
qva query args
specName specfile to parse
target cpu-vender-os platform for query (NULL is current)
Returns:
0 on success

Definition at line 747 of file spec.c.

References _, Package_s::fileList, freeSpec(), Package_s::header, initSourceHeader(), initSourceHeaderScriptlets(), Package_s::next, Spec_s::packages, parseSpec(), printNewSpecfile(), rpmQVKArguments_s::qva_showPackage, rpmQVKArguments_s::qva_source, RPMERR_QUERY, rpmError, RPMQV_SPECFILE, RPMQV_SPECSRPM, rpmtsSetSpec(), Spec_s::sourceHeader, and specedit.

Referenced by rpmspecQuery().

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

Definition at line 197 of file spec.c.

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

Referenced by parseNoSource().

static speclines freeSl speclines  sl  )  [inline, static]
 

Definition at line 369 of file spec.c.

References _free(), and speclines_s::sl_lines.

Referenced by freeSpec().

static 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 freeSpec().

static spectags freeSt spectags  st  )  [inline, static]
 

Definition at line 402 of file spec.c.

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

Referenced by freeSpec().

static 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().

static int initSourceHeaderScriptlet Header  h,
rpmTag  progTag,
rpmTag  scriptTag,
StringBuf  sb
[static]
 

Add expanded build scriptlet to srpm header.

Parameters:
h srpm header
progTag interpreter tag (0 disables)
scriptTag script tag (0 disables)
sb script body sting buf (NULL disables)
Returns:
0 always

Definition at line 693 of file spec.c.

References getStringBuf(), headerAddEntry(), prog, and RPM_STRING_TYPE.

Referenced by initSourceHeaderScriptlets().

static int initSourceHeaderScriptlets Spec  spec  )  [static]
 

Add expanded build scriptlets to srpm header.

Parameters:
spec spec file control structure
Returns:
0 always

Definition at line 715 of file spec.c.

References Spec_s::build, Spec_s::check, Spec_s::clean, initSourceHeaderScriptlet(), Spec_s::install, Spec_s::prep, RPMTAG_Buildbuild, RPMTAG_Buildbuildprog, RPMTAG_Buildcheck, RPMTAG_Buildcheckprog, RPMTAG_Buildclean, RPMTAG_Buildcleanprog, RPMTAG_Buildinstall, RPMTAG_Buildinstallprog, RPMTAG_Buildprep, RPMTAG_Buildprepprog, and Spec_s::sourceHeader.

Referenced by _specQuery().

static speclines newSl void   )  [inline, static]
 

Definition at line 351 of file spec.c.

References specedit, and xmalloc().

Referenced by newSpec().

static spectags newSt void   )  [inline, static]
 

Definition at line 385 of file spec.c.

References specedit, and xmalloc().

Referenced by newSpec().

static 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 577 of file spec.c.

References _, _free(), Package_s::header, headerNVR(), headerSprintf(), Package_s::next, Spec_s::packages, RPMBUILD_DEFAULT_LANG, RPMERR_QFMT, rpmError, rpmHeaderFormats, RPMTAG_DESCRIPTION, RPMTAG_GROUP, RPMTAG_SUMMARY, rpmTagTable, Spec_s::sl, speclines_s::sl_lines, Spec_s::st, 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 _specQuery().


Variable Documentation

int specedit
 

Definition at line 18 of file poptQV.c.

Referenced by _specQuery(), newSl(), and newSt().


Generated on Wed Dec 28 00:15:35 2016 for rpm by  doxygen 1.4.4