#include "system.h"#include <stdarg.h>#include "rpmio_internal.h"#include <rpmcli.h>#include <rpmmacro.h>#include <rpmlua.h>#include <rpmds.h>#include <mire.h>#include "misc.h"#include "debug.h"Include dependency graph for rpmrc.c:

Go to the source code of this file.
Data Structures | |
| struct | machCacheEntry_s |
| struct | machCache_s |
| struct | machEquivInfo_s |
| struct | machEquivTable_s |
| struct | rpmvarValue |
| struct | rpmOption |
| struct | defaultEntry_s |
| struct | canonEntry_s |
| struct | tableType_s |
| struct | cpu_vendor_os_gnu |
Defines | |
| #define | __power_pc() 0 |
| #define | _MIRE_INTERNAL |
| #define | RPMVAR_OPTFLAGS 3 |
| #define | RPMVAR_INCLUDE 43 |
| #define | RPMVAR_MACROFILES 49 |
| #define | RPMVAR_NUM 55 |
| #define | OS 0 |
| #define | ARCH 1 |
| #define | _TOPDIRMACRO "%{_topdir}/" |
Typedefs | |
| typedef const char * | cptr_t |
| typedef machCacheEntry_s * | machCacheEntry |
| typedef machCache_s * | machCache |
| typedef machEquivInfo_s * | machEquivInfo |
| typedef machEquivTable_s * | machEquivTable |
| typedef defaultEntry_s * | defaultEntry |
| typedef canonEntry_s * | canonEntry |
| typedef tableType_s * | tableType |
| typedef cpu_vendor_os_gnu * | CVOG_t |
Functions | |
| static void | rpmRebuildTargetVars (const char **target, const char **canontarget) |
| static int | optionCompare (const void *a, const void *b) |
| static machCacheEntry | machCacheFindEntry (const machCache cache, const char *key) |
| static int | machCompatCacheAdd (char *name, const char *fn, int linenum, machCache cache) |
| static machEquivInfo | machEquivSearch (const machEquivTable table, const char *name) |
| static void | machAddEquiv (machEquivTable table, const char *name, int distance) |
| static void | machCacheEntryVisit (machCache cache, machEquivTable table, const char *name, int distance) |
| static void | rebuildCompatTables (int type, const char *name) |
| static int | addCanon (canonEntry *table, int *tableLen, char *line, const char *fn, int lineNum) |
| static int | addDefault (defaultEntry *table, int *tableLen, char *line, const char *fn, int lineNum) |
| static canonEntry | lookupInCanonTable (const char *name, const canonEntry table, int tableLen) |
| static const char * | lookupInDefaultTable (const char *name, const defaultEntry table, int tableLen) |
| static const char * | rpmGetVarArch (int var, const char *arch) |
| static void | freeRpmVar (struct rpmvarValue *orig) |
| static void | rpmSetVar (int var, const char *val) |
| Set value of an rpmrc variable. | |
| static void | setVarDefault (int var, const char *macroname, const char *val, const char *body) |
| static void | setPathDefault (int var, const char *macroname, const char *subdir) |
| static void | setDefaults (void) |
| static void | rpmSetVarArch (int var, const char *val, const char *arch) |
| static int | doReadRC (FD_t fd, const char *urlfn) |
| static int | parseCVOG (const char *str, CVOG_t *cvogp) |
| static void * | mireFreeAll (miRE mire, int nre) |
| Destroy platform patterns. | |
| int | mireAppend (rpmMireMode mode, int tag, const char *pattern, miRE *mi_rep, int *mi_nrep) |
| Append pattern to array. | |
| static int | rpmPlatform (const char *platform) |
| Read and configure /etc/rpm/platform patterns. | |
| int | rpmPlatformScore (const char *platform, void *mi_re, int mi_nre) |
| Return score of a platform string. | |
| static void | defaultMachine (const char **arch, const char **os) |
| void | rpmSetTables (int archTable, int osTable) |
| int | rpmMachineScore (int type, const char *name) |
| void | rpmGetMachine (const char **arch, const char **os) |
| void | rpmSetMachine (const char *arch, const char *os) |
| Set current arch/os names. | |
| static void | getMachineInfo (int type, const char **name, int *num) |
| void | rpmGetArchInfo (const char **name, int *num) |
| void | rpmGetOsInfo (const char **name, int *num) |
| void | rpmFreeRpmrc (void) |
| Destroy rpmrc arch/os compatibility tables. | |
| static int | rpmReadRC (const char *rcfiles) |
| Read rpmrc (and macro) configuration file(s). | |
| int | rpmReadConfigFiles (const char *file, const char *target) |
| Read macro configuration file(s) for a target. | |
| int | rpmShowRC (FILE *fp) |
| Display current rpmrc (and macro) configuration. | |
Variables | |
| const char * | rpmRcfiles = RPMRCFILES |
| The default rpmrc files to be read. | |
| static const char * | configTarget = NULL |
| static const char * | platform = "/etc/rpm/platform" |
| void * | platpat = NULL |
| int | nplatpat = 0 |
| static struct tableType_s | tables [RPM_MACHTABLE_COUNT] |
| static struct rpmOption | optionTable [] |
| static int | optionTableSize = sizeof(optionTable) / sizeof(*optionTable) |
| static cptr_t | current [2] |
| static int | currTables [2] = { RPM_MACHTABLE_INSTOS, RPM_MACHTABLE_INSTARCH } |
| static struct rpmvarValue | values [55] |
| static int | defaultsInitialized = 0 |
| static const char * | ___build_pre |
|
|
Definition at line 12 of file rpmrc.c. Referenced by defaultMachine(). |
|
|
|
|
|
Referenced by setPathDefault(). |
|
|
Definition at line 137 of file rpmrc.c. Referenced by doReadRC(), rpmFreeRpmrc(), rpmGetArchInfo(), rpmGetMachine(), rpmGetVarArch(), rpmRebuildTargetVars(), rpmSetMachine(), rpmSetTables(), and rpmShowRC(). |
|
|
Definition at line 136 of file rpmrc.c. Referenced by rpmFreeRpmrc(), rpmGetMachine(), rpmGetOsInfo(), rpmRebuildTargetVars(), rpmSetMachine(), rpmSetTables(), and rpmShowRC(). |
|
|
Definition at line 121 of file rpmrc.c. Referenced by doReadRC(). |
|
|
Definition at line 122 of file rpmrc.c. Referenced by doReadRC(), and rpmReadRC(). |
|
|
|
|
|
Definition at line 120 of file rpmrc.c. Referenced by rpmRebuildTargetVars(), and setDefaults(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||||||||||||
|
Definition at line 339 of file rpmrc.c. References _, canonEntry_s::name, canonEntry_s::num, RPMERR_RPMRC, rpmError, canonEntry_s::short_name, xrealloc(), and xstrdup(). Referenced by doReadRC(). |
|
||||||||||||||||||||||||
|
Definition at line 393 of file rpmrc.c. References _, defaultEntry_s::defName, defaultEntry_s::name, RPMERR_RPMRC, rpmError, xrealloc(), and xstrdup(). Referenced by doReadRC(). |
|
||||||||||||
|
Definition at line 1287 of file rpmrc.c. References __power_pc, _free(), tableType_s::canonsLength, configTarget, cpu_vendor_os_gnu::cpu, Fclose(), Ferror(), Fopen(), Fread(), lookupInCanonTable(), cpu_vendor_os_gnu::os, parseCVOG(), platform, RPM_MACHTABLE_INSTARCH, RPM_MACHTABLE_INSTOS, rpmExpand(), rpmPlatform(), canonEntry_s::short_name, cpu_vendor_os_gnu::str, xcalloc(), and xisdigit(). Referenced by rpmRebuildTargetVars(), rpmSetMachine(), and rpmSetTables(). |
|
||||||||||||
|
Definition at line 655 of file rpmrc.c. References _, _free(), addCanon(), addDefault(), addMacro(), alloca(), ARCH, rpmOption::archSpecific, current, Fclose(), fdSize(), Ferror(), Fopen(), Fread(), Fstrerror(), rpmOption::localize, machCompatCacheAdd(), rpmOption::macroize, name, rpmOption::name, next, optionCompare(), optionTableSize, RMIL_RPMRC, RPMERR_RPMRC, rpmError, rpmGetPath(), rpmRebuildTargetVars(), rpmSetVarArch(), RPMVAR_INCLUDE, RPMVAR_MACROFILES, rpmOption::var, xisspace(), and xmalloc(). Referenced by rpmReadRC(). |
|
|
Definition at line 481 of file rpmrc.c. References _free(), rpmvarValue::arch, rpmvarValue::next, next, and rpmvarValue::value. Referenced by rpmSetVar(). |
|
||||||||||||||||
|
Definition at line 1689 of file rpmrc.c. References current, currTables, lookupInCanonTable(), canonEntry_s::num, and canonEntry_s::short_name. Referenced by rpmGetArchInfo(), rpmGetOsInfo(), and rpmRebuildTargetVars(). |
|
||||||||||||||||
|
Definition at line 428 of file rpmrc.c. Referenced by defaultMachine(), and getMachineInfo(). |
|
||||||||||||||||
|
Definition at line 445 of file rpmrc.c. References defaultEntry_s::defName. Referenced by rpmSetMachine(). |
|
||||||||||||||||
|
Definition at line 259 of file rpmrc.c. References machEquivTable_s::count, machEquivTable_s::list, machEquivInfo_s::name, machEquivInfo_s::score, xmalloc(), xrealloc(), xstrcasecmp(), and xstrdup(). Referenced by machCacheEntryVisit(), and rebuildCompatTables(). |
|
||||||||||||||||||||
|
Definition at line 287 of file rpmrc.c. References machCacheEntry_s::equivs, machAddEquiv(), machCacheFindEntry(), and machCacheEntry_s::visited. Referenced by rebuildCompatTables(). |
|
||||||||||||
|
Definition at line 165 of file rpmrc.c. References machCache_s::cache, and machCacheEntry_s::name. Referenced by machCacheEntryVisit(), and machCompatCacheAdd(). |
|
||||||||||||||||||||
|
Definition at line 176 of file rpmrc.c. References _, _free(), machCache_s::cache, machCacheEntry_s::count, machCacheEntry_s::equivs, machCacheFindEntry(), machCacheEntry_s::name, RPMERR_RPMRC, rpmError, machCache_s::size, machCacheEntry_s::visited, xisspace(), xmalloc(), xrealloc(), and xstrdup(). Referenced by doReadRC(). |
|
||||||||||||
|
Definition at line 247 of file rpmrc.c. References machEquivTable_s::list, machEquivInfo_s::name, and xstrcasecmp(). |
|
||||||||||||||||||||||||
|
Append pattern to array.
Definition at line 962 of file rpmrc.c. References xrealloc(). Referenced by rpmPlatform(). |
|
||||||||||||
|
Destroy platform patterns.
Definition at line 941 of file rpmrc.c. References _free(). Referenced by rpmFreeRpmrc(), and rpmPlatform(). |
|
||||||||||||
|
Definition at line 157 of file rpmrc.c. References name, and xstrcasecmp(). Referenced by doReadRC(). |
|
||||||||||||
|
Definition at line 880 of file rpmrc.c. References _free(), cpu_vendor_os_gnu::str, xcalloc(), and xstrdup(). Referenced by defaultMachine(), and rpmPlatform(). |
|
||||||||||||
|
Definition at line 308 of file rpmrc.c. References _free(), machCache_s::cache, tableType_s::cache, machEquivTable_s::count, currTables, tableType_s::equiv, machEquivTable_s::list, machAddEquiv(), machCacheEntryVisit(), machEquivInfo_s::name, and machCacheEntry_s::visited. Referenced by rpmSetMachine(), and rpmSetTables(). |
|
||||||||||||
|
|
|
||||||||||||
|
Definition at line 459 of file rpmrc.c. References rpmvarValue::arch, ARCH, current, rpmvarValue::next, next, and rpmvarValue::value. Referenced by rpmReadRC(), rpmRebuildTargetVars(), rpmShowRC(), setPathDefault(), and setVarDefault(). |
|
|
Read and configure /etc/rpm/platform patterns.
Definition at line 985 of file rpmrc.c. References _free(), addMacro(), cpu_vendor_os_gnu::cpu, cpu_vendor_os_gnu::gnu, mireAppend(), mireFreeAll(), nplatpat, cpu_vendor_os_gnu::os, parseCVOG(), platpat, rpmExpand(), rpmioSlurp(), cpu_vendor_os_gnu::str, cpu_vendor_os_gnu::vendor, and xisspace(). Referenced by defaultMachine(). |
|
||||||||||||
|
Definition at line 1722 of file rpmrc.c. References _free(), addMacro(), ARCH, defaultMachine(), delMacro(), getMachineInfo(), OS, RMIL_RPMRC, RPM_MACHTABLE_BUILDARCH, RPM_MACHTABLE_BUILDOS, RPM_MACHTABLE_INSTARCH, RPM_MACHTABLE_INSTOS, rpmcliRcfile, rpmGetVarArch(), rpmSetMachine(), rpmSetTables(), RPMVAR_OPTFLAGS, xmalloc(), xstrcasecmp(), xstrdup(), and xtolower(). Referenced by doReadRC(), and rpmReadConfigFiles(). |
|
||||||||||||||||
|
Definition at line 615 of file rpmrc.c. References _free(), rpmvarValue::arch, rpmvarValue::next, next, rpmvarValue::value, xmalloc(), and xstrdup(). Referenced by doReadRC(). |
|
|
Definition at line 577 of file rpmrc.c. References ___build_pre, addMacro(), RMIL_DEFAULT, RPMVAR_OPTFLAGS, setPathDefault(), and setVarDefault(). Referenced by rpmReadRC(). |
|
||||||||||||||||
|
Definition at line 526 of file rpmrc.c. References _free(), _TOPDIRMACRO, addMacro(), alloca(), body(), RMIL_DEFAULT, rpmGetPath(), rpmGetVarArch(), and rpmSetVar(). Referenced by setDefaults(). |
|
||||||||||||||||||||
|
Definition at line 512 of file rpmrc.c. References addMacro(), RMIL_DEFAULT, rpmGetVarArch(), and rpmSetVar(). Referenced by setDefaults(). |
|
|
Initial value: "\n\ RPM_SOURCE_DIR=\"%{_sourcedir}\"\n\ RPM_BUILD_DIR=\"%{_builddir}\"\n\ RPM_OPT_FLAGS=\"%{optflags}\"\n\ RPM_ARCH=\"%{_arch}\"\n\ RPM_OS=\"%{_os}\"\n\ export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS\n\ RPM_DOC_DIR=\"%{_docdir}\"\n\ export RPM_DOC_DIR\n\ RPM_PACKAGE_NAME=\"%{name}\"\n\ RPM_PACKAGE_VERSION=\"%{version}\"\n\ RPM_PACKAGE_RELEASE=\"%{release}\"\n\ export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE\n\ %{?buildroot:RPM_BUILD_ROOT=\"%{buildroot}\"\n\ export RPM_BUILD_ROOT\n}\ " Definition at line 560 of file rpmrc.c. Referenced by setDefaults(). |
|
|
Definition at line 31 of file rpmrc.c. Referenced by defaultMachine(), and rpmReadConfigFiles(). |
|
|
Definition at line 140 of file rpmrc.c. Referenced by doReadRC(), getMachineInfo(), rpmFreeRpmrc(), rpmGetMachine(), rpmGetVarArch(), rpmSetMachine(), and rpmShowRC(). |
|
|
Definition at line 143 of file rpmrc.c. Referenced by getMachineInfo(), rebuildCompatTables(), rpmSetMachine(), and rpmSetTables(). |
|
|
Definition at line 149 of file rpmrc.c. Referenced by rpmFreeRpmrc(), and rpmReadRC(). |
|
|
Definition at line 38 of file rpmrc.c. Referenced by rpmFreeRpmrc(), rpmPlatform(), rpmPlatformScore(), and rpmtsAddInstallElement(). |
|
|
Initial value: {
{ "include", 43 , 0, 1, 0, 2 },
{ "macrofiles", 49 , 0, 0, 0, 1 },
{ "optflags", 3 , 1, 0, 1, 0 },
}
|
|
|
Definition at line 134 of file rpmrc.c. Referenced by doReadRC(), and rpmShowRC(). |
|
|
Definition at line 34 of file rpmrc.c. Referenced by archScore(), defaultMachine(), parseSpec(), platformScore(), and rpmtsAddInstallElement(). |
|
|
Definition at line 36 of file rpmrc.c. Referenced by rpmFreeRpmrc(), rpmPlatform(), rpmPlatformScore(), and rpmtsAddInstallElement(). |
|
|
Initial value: {
{ "arch", 1, 0 },
{ "os", 1, 0 },
{ "buildarch", 0, 1 },
{ "buildos", 0, 1 }
}
|
|
|
|
1.4.4