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 | |
| static int | genSourceRpmName (Spec spec) |
| static int | cpio_doio (FD_t fdo, Header h, CSA_t csa, const char *fmodeMacro) |
| static int | cpio_copy (FD_t fdo, CSA_t csa) |
| static StringBuf | addFileToTagAux (Spec spec, const char *file, StringBuf sb) |
| static int | addFileToTag (Spec spec, const char *file, Header h, int tag) |
| static int | addFileToArrayTag (Spec spec, const char *file, Header h, int tag) |
| static 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. | |
| static 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) |
| Generate binary package(s). | |
| int | packageSources (Spec spec) |
| Generate source package. | |
Variables | |
| static int | rpmpkg_version = -1 |
| static int_32 | copyTags [] |
Assemble components of an RPM package.
Definition in file pack.c.
| #define RPMPKGVERSION_MAX 40003 |
Definition at line 394 of file pack.c.
Referenced by rpmLeadVersion().
| #define RPMPKGVERSION_MIN 30004 |
Definition at line 393 of file pack.c.
Referenced by rpmLeadVersion().
Definition at line 192 of file pack.c.
References addFileToTagAux(), freeStringBuf(), getStringBuf(), headerAddOrAppendEntry(), and newStringBuf().
Referenced by processScriptFiles().
Definition at line 168 of file pack.c.
References addFileToTagAux(), appendLineStringBuf, freeStringBuf(), getStringBuf(), headerAddEntry(), headerGetEntryMinMemory(), headerRemoveEntry(), and newStringBuf().
Referenced by processScriptFiles().
Definition at line 131 of file pack.c.
References _, _free(), appendStringBuf, expandMacros(), Fclose(), fdGetFp(), Ferror(), Fopen(), freeStringBuf(), Spec_s::macros, RPMERR_BADSPEC, rpmError, and rpmGetPath().
Referenced by addFileToArrayTag(), and addFileToTag().
Definition at line 106 of file pack.c.
References _, cpioSourceArchive_s::cpioArchiveSize, cpioSourceArchive_s::cpioFdIn, Ferror(), Fread(), Fstrerror(), Fwrite(), RPMERR_CPIO, and rpmError.
Referenced by writeRPM().
Definition at line 56 of file pack.c.
References _, _free(), cpioSourceArchive_s::cpioArchiveSize, cpioSourceArchive_s::cpioList, cpioStrerror(), Fclose(), fdDup(), Fdopen(), Fflush(), Fileno(), rpmfi_s::fsm, FSM_PKGBUILD, fsmSetup(), fsmTeardown(), RPMERR_CPIO, rpmError, rpmExpand(), rpmtsCreate(), rpmtsFree(), and xstrdup().
Referenced by writeRPM().
| static 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, and xstrdup().
Referenced by packageBinaries(), and packageSources().
Definition at line 211 of file pack.c.
References _, addFileToArrayTag(), addFileToTag(), TriggerFileEntry::fileName, Package_s::header, headerAddOrAppendEntry(), TriggerFileEntry::next, Package_s::postInFile, Package_s::postTransFile, Package_s::postUnFile, Package_s::preInFile, Package_s::preTransFile, Package_s::preUnFile, TriggerFileEntry::prog, RPMERR_BADFILENAME, rpmError, TriggerFileEntry::script, 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.
| fileName | file name of package (or NULL to use stdin) |
| specp | spec structure to carry package header (or NULL) | |
| lead | package lead | |
| sigs | package signature |
| csa |
Definition at line 296 of file pack.c.
References _, cpioSourceArchive_s::cpioFdIn, Fclose(), fdDup(), Ferror(), Fopen(), Fread(), freeSpec(), Fseek(), Fstrerror(), Package_s::header, headerFree(), newPackage(), newSpec(), Spec_s::packages, RPMERR_BADMAGIC, RPMERR_FSEEK, rpmError, RPMRC_FAIL, RPMRC_NOKEY, RPMRC_NOTFOUND, RPMRC_NOTTRUSTED, RPMRC_OK, rpmReadPackageFile(), rpmtsCreate(), rpmtsFree(), and SEEK_SET.
Referenced by rewriteRPM().
| static int rpmLeadVersion | ( | void | ) | [static] |
Definition at line 398 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.
| *hdrp | header to write (final header is returned). | |
| *pkgidp | header+payload MD5 of package (NULL to disable). |
| fileName | file name of package | |
| type | RPMLEAD_SOURCE/RPMLEAD_BINARY | |
| csa | ||
| passPhrase |
| cookie | generated cookie (i.e build host/time) |
Definition at line 420 of file pack.c.
References _, _free(), rpmlead::archnum, buildHost(), cpio_copy(), cpio_doio(), cpioSourceArchive_s::cpioArchiveSize, cpioSourceArchive_s::cpioFdIn, cpioSourceArchive_s::cpioList, Fclose(), fdFiniDigest(), fdInitDigest(), Ferror(), Fflush(), Fileno(), Fopen(), Fread(), Fseek(), Fstrerror(), Fwrite(), getBuildTime(), HEADER_MAGIC_YES, headerAddEntry(), headerFree(), headerGetEntry(), headerGetEntryMinMemory(), headerLink(), headerMergeLegacySigs(), headerNVR(), headerRead(), headerReload(), headerWrite(), cpioSourceArchive_s::lead, rpmlead::major, makeTempFile(), rpmlead::minor, rpmlead::name, rpmlead::osnum, PGPHASHALGO_SHA1, providePackageNVR(), 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_HEADERIMMUTABLE, RPMTAG_HEADERSIGNATURES, rpmWriteSignature(), SEEK_SET, rpmlead::signature_type, tagType(), rpmlead::type, Unlink(), writeLead(), and xstrdup().
Referenced by packageBinaries(), packageSources(), and rewriteRPM().
{
RPMTAG_CHANGELOGTIME,
RPMTAG_CHANGELOGNAME,
RPMTAG_CHANGELOGTEXT,
0
}
Definition at line 747 of file pack.c.
Referenced by packageBinaries().
int rpmpkg_version = -1 [static] |
Definition at line 396 of file pack.c.
Referenced by rpmLeadVersion().
1.6.1