Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages

build/pack.c File Reference

Assemble components of an RPM package. More...

#include "system.h"
#include <rpmio_internal.h>
#include <rpmbuild.h>
#include "rpmps.h"
#include "cpio.h"
#include "fsm.h"
#include "psm.h"
#include "rpmfi.h"
#include "rpmts.h"
#include "buildio.h"
#include "legacy.h"
#include "signature.h"
#include "rpmlead.h"
#include "debug.h"

Go to the source code of this file.

Defines

#define _RPMFI_INTERNAL
#define RPMPKGVERSION_MIN   30004
#define RPMPKGVERSION_MAX   40003

Functions

int genSourceRpmName (Spec spec)
int cpio_doio (FD_t fdo, Header h, CSA_t csa, const char *fmodeMacro)
int cpio_copy (FD_t fdo, CSA_t csa)
StringBuf addFileToTagAux (Spec spec, const char *file, StringBuf sb)
int addFileToTag (Spec spec, const char *file, Header h, int tag)
int addFileToArrayTag (Spec spec, const char *file, Header h, int tag)
int processScriptFiles (Spec spec, Package pkg)
int readRPM (const char *fileName, Spec *specp, struct rpmlead *lead, Header *sigs, CSA_t csa)
 Read rpm package components from file.

int rpmLeadVersion (void)
int writeRPM (Header *hdrp, unsigned char **pkgidp, const char *fileName, int type, CSA_t csa, char *passPhrase, const char **cookie)
 Write rpm package to file.

int packageBinaries (Spec spec)
int packageSources (Spec spec)

Variables

int rpmpkg_version = -1
int_32 copyTags []


Detailed Description

Assemble components of an RPM package.

Definition in file pack.c.


Define Documentation

#define _RPMFI_INTERNAL
 

Definition at line 17 of file pack.c.

#define RPMPKGVERSION_MAX   40003
 

Definition at line 381 of file pack.c.

Referenced by rpmLeadVersion().

#define RPMPKGVERSION_MIN   30004
 

Definition at line 380 of file pack.c.

Referenced by rpmLeadVersion().


Function Documentation

int addFileToArrayTag Spec  spec,
const char *  file,
Header  h,
int  tag
[static]
 

Definition at line 193 of file pack.c.

References addFileToTagAux(), freeStringBuf(), getStringBuf(), Header, headerAddOrAppendEntry(), newStringBuf(), RPM_STRING_ARRAY_TYPE, Spec, and StringBuf.

Referenced by processScriptFiles().

int addFileToTag Spec  spec,
const char *  file,
Header  h,
int  tag
[static]
 

Definition at line 169 of file pack.c.

References addFileToTagAux(), appendLineStringBuf, freeStringBuf(), getStringBuf(), Header, headerAddEntry(), headerRemoveEntry(), HGE_t, newStringBuf(), RPM_STRING_TYPE, Spec, and StringBuf.

Referenced by processScriptFiles().

StringBuf addFileToTagAux Spec  spec,
const char *  file,
StringBuf  sb
[static]
 

Definition at line 131 of file pack.c.

References _, _free(), appendStringBuf, Spec_s::buildSubdir, expandMacros(), Fclose(), FD_t, fdGetFp(), Ferror(), Fopen(), freeStringBuf(), Spec_s::macros, RPMERR_BADSPEC, rpmError, rpmGetPath(), Spec, and StringBuf.

Referenced by addFileToArrayTag(), and addFileToTag().

int cpio_copy FD_t  fdo,
CSA_t  csa
[static]
 

Definition at line 106 of file pack.c.

References _, cpioSourceArchive_s::cpioArchiveSize, cpioSourceArchive_s::cpioFdIn, CSA_t, FD_t, Ferror(), Fread(), Fstrerror(), Fwrite(), RPMERR_CPIO, and rpmError.

Referenced by writeRPM().

int cpio_doio FD_t  fdo,
Header  h,
CSA_t  csa,
const char *  fmodeMacro
[static]
 

Todo:
Create transaction set *much* earlier.

Definition at line 56 of file pack.c.

References _, _free(), cpioSourceArchive_s::cpioArchiveSize, cpioSourceArchive_s::cpioList, cpioStrerror(), CSA_t, Fclose(), FD_t, fdDup(), Fdopen(), Fflush(), Fileno(), FSM_PKGBUILD, fsmSetup(), fsmTeardown(), Header, RPMERR_CPIO, rpmError, rpmExpand(), rpmfi, rpmts, rpmtsCreate(), rpmtsFree(), and xstrdup().

Referenced by writeRPM().

int genSourceRpmName Spec  spec  )  [inline, static]
 

Definition at line 37 of file pack.c.

References Package_s::header, headerNVR(), Spec_s::noSource, Spec_s::packages, Spec_s::sourceRpmName, Spec, and xstrdup().

Referenced by packageBinaries(), and packageSources().

int processScriptFiles Spec  spec,
Package  pkg
[static]
 

Definition at line 212 of file pack.c.

References _, addFileToArrayTag(), addFileToTag(), Package_s::header, headerAddOrAppendEntry(), TriggerFileEntry::next, Package, Package_s::postInFile, Package_s::postUnFile, Package_s::preInFile, Package_s::preUnFile, RPM_STRING_ARRAY_TYPE, RPMERR_BADFILENAME, rpmError, RPMTAG_POSTIN, RPMTAG_POSTUN, RPMTAG_PREIN, RPMTAG_PREUN, RPMTAG_TRIGGERSCRIPTPROG, RPMTAG_TRIGGERSCRIPTS, RPMTAG_VERIFYSCRIPT, Spec, Package_s::triggerFiles, and Package_s::verifyFile.

Referenced by packageBinaries().

int readRPM const char *  fileName,
Spec specp,
struct rpmlead lead,
Header sigs,
CSA_t  csa
 

Read rpm package components from file.

Parameters:
fileName file name of package (or NULL to use stdin)
Return values:
specp spec structure to carry package header (or NULL)
lead package lead
sigs package signature
Parameters:
csa 
Returns:
0 on success

Definition at line 283 of file pack.c.

References _, cpioSourceArchive_s::cpioFdIn, CSA_t, Fclose(), FD_t, fdDup(), Ferror(), Fopen(), Fread(), freeSpec(), Fseek(), Fstrerror(), Package_s::header, Header, headerFree(), newPackage(), newSpec(), Spec_s::packages, RPMERR_BADMAGIC, RPMERR_FSEEK, rpmError, rpmRC, RPMRC_FAIL, RPMRC_NOKEY, RPMRC_NOTFOUND, RPMRC_NOTTRUSTED, RPMRC_OK, rpmReadPackageFile(), rpmts, rpmtsCreate(), rpmtsFree(), SEEK_SET, and Spec.

Referenced by rewriteRPM().

int rpmLeadVersion void   )  [static]
 

Definition at line 385 of file pack.c.

References _noDirTokens, rpmExpandNumeric(), rpmpkg_version, RPMPKGVERSION_MAX, and RPMPKGVERSION_MIN.

Referenced by writeRPM().

int writeRPM Header hdrp,
unsigned char **  pkgidp,
const char *  fileName,
int  type,
CSA_t  csa,
char *  passPhrase,
const char **  cookie
 

Write rpm package to file.

Warning:
The first argument (header) is now passed by reference in order to return a reloaded contiguous header to the caller.
Return values:
*hdrp header to write (final header is returned).
*pkgidp header+payload MD5 of package (NULL to disable).
Parameters:
fileName file name of package
type RPMLEAD_SOURCE/RPMLEAD_BINARY
csa 
passPhrase 
Return values:
cookie generated cookie (i.e build host/time)
Returns:
0 on success

Definition at line 407 of file pack.c.

References _, _free(), rpmlead::archnum, buildHost(), cpio_copy(), cpio_doio(), cpioSourceArchive_s::cpioArchiveSize, cpioSourceArchive_s::cpioFdIn, cpioSourceArchive_s::cpioList, CSA_t, Fclose(), FD_t, fdFiniDigest(), fdInitDigest(), Ferror(), Fflush(), Fileno(), Fopen(), Fread(), Fseek(), Fstrerror(), Fwrite(), getBuildTime(), Header, HEADER_MAGIC_YES, headerAddEntry(), headerFree(), headerGetEntry(), headerLink(), headerMergeLegacySigs(), headerNVR(), headerRead(), headerReload(), headerWrite(), HGE_t, int_32, cpioSourceArchive_s::lead, rpmlead::major, makeTempFile(), rpmlead::minor, rpmlead::name, rpmlead::osnum, PGPHASHALGO_SHA1, providePackageNVR(), RPM_BIN_TYPE, RPM_INT32_TYPE, RPM_STRING_TYPE, rpmAddSignature(), RPMERR_BADARG, RPMERR_CREATE, RPMERR_FSEEK, RPMERR_NOSPACE, RPMERR_READ, RPMERR_RELOAD, rpmError, rpmExpand(), rpmFreeSignature(), rpmGetArchInfo(), rpmGetOsInfo(), RPMLEAD_BINARY, RPMLEAD_SOURCE, rpmLeadVersion(), rpmlibNeedsFeature(), RPMLOOKUPSIG_QUERY, rpmLookupSignatureType(), RPMMESS_NORMAL, rpmMessage, rpmNewSignature(), RPMRC_OK, RPMSIGTAG_MD5, RPMSIGTAG_PAYLOADSIZE, RPMSIGTAG_SHA1, RPMSIGTAG_SIZE, RPMSIGTYPE_HEADERSIG, RPMTAG_ARCHIVESIZE, RPMTAG_COOKIE, RPMTAG_HEADERIMMUTABLE, RPMTAG_HEADERSIGNATURES, RPMTAG_PAYLOADCOMPRESSOR, RPMTAG_PAYLOADFLAGS, RPMTAG_PAYLOADFORMAT, rpmWriteSignature(), SEEK_SET, rpmlead::signature_type, rpmlead::type, Unlink(), writeLead(), and xstrdup().

Referenced by packageBinaries(), packageSources(), and rewriteRPM().


Variable Documentation

int_32 copyTags[] [static]
 

Initial value:

Definition at line 734 of file pack.c.

Referenced by packageBinaries().

int rpmpkg_version = -1 [static]
 

Definition at line 383 of file pack.c.

Referenced by rpmLeadVersion().


Generated on Fri Jul 28 03:09:46 2006 for rpm by doxygen 1.3.5