rpmdb/legacy.h File Reference

Go to the source code of this file.

Functions

int domd5 (const char *fn, unsigned char *digest, int asAscii, size_t *fsizep)
 Return MD5 sum and size of a file.
void compressFilelist (Header h)
 Convert absolute path tag to (dirname,basename,dirindex) tags.
void rpmfiBuildFNames (Header h, rpmTag tagN, const char ***fnp, int *fcp)
 Retrieve file names from header.
void expandFilelist (Header h)
 Convert (dirname,basename,dirindex) tags to absolute path tag.
void providePackageNVR (Header h)
 Retrofit a Provides: name = version-release dependency into legacy package headers.
void legacyRetrofit (Header h, const struct rpmlead *lead)
 Do all necessary retorfits for a package header.

Variables

int _noDirTokens
 Should version 3 packages be produced?


Detailed Description

Definition in file legacy.h.


Function Documentation

void compressFilelist ( Header  h  ) 

Convert absolute path tag to (dirname,basename,dirindex) tags.

Parameters:
h header

Definition at line 270 of file legacy.c.

References alloca(), dncmp(), headerAddEntry(), headerFreeData(), headerGetEntryMinMemory(), headerIsEntry(), headerRemoveEntry(), RPM_INT32_TYPE, RPM_STRING_ARRAY_TYPE, RPMTAG_BASENAMES, RPMTAG_DIRINDEXES, RPMTAG_DIRNAMES, and RPMTAG_OLDFILENAMES.

Referenced by genCpioListAndHeader(), hdrCompressFilelist(), hdrLoad(), legacyRetrofit(), mungeFilelist(), and rpmReadHeaders().

int domd5 ( const char *  fn,
unsigned char *  digest,
int  asAscii,
size_t *  fsizep 
)

Return MD5 sum and size of a file.

Parameters:
fn file name
Return values:
digest address of md5sum
Parameters:
asAscii return md5sum as ascii string?
Return values:
*fsizep file size pointer (or NULL)
Returns:
0 on success, 1 on error

Definition at line 148 of file legacy.c.

References _free(), Fclose(), fdDup(), fdFiniDigest(), fdInitDigest(), Ferror(), Fopen(), Fread(), open_dso(), PGPHASHALGO_MD5, RPMDIGEST_NONE, rpmDigestFinal(), rpmDigestInit(), rpmDigestUpdate(), URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().

Referenced by genCpioListAndHeader(), handleOverlappedFiles(), rpmAddSignature(), rpmfiConfigConflict(), rpmfiDecideFate(), and rpmVerifyFile().

void expandFilelist ( Header  h  ) 

Convert (dirname,basename,dirindex) tags to absolute path tag.

Parameters:
h header

Definition at line 421 of file legacy.c.

References _free(), headerAddEntry(), headerIsEntry(), headerRemoveEntry(), RPM_STRING_ARRAY_TYPE, rpmfiBuildFNames(), RPMTAG_BASENAMES, RPMTAG_DIRINDEXES, RPMTAG_DIRNAMES, and RPMTAG_OLDFILENAMES.

Referenced by genCpioListAndHeader(), hdrExpandFilelist(), and rpmdbAdd().

void legacyRetrofit ( Header  h,
const struct rpmlead lead 
)

Do all necessary retorfits for a package header.

Parameters:
h header
lead 

Definition at line 530 of file legacy.c.

References alloca_strdup, compressFilelist(), headerAddEntry(), headerGetEntry(), headerIsEntry(), headerRemoveEntry(), rpmlead::major, providePackageNVR(), RPM_INT32_TYPE, RPM_STRING_ARRAY_TYPE, RPMLEAD_SOURCE, RPMTAG_DEFAULTPREFIX, RPMTAG_FILEGIDS, RPMTAG_FILEGROUPNAME, RPMTAG_FILEUIDS, RPMTAG_FILEUSERNAME, RPMTAG_PREFIXES, RPMTAG_SOURCEPACKAGE, stripTrailingChar(), and rpmlead::type.

Referenced by rpmReadPackageFile().

void providePackageNVR ( Header  h  ) 

Retrofit a Provides: name = version-release dependency into legacy package headers.

Parameters:
h header

Definition at line 449 of file legacy.c.

References alloca(), headerAddOrAppendEntry(), headerFreeData(), headerGetEntryMinMemory(), headerNVR(), RPM_INT32_TYPE, RPM_STRING_ARRAY_TYPE, RPMSENSE_ANY, RPMSENSE_EQUAL, RPMTAG_EPOCH, RPMTAG_PROVIDEFLAGS, RPMTAG_PROVIDENAME, RPMTAG_PROVIDEVERSION, and stpcpy().

Referenced by hdrLoad(), legacyRetrofit(), packageBinaries(), rpmReadHeaders(), and writeRPM().

void rpmfiBuildFNames ( Header  h,
rpmTag  tagN,
const char ***  fnp,
int *  fcp 
)

Retrieve file names from header.

The representation of file names in package headers changed in rpm-4.0. Originally, file names were stored as an array of absolute paths. In rpm-4.0, file names are stored as separate arrays of dirname's and basename's, * with a dirname index to associate the correct dirname with each basname.

This function is used to retrieve file names independent of how the file names are represented in the package header.

Parameters:
h header
tagN RPMTAG_BASENAMES | PMTAG_ORIGBASENAMES
Return values:
*fnp array of file names
*fcp number of files

Definition at line 362 of file legacy.c.

References _free(), headerFreeData(), headerGetEntryMinMemory(), RPMTAG_BASENAMES, RPMTAG_DIRINDEXES, RPMTAG_DIRNAMES, RPMTAG_ORIGBASENAMES, RPMTAG_ORIGDIRINDEXES, RPMTAG_ORIGDIRNAMES, stpcpy(), and xmalloc().

Referenced by expandFilelist(), filenamesTag(), fssizesTag(), mungeFilelist(), rpmHeaderGetEntry(), rpmInstallSourcePackage(), and rpmpsmStage().


Generated on Fri Oct 12 08:44:56 2007 for rpm by  doxygen 1.5.2