rpm  5.4.15
Macros | Functions | Variables
pack.c File Reference

Assemble components of an RPM package. More...

#include "system.h"
#include <rpmio_internal.h>
#include <rpmcb.h>
#include <argv.h>
#include <rpmtypes.h>
#include <rpmtag.h>
#include <pkgio.h>
#include "signature.h"
#include <rpmbuild.h>
#include "rpmfi.h"
#include "fsm.h"
#include <rpmversion.h>
#include "buildio.h"
#include "debug.h"
Include dependency graph for pack.c:

Go to the source code of this file.

Macros

#define _RPMFI_INTERNAL   /* XXX fi->fsm */
 
#define _RPMEVR_INTERNAL   /* XXX RPMSENSE_ANY */
 
#define _RPMTAG_INTERNAL
 

Functions

static rpmRC cpio_doio (FD_t fdo, Header h, CSA_t csa, const char *payload_format, const char *fmodeMacro)
 
static rpmRC cpio_copy (FD_t fdo, CSA_t csa)
 
static rpmiob addFileToTagAux (Spec spec, const char *file, rpmiob iob)
 
static int addFileToTag (Spec spec, const char *file, Header h, rpmTag tag)
 
static int addFileToArrayTag (Spec spec, const char *file, Header h, rpmTag tag)
 
rpmRC processScriptFiles (Spec spec, Package pkg)
 Append files (if any) to scriptlet tags. More...
 
void providePackageNVR (Header h)
 Retrofit an explicit Provides: N = E:V-R dependency into package headers. More...
 
static unsigned char nibble (char c)
 Convert hex to binary nibble. More...
 
rpmRC writeRPM (Header *hdrp, unsigned char **pkgidp, const char *fn, CSA_t csa, char *passPhrase, const char **cookie, void *_dig)
 Write rpm package to file. More...
 
static int rpmlibMarkers (Header h)
 
static rpmRC checkPackages (const char *pkgcheck)
 
rpmRC packageBinaries (Spec spec)
 Generate binary package(s). More...
 
rpmRC packageSources (Spec spec)
 Generate source package. More...
 

Variables

static rpmTag copyTags []
 

Detailed Description

Assemble components of an RPM package.

Definition in file pack.c.

Macro Definition Documentation

#define _RPMEVR_INTERNAL   /* XXX RPMSENSE_ANY */

Definition at line 19 of file pack.c.

#define _RPMFI_INTERNAL   /* XXX fi->fsm */

Definition at line 18 of file pack.c.

#define _RPMTAG_INTERNAL

Definition at line 20 of file pack.c.

Function Documentation

static int addFileToArrayTag ( Spec  spec,
const char *  file,
Header  h,
rpmTag  tag 
)
static
static int addFileToTag ( Spec  spec,
const char *  file,
Header  h,
rpmTag  tag 
)
static
static rpmiob addFileToTagAux ( Spec  spec,
const char *  file,
rpmiob  iob 
)
static
static rpmRC checkPackages ( const char *  pkgcheck)
static

Definition at line 1154 of file pack.c.

References _, fail, rpmExpandNumeric(), rpmlog(), RPMLOG_ERR, RPMLOG_NOTICE, RPMRC_FAIL, and RPMRC_OK.

Referenced by packageBinaries(), and packageSources().

static rpmRC cpio_copy ( FD_t  fdo,
CSA_t  csa 
)
static
static rpmRC cpio_doio ( FD_t  fdo,
Header  h,
CSA_t  csa,
const char *  payload_format,
const char *  fmodeMacro 
)
static
static unsigned char nibble ( char  c)
static

Convert hex to binary nibble.

Parameters
chex character
Returns
binary nibble

Definition at line 628 of file pack.c.

Referenced by writeRPM().

rpmRC packageBinaries ( Spec  spec)
rpmRC packageSources ( Spec  spec)
rpmRC processScriptFiles ( Spec  spec,
Package  pkg 
)
void providePackageNVR ( Header  h)

Retrofit an explicit Provides: N = E:V-R dependency into package headers.

Up to rpm 3.0.4, packages implicitly provided their own name-version-release.

Parameters
hheader

Definition at line 454 of file pack.c.

References _free(), alloca(), _HE_s::append, rpmDataType_u::argv, _HE_s::c, headerGet(), headerNEVRA(), headerPut(), i, _HE_s::p, rpmDataType_u::ptr, RPM_STRING_ARRAY_TYPE, RPM_UINT32_TYPE, RPMSENSE_EQUAL, RPMTAG_DISTEPOCH, RPMTAG_EPOCH, RPMTAG_PROVIDEFLAGS, RPMTAG_PROVIDENAME, RPMTAG_PROVIDEVERSION, stpcpy(), rpmDataType_u::str, _HE_s::t, _HE_s::tag, and rpmDataType_u::ui32p.

Referenced by processBinaryFiles().

static int rpmlibMarkers ( Header  h)
static
rpmRC writeRPM ( Header hdrp,
unsigned char **  pkgidp,
const char *  fileName,
CSA_t  csa,
char *  passPhrase,
const char **  cookie,
void *  _dig 
)

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
*hdrpheader to write (final header is returned).
*pkgidpheader+payload MD5 of package (NULL to disable).
Parameters
fileNamefile name of package
csa
passPhrase
Return values
cookiegenerated cookie (i.e build host/time)
Parameters
_digDSA keypair for auto-signing (or NULL)
Returns
RPMRC_OK on success

Definition at line 640 of file pack.c.

References _, _free(), alloca(), _HE_s::append, rpmDataType_u::argv, b, buildHost(), _HE_s::c, cpio_copy(), cpio_doio(), cpioSourceArchive_s::cpioArchiveSize, cpioSourceArchive_s::cpioFdIn, _FD_s::digests, Fclose(), fdFiniDigest(), fdInitDigest(), Ferror(), Fflush(), cpioSourceArchive_s::fi, Fileno(), Fopen(), Fread(), Fstrerror(), Fwrite(), getBuildTime(), headerFree(), headerGet(), headerIsEntry(), headerLink(), headerMergeLegacySigs(), headerNEVRA(), headerNew(), headerPut(), headerReload(), headerUnload(), _FD_s::ndigests, nibble(), _HE_s::p, PGPARMOR_PUBKEY, pgpArmorWrap(), pgpExportSignature(), pgpGetPubkey(), pgpGetSignature(), PGPHASHALGO_SHA1, PGPPUBKEYALGO_DSA, PGPPUBKEYALGO_ECDSA, PGPPUBKEYALGO_RSA, rpmDataType_u::ptr, RPM_BIN_TYPE, RPM_STRING_ARRAY_TYPE, RPM_STRING_TYPE, RPM_UINT32_TYPE, rpmAddSignature(), rpmDigestDup(), rpmExpand(), rpmlibNeedsFeature(), rpmlog(), RPMLOG_ERR, RPMLOG_NOTICE, rpmpkgRead(), rpmpkgSizeof(), rpmpkgWrite(), RPMRC_FAIL, RPMRC_OK, RPMSIGTAG_DSA, RPMSIGTAG_ECDSA, RPMSIGTAG_GPG, RPMSIGTAG_MD5, RPMSIGTAG_PADDING, RPMSIGTAG_PAYLOADSIZE, RPMSIGTAG_RSA, RPMSIGTAG_SHA1, RPMSIGTAG_SIZE, RPMTAG_ARCH, RPMTAG_COOKIE, RPMTAG_HEADERIMMUTABLE, RPMTAG_HEADERSIGNATURES, RPMTAG_PAYLOADCOMPRESSOR, RPMTAG_PAYLOADFLAGS, RPMTAG_PAYLOADFORMAT, RPMTAG_PUBKEYS, RPMTAG_SOURCERPM, rpmTempFile(), rpmDataType_u::str, _HE_s::t, _HE_s::tag, rpmDataType_u::ui32p, rpmDataType_u::ui8p, Unlink(), and xstrdup().

Referenced by packageBinaries(), and packageSources().

Variable Documentation

rpmTag copyTags[]
static