rpm  4.8.1
Functions | Variables
rpmlib.h File Reference

In Memoriam: Steve Taylor stayl.nosp@m.or@r.nosp@m.edhat.nosp@m..com was here, now he's not. More...

#include <popt.h>
#include <rpm/rpmio.h>
#include <rpm/header.h>
#include <rpm/rpmtag.h>
#include <rpm/rpmds.h>
#include <rpm/rpmpgp.h>
Include dependency graph for rpmlib.h:

Go to the source code of this file.

Functions

void headerMergeLegacySigs (Header h, const Header sigh)
 Translate and merge legacy signature tags into header. More...
 
Header headerRegenSigHeader (const Header h, int noArchiveSize)
 Regenerate signature header. More...
 

Variables

struct rpmMacroContext_s * rpmGlobalMacroContext
 
struct rpmMacroContext_s * rpmCLIMacroContext
 
const char *const RPMVERSION
 
const char *const rpmNAME
 
const char *const rpmEVR
 
const int rpmFLAGS
 

RPMRC

#define RPM_MACHTABLE_COUNT   4
 
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...
 
int rpmReadConfigFiles (const char *file, const char *target)
 Read macro configuration file(s) for a target. More...
 
void rpmGetArchInfo (const char **name, int *num)
 Return current arch name and/or number. More...
 
void rpmGetOsInfo (const char **name, int *num)
 Return current os name and/or number. More...
 
int rpmMachineScore (int type, const char *name)
 Return arch/os score of a name. More...
 
int rpmShowRC (FILE *fp)
 Display current rpmrc (and macro) configuration. More...
 
void rpmSetTables (int archTable, int osTable)
 
void rpmFreeRpmrc (void)
 Destroy rpmrc arch/os compatibility tables. More...
 
int rpmVersionCompare (Header first, Header second)
 Compare headers to determine which header is "newer". More...
 
rpmRC headerCheckPayloadFormat (Header h)
 Check for supported payload format in header. More...
 
rpmRC headerCheck (rpmts ts, const void *uh, size_t uc, char **msg)
 Check header consistency, performing headerGetEntry() the hard way. More...
 
rpmRC rpmReadHeader (rpmts ts, FD_t fd, Header *hdrp, char **msg)
 Return checked and loaded header. More...
 
rpmRC rpmReadPackageFile (rpmts ts, FD_t fd, const char *fn, Header *hdrp)
 Return package header from file handle, verifying digests/signatures. More...
 
rpmRC rpmInstallSourcePackage (rpmts ts, FD_t fd, char **specFilePtr, char **cookie)
 Install source package. More...
 
int rpmvercmp (const char *a, const char *b)
 Segmented string compare for version or release strings. More...
 
void rpmFreeFilesystems (void)
 Release storage used by file system usage cache. More...
 
int rpmGetFilesystemList (const char ***listptr, unsigned int *num)
 Return (cached) file system mount points. More...
 
int rpmGetFilesystemUsage (const char **fileList, rpm_loff_t *fssizes, unsigned int numFiles, rpm_loff_t **usagesPtr, int flags)
 Determine per-file system usage for a list of files. More...
 

Detailed Description

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

Definition in file rpmlib.h.

Macro Definition Documentation

◆ RPM_MACHTABLE_COUNT

#define RPM_MACHTABLE_COUNT   4

No. of arch/os tables.

Definition at line 68 of file rpmlib.h.

Enumeration Type Documentation

◆ rpm_machtable_e

Build and install arch/os table identifiers.

Todo:
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 62 of file rpmlib.h.

Function Documentation

◆ headerCheck()

rpmRC headerCheck ( rpmts  ts,
const void *  uh,
size_t  uc,
char **  msg 
)

Check header consistency, performing headerGetEntry() the hard way.

Sanity checks on the header are performed while looking for a header-only digest or signature to verify the blob. If found, the digest or signature is verified.

Parameters
tstransaction set
uhunloaded header blob
ucno. of bytes in blob (or 0 to disable)
Return values
*msgverification error message (or NULL)
Returns
RPMRC_OK on success

◆ headerCheckPayloadFormat()

rpmRC headerCheckPayloadFormat ( Header  h)

Check for supported payload format in header.

Parameters
hheader to check
Returns
RPMRC_OK if supported, RPMRC_FAIL otherwise

◆ headerMergeLegacySigs()

void headerMergeLegacySigs ( Header  h,
const Header  sigh 
)

Translate and merge legacy signature tags into header.

Todo:
Remove headerSort() through headerInitIterator() modifies sig.
Parameters
hheader
sighsignature header

◆ headerRegenSigHeader()

Header headerRegenSigHeader ( const Header  h,
int  noArchiveSize 
)

Regenerate signature header.

Todo:
Remove headerSort() through headerInitIterator() modifies h.
Parameters
hheader
noArchiveSizedon't copy archive size tag (pre rpm-4.1)
Returns
regenerated signature header

◆ rpmFreeFilesystems()

void rpmFreeFilesystems ( void  )

Release storage used by file system usage cache.

Referenced by main().

◆ rpmFreeRpmrc()

void rpmFreeRpmrc ( void  )

Destroy rpmrc arch/os compatibility tables.

Todo:
Eliminate from API.

Referenced by build(), and main().

◆ rpmGetArchInfo()

void rpmGetArchInfo ( const char **  name,
int *  num 
)

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)

◆ rpmGetFilesystemList()

int rpmGetFilesystemList ( const char ***  listptr,
unsigned int *  num 
)

Return (cached) file system mount points.

Return values
listptraddess of file system names (or NULL)
numaddress of number of file systems (or NULL)
Returns
0 on success, 1 on error

◆ rpmGetFilesystemUsage()

int rpmGetFilesystemUsage ( const char **  fileList,
rpm_loff_t fssizes,
unsigned int  numFiles,
rpm_loff_t **  usagesPtr,
int  flags 
)

Determine per-file system usage for a list of files.

Parameters
fileListarray of absolute file names
fssizesarray of file sizes
numFilesnumber of files in list
Return values
usagesPtraddress of per-file system usage array (or NULL)
Parameters
flags(unused)
Returns
0 on success, 1 on error

◆ rpmGetOsInfo()

void rpmGetOsInfo ( const char **  name,
int *  num 
)

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)

◆ rpmInstallSourcePackage()

rpmRC rpmInstallSourcePackage ( rpmts  ts,
FD_t  fd,
char **  specFilePtr,
char **  cookie 
)

Install source package.

Parameters
tstransaction set
fdfile handle
Return values
specFilePtraddress of spec file name (or NULL)
cookieaddress of cookie pointer (or NULL)
Returns
rpmRC return code

◆ rpmMachineScore()

int rpmMachineScore ( int  type,
const char *  name 
)

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.

Todo:
Rewrite to use RE's against config.guess target platform output.
Parameters
typeany of the RPM_MACHTABLE_* constants
namename
Returns
arch score (0 is no match, lower is preferred)

◆ rpmReadConfigFiles()

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

Referenced by build(), and main().

◆ rpmReadHeader()

rpmRC rpmReadHeader ( rpmts  ts,
FD_t  fd,
Header hdrp,
char **  msg 
)

Return checked and loaded header.

Parameters
tstransaction set
fdfile handle
Return values
hdrpaddress of header (or NULL)
*msgverification error message (or NULL)
Returns
RPMRC_OK on success

◆ rpmReadPackageFile()

rpmRC rpmReadPackageFile ( rpmts  ts,
FD_t  fd,
const char *  fn,
Header hdrp 
)

Return package header from file handle, verifying digests/signatures.

Parameters
tstransaction set
fdfile handle
fnfile name
Return values
hdrpaddress of header (or NULL)
Returns
RPMRC_OK on success

Referenced by main().

◆ rpmSetTables()

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

Referenced by buildForTarget().

◆ rpmShowRC()

int rpmShowRC ( FILE *  fp)

Display current rpmrc (and macro) configuration.

Parameters
fpoutput file handle
Returns
0 always

◆ rpmvercmp()

int rpmvercmp ( const char *  a,
const char *  b 
)

Segmented string compare for version or release strings.

Parameters
a1st string
b2nd string
Returns
+1 if a is "newer", 0 if equal, -1 if b is "newer"

◆ rpmVersionCompare()

int rpmVersionCompare ( Header  first,
Header  second 
)

Compare headers to determine which header is "newer".

Parameters
first1st header
second2nd header
Returns
result of comparison

Variable Documentation

◆ rpmCLIMacroContext

struct rpmMacroContext_s* rpmCLIMacroContext

◆ rpmEVR

const char* const rpmEVR

Referenced by printVersion().

◆ rpmFLAGS

const int rpmFLAGS

◆ rpmGlobalMacroContext

struct rpmMacroContext_s* rpmGlobalMacroContext

◆ rpmNAME

const char* const rpmNAME

◆ RPMVERSION

const char* const RPMVERSION