rpm  5.2.1
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...
 
rpmRC writeRPM (Header *hdrp, unsigned char **pkgidp, const char *fileName, CSA_t csa, char *passPhrase, const char **cookie)
 Write rpm package to file. More...
 
static int rpmlibMarkers (Header h)
 
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 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
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 452 of file pack.c.

References _free(), alloca(), _HE_s::append, rpmDataType_u::argv, _HE_s::c, headerGet(), headerNEVRA(), headerPut(), _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 
)

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)
Returns
RPMRC_OK on success

Definition at line 616 of file pack.c.

References _, _free(), alloca(), buildHost(), _HE_s::c, cpio_copy(), cpio_doio(), cpioSourceArchive_s::cpioArchiveSize, cpioSourceArchive_s::cpioFdIn, cpioSourceArchive_s::cpioList, Fclose(), fdFiniDigest(), fdInitDigest(), Ferror(), Fflush(), Fileno(), Fopen(), Fread(), Fstrerror(), Fwrite(), getBuildTime(), headerFree(), headerGet(), headerIsEntry(), headerLink(), headerMergeLegacySigs(), headerNEVRA(), headerNew(), headerPut(), headerReload(), headerUnload(), _HE_s::p, PGPHASHALGO_SHA1, rpmDataType_u::ptr, RPM_BIN_TYPE, RPM_STRING_TYPE, RPM_UINT32_TYPE, rpmAddSignature(), rpmExpand(), rpmlibNeedsFeature(), rpmlog(), RPMLOG_ERR, RPMLOG_NOTICE, rpmpkgRead(), rpmpkgSizeof(), rpmpkgWrite(), RPMRC_FAIL, RPMRC_OK, RPMSIGTAG_GPG, RPMSIGTAG_MD5, RPMSIGTAG_PADDING, RPMSIGTAG_PAYLOADSIZE, RPMSIGTAG_SHA1, RPMSIGTAG_SIZE, RPMTAG_ARCH, RPMTAG_COOKIE, RPMTAG_HEADERIMMUTABLE, RPMTAG_HEADERSIGNATURES, RPMTAG_PAYLOADCOMPRESSOR, RPMTAG_PAYLOADFLAGS, RPMTAG_PAYLOADFORMAT, 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
Initial value:

Definition at line 1059 of file pack.c.