rpm 5.3.12
Defines | Functions | Variables
build/spec.c File Reference

Handle spec data structure. More...

#include "system.h"
#include <rpmio.h>
#include <rpmiotypes.h>
#include <rpmlog.h>
#include <rpmpgp.h>
#include "buildio.h"
#include "rpmds.h"
#include "rpmfi.h"
#include "rpmts.h"
#include "rpmlua.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.
rpmRC lookupPackage (Spec spec, const char *name, int flag, Package *pkgp)
 Find sub-package control structure by name.
static void pkgFini (void *_pkg)
static Package pkgGetPool (rpmioPool pool)
Package newPackage (Spec spec)
 Create and initialize package control structure.
Package freePackages (Package packages)
 Destroy all packages associated with spec file.
static struct SourcefindSource (Spec spec, rpmuint32_t num, int flag)
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.
int parseNoSource (Spec spec, const char *field, rpmTag tag)
 parseNoSource.
int addSource (Spec spec, Package pkg, const char *field, rpmTag tag)
 addSource.
static speclines newSl (void)
static speclines freeSl (speclines sl)
static spectags newSt (void)
static spectags freeSt (spectags st)
static void specFini (void *_spec)
static Spec specGetPool (rpmioPool pool)
Spec newSpec (void)
 Create and initialize Spec structure.
struct 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, rpmiob iob)
 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 _pkg_debug
int _spec_debug
int specedit
rpmioPool _pkgPool
rpmioPool _specPool

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

Referenced by parseNoSource().

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

Definition at line 32 of file spec.c.

Referenced by parseNoSource().


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:
tsrpm transaction
qvaquery args
specNamespecfile to parse
targetcpu-vender-os platform for query (NULL is current)
Returns:
0 on success

Definition at line 909 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, rpmlog(), RPMLOG_ERR, RPMQV_SPECFILE, RPMQV_SPECSRPM, rpmtsSetSpec(), Spec_s::sourceHeader, and specedit.

Referenced by rpmspecQuery().

static struct Source* findSource ( Spec  spec,
rpmuint32_t  num,
int  flag 
) [static, read]

Definition at line 255 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 503 of file spec.c.

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

Referenced by specFini().

static struct Source* freeSources ( struct Source s) [static, read]

Destroy source component chain.

Parameters:
ssource component chain
Returns:
NULL always

Definition at line 64 of file spec.c.

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

Referenced by specFini().

static spectags freeSt ( spectags  st) [inline, static]

Definition at line 533 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 specFini().

static struct TriggerFileEntry* freeTriggerFiles ( struct TriggerFileEntry p) [static, read]
Parameters:
ptrigger entry chain
Returns:
NULL always

Definition at line 42 of file spec.c.

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

Referenced by pkgFini().

static int initSourceHeaderScriptlet ( Header  h,
rpmTag  progTag,
rpmTag  scriptTag,
rpmiob  iob 
) [static]

Add expanded build scriptlet to srpm header.

Parameters:
hsrpm header
progTaginterpreter tag (0 disables)
scriptTagscript tag (0 disables)
iobscript body sting buf (NULL disables)
Returns:
0 always

Definition at line 846 of file spec.c.

References alloca(), _HE_s::c, headerPut(), _HE_s::p, prog, RPM_STRING_TYPE, rpmiobStr(), rpmDataType_u::str, _HE_s::t, and _HE_s::tag.

Referenced by initSourceHeaderScriptlets().

static int initSourceHeaderScriptlets ( Spec  spec) [static]

Add expanded build scriptlets to srpm header.

Parameters:
specspec file control structure
Returns:
0 always

Definition at line 877 of file spec.c.

References Spec_s::build, Spec_s::check, Spec_s::clean, initSourceHeaderScriptlet(), Spec_s::install, Spec_s::prep, Spec_s::sourceHeader, and tagValue().

Referenced by _specQuery().

static speclines newSl ( void  ) [inline, static]

Definition at line 488 of file spec.c.

References speclines_s::sl_lines, speclines_s::sl_nalloc, speclines_s::sl_nlines, specedit, and xmalloc().

Referenced by newSpec().

static spectags newSt ( void  ) [inline, static]

Definition at line 518 of file spec.c.

References specedit, spectags_s::st_nalloc, spectags_s::st_ntags, spectags_s::st_t, and xmalloc().

Referenced by newSpec().

static void pkgFini ( void *  _pkg) [static]
static Package pkgGetPool ( rpmioPool  pool) [static]

Definition at line 190 of file spec.c.

References _pkg_debug, _pkgPool, pkgFini(), rpmioGetPool(), and rpmioNewPool().

Referenced by newPackage().

static void printNewSpecfile ( Spec  spec) [static]
static void specFini ( void *  _spec) [static]
static Spec specGetPool ( rpmioPool  pool) [static]

Definition at line 627 of file spec.c.

References _spec_debug, _specPool, rpmioGetPool(), rpmioNewPool(), and specFini().

Referenced by newSpec().


Variable Documentation

Definition at line 23 of file spec.c.

Referenced by pkgGetPool().

Definition at line 188 of file spec.c.

Referenced by main(), and pkgGetPool().

Definition at line 26 of file spec.c.

Referenced by specGetPool().

Definition at line 625 of file spec.c.

Referenced by main(), and specGetPool().

int specedit

Definition at line 22 of file poptQV.c.

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