rpm  4.5
Files | Functions | Variables
RPMRC.
Collaboration diagram for RPMRC.:

Files

file  rpmlib.h
 In Memoriam: Steve Taylor stayl.nosp@m.or@r.nosp@m.edhat.nosp@m..com was here, now he's not.
 
file  macro.c
 

Functions

static void rpmSetVar (int var, const char *val)
 Set value of an rpmrc variable. More...
 
static int rpmReadRC (const char *rcfiles)
 Read rpmrc (and macro) configuration file(s). More...
 

Variables

const char * rpmMacrofiles
 List of macro files to read when configuring rpm. More...
 

RPMRC

enum  rpm_machtable_e { RPM_MACHTABLE_INSTARCH = 0, RPM_MACHTABLE_INSTOS = 1, RPM_MACHTABLE_BUILDARCH = 2, RPM_MACHTABLE_BUILDOS = 3 }
 Build and install arch/os table identifiers. More...
 
const char * rpmRcfiles
 The default rpmrc files to be read. More...
 
int rpmReadConfigFiles (const char *file, const char *target)
 Read macro configuration file(s) for a target. More...
 
void rpmGetArchInfo (const char **name, int *num)
 
void rpmGetOsInfo (const char **name, int *num)
 
int rpmMachineScore (int type, const char *name)
 
int rpmPlatformScore (const char *platform, void *mi_re, int mi_nre)
 Return score of a platform string. More...
 
int rpmShowRC (FILE *fp)
 Display current rpmrc (and macro) configuration. More...
 
void rpmSetTables (int archTable, int osTable)
 
void rpmSetMachine (const char *arch, const char *os)
 Set current arch/os names. More...
 
void rpmFreeRpmrc (void)
 Destroy rpmrc arch/os compatibility tables. More...
 

Detailed Description

Enumeration Type Documentation

Build and install arch/os table identifiers.

Deprecated:
Eliminate from API.
Enumerator
RPM_MACHTABLE_INSTARCH 

Install platform architecture.

RPM_MACHTABLE_INSTOS 

Install platform operating system.

RPM_MACHTABLE_BUILDARCH 

Build platform architecture.

RPM_MACHTABLE_BUILDOS 

Build platform operating system.

Definition at line 584 of file rpmlib.h.

Function Documentation

void rpmFreeRpmrc ( void  )
void rpmGetArchInfo ( const char **  name,
int *  num 
)
Deprecated:
Expand %{_host_cpu}/%{_target_cpu} for the canonical/current cpu. Return current arch name and/or number.
Todo:
Generalize to extract arch component from target_platform macro.
Return values
nameaddress of arch name (or NULL)
numaddress of arch number (or NULL)

Definition at line 1712 of file rpmrc.c.

References ARCH, and getMachineInfo().

void rpmGetOsInfo ( const char **  name,
int *  num 
)
Deprecated:
Expand %{_host_os}/%{_target_os} for the canonical/current os. Return current os name and/or number.
Todo:
Generalize to extract os component from target_platform macro.
Return values
nameaddress of os name (or NULL)
numaddress of os number (or NULL)

Definition at line 1717 of file rpmrc.c.

References getMachineInfo(), and OS.

int rpmMachineScore ( int  type,
const char *  name 
)
Deprecated:
Use rpmPlatformScore instead. Return arch/os score of a name. An arch/os score measures the "nearness" of a name to the currently running (or defined) platform arch/os. For example, the score of arch "i586" on an i686 platform is (usually) 2. The arch/os score is used to select one of several otherwise identical packages using the arch/os tags from the header as hints of the intended platform for the package.
Parameters
typeany of the RPM_MACHTABLE_* constants
namename
Returns
arch score (0 is no match, lower is preferred)

Definition at line 1616 of file rpmrc.c.

References _free(), RPM_MACHTABLE_BUILDARCH, RPM_MACHTABLE_BUILDOS, RPM_MACHTABLE_INSTARCH, RPM_MACHTABLE_INSTOS, rpmExpand(), and rpmPlatformScore().

int rpmPlatformScore ( const char *  platform,
void *  mi_re,
int  mi_nre 
)

Return score of a platform string.

A platform score measures the "nearness" of a platform string wrto configured platform patterns. The returned score is the line number of the 1st pattern in /etc/rpm/platform that matches the input string.

Parameters
platformcpu-vendor-os platform string
mi_repattern array (NULL uses /etc/rpm/platform patterns)
mi_nreno. of patterns
Returns
platform score (0 is no match, lower is preferred)

Definition at line 1061 of file rpmrc.c.

References nplatpat, and platpat.

Referenced by archScore(), platformScore(), rpmMachineScore(), and rpmtsAddInstallElement().

int rpmReadConfigFiles ( const char *  file,
const char *  target 
)

Read macro configuration file(s) for a target.

Parameters
filecolon separated files to read (NULL uses default)
targettarget platform (NULL uses default)
Returns
0 on success, -1 on error

Definition at line 2008 of file rpmrc.c.

References _free(), configTarget, rpmExpand(), rpmReadRC(), rpmRebuildTargetVars(), and rpmSetMachine().

Referenced by init_rpm(), main(), rpmcliConfigured(), and rpmspecQuery().

static int rpmReadRC ( const char *  rcfiles)
static

Read rpmrc (and macro) configuration file(s).

Parameters
rcfilescolon separated files to read (NULL uses default)
Returns
0 on succes

Definition at line 1899 of file rpmrc.c.

References _, _free(), doReadRC(), Ferror(), Fopen(), Fstrerror(), getenv(), RPMERR_RPMRC, rpmError, rpmExpand(), rpmGetVarArch(), rpmInitMacros(), rpmMacrofiles, rpmRcfiles, RPMVAR_MACROFILES, setDefaults(), and xstrdup().

Referenced by rpmReadConfigFiles().

void rpmSetMachine ( const char *  arch,
const char *  os 
)

Set current arch/os names.

NULL as argument is set to the default value (munged uname()) pushed through a translation table (if appropriate).

Deprecated:
Use addMacro to set target* macros.
Todo:
Eliminate from API.
Parameters
archarch name (or NULL)
osos name (or NULL)

Definition at line 1650 of file rpmrc.c.

References _free(), ARCH, defaultMachine(), lookupInDefaultTable(), OS, rebuildCompatTables(), and xstrdup().

Referenced by rpmReadConfigFiles(), rpmRebuildTargetVars(), and rpmShowRC().

void rpmSetTables ( int  archTable,
int  osTable 
)
Deprecated:
Use addMacro to set target* macros.
Todo:
Eliminate from API. #
Note
Only used by build code.
Parameters
archTable
osTable

Definition at line 1597 of file rpmrc.c.

References ARCH, defaultMachine(), OS, and rebuildCompatTables().

Referenced by rpmRebuildTargetVars(), and rpmShowRC().

static void rpmSetVar ( int  var,
const char *  val 
)
static

Set value of an rpmrc variable.

Deprecated:
Use rpmDefineMacro() to change appropriate macro instead.

Definition at line 502 of file rpmrc.c.

References freeRpmVar(), rpmvarValue::value, values, and xstrdup().

Referenced by setPathDefault(), and setVarDefault().

int rpmShowRC ( FILE *  fp)

Variable Documentation

const char* rpmMacrofiles

List of macro files to read when configuring rpm.

This is a colon separated list of files. URI's are permitted as well, identified by the token '://', so file paths must not begin with '//'.

Definition at line 61 of file macro.c.

Referenced by rpmReadRC(), and rpmShowRC().

const char* rpmRcfiles

The default rpmrc files to be read.

Deprecated:
The rpmrc files are no longer parsed by default.

Definition at line 28 of file rpmrc.c.

Referenced by rpmReadRC().