RPMCLI.


Files

file  poptBT.c
 Popt tables for build modes.
file  manifest.c
file  poptALL.c
 Popt tables for all rpm modes.
file  poptI.c
 Popt tables for install modes.
file  poptQV.c
 Popt tables for query/verify modes.
file  query.c
 Display tag values from package metadata.
file  rpmchecksig.c
 Verify the signature of a package.
file  rpmcli.h
file  rpminstall.c
file  rpmlib.h
 In Memoriam: Steve Taylor <staylor@redhat.com> was here, now he's not.
file  verify.c
 Verify installed payload files from package metadata.
file  poptDB.c
 Popt tables for database modes.

Data Structures

struct  rpmQVKArguments_s
 Describe query/verify/signature command line operation. More...
struct  rpmBuildArguments_s
 Describe build command line request. More...
struct  rpmInstallArguments_s
 Describe database command line requests. More...
struct  rpmDatabaseArguments_s
 Describe database command line requests. More...

RPMQV

enum  rpmQVSources_e {
  RPMQV_PACKAGE = 0, RPMQV_PATH, RPMQV_ALL, RPMQV_RPM,
  RPMQV_GROUP, RPMQV_WHATPROVIDES, RPMQV_WHATREQUIRES, RPMQV_TRIGGEREDBY,
  RPMQV_DBOFFSET, RPMQV_SPECFILE, RPMQV_PKGID, RPMQV_HDRID,
  RPMQV_FILEID, RPMQV_TID, RPMQV_HDLIST, RPMQV_FTSWALK
}
 Query/Verify argument qualifiers. More...
enum  rpmVerifyAttrs_e {
  RPMVERIFY_NONE = 0, RPMVERIFY_MD5 = (1 << 0), RPMVERIFY_FILESIZE = (1 << 1), RPMVERIFY_LINKTO = (1 << 2),
  RPMVERIFY_USER = (1 << 3), RPMVERIFY_GROUP = (1 << 4), RPMVERIFY_MTIME = (1 << 5), RPMVERIFY_MODE = (1 << 6),
  RPMVERIFY_RDEV = (1 << 7), RPMVERIFY_CONTEXTS = (1 << 15), RPMVERIFY_READLINKFAIL = (1 << 28), RPMVERIFY_READFAIL = (1 << 29),
  RPMVERIFY_LSTATFAIL = (1 << 30), RPMVERIFY_LGETFILECONFAIL = (1 << 31)
}
 Bit(s) for rpmVerifyFile() attributes and result. More...
enum  rpmQueryFlags_e {
  QUERY_FOR_DEFAULT = 0, QUERY_MD5 = (1 << 0), QUERY_SIZE = (1 << 1), QUERY_LINKTO = (1 << 2),
  QUERY_USER = (1 << 3), QUERY_GROUP = (1 << 4), QUERY_MTIME = (1 << 5), QUERY_MODE = (1 << 6),
  QUERY_RDEV = (1 << 7), QUERY_CONTEXTS = (1 << 15), QUERY_FILES = (1 << 16), QUERY_DEPS = (1 << 17),
  QUERY_SCRIPT = (1 << 18), QUERY_DIGEST = (1 << 19), QUERY_SIGNATURE = (1 << 20), QUERY_PATCHES = (1 << 21),
  QUERY_HDRCHK = (1 << 22), QUERY_FOR_LIST = (1 << 23), QUERY_FOR_STATE = (1 << 24), QUERY_FOR_DOCS = (1 << 25),
  QUERY_FOR_CONFIG = (1 << 26), QUERY_FOR_DUMPFILES = (1 << 27)
}
 Bit(s) to control rpmQuery() operation, stored in qva_flags. More...
enum  rpmVerifyFlags_e {
  VERIFY_DEFAULT = 0, VERIFY_MD5 = (1 << 0), VERIFY_SIZE = (1 << 1), VERIFY_LINKTO = (1 << 2),
  VERIFY_USER = (1 << 3), VERIFY_GROUP = (1 << 4), VERIFY_MTIME = (1 << 5), VERIFY_MODE = (1 << 6),
  VERIFY_RDEV = (1 << 7), VERIFY_CONTEXTS = (1 << 15), VERIFY_FILES = (1 << 16), VERIFY_DEPS = (1 << 17),
  VERIFY_SCRIPT = (1 << 18), VERIFY_DIGEST = (1 << 19), VERIFY_SIGNATURE = (1 << 20), VERIFY_PATCHES = (1 << 21),
  VERIFY_HDRCHK = (1 << 22), VERIFY_FOR_LIST = (1 << 23), VERIFY_FOR_STATE = (1 << 24), VERIFY_FOR_DOCS = (1 << 25),
  VERIFY_FOR_CONFIG = (1 << 26), VERIFY_FOR_DUMPFILES = (1 << 27)
}
 Bit(s) to control rpmVerify() operation, stored in qva_flags. More...
rpmQueryFlags rpmcliQueryFlags
 Bit(s) from common command line options.
rpmQVKArguments_s rpmQVKArgs
poptOption rpmQVSourcePoptTable []
 Common query/verify mode options.
int specedit
poptOption rpmQueryPoptTable []
 Query mode options.
poptOption rpmVerifyPoptTable []
 Verify mode options.
typedef enum rpmQVSources_e rpmQVSources
 Query/Verify argument qualifiers.
typedef enum rpmVerifyAttrs_e rpmVerifyAttrs
 Bit(s) for rpmVerifyFile() attributes and result.
typedef enum rpmQueryFlags_e rpmQueryFlags
 Bit(s) to control rpmQuery() operation, stored in qva_flags.
typedef enum rpmVerifyFlags_e rpmVerifyFlags
 Bit(s) to control rpmVerify() operation, stored in qva_flags.
typedef rpmQVKArguments_sQVA_t
typedef int(*) QVF_t (QVA_t qva, rpmts ts, Header h)
 Function to display iterator matches.
typedef int(*) QSpecF_t (rpmts ts, QVA_t qva, const char *arg)
 Function to query spec file.
int rpmcliShowMatches (QVA_t qva, rpmts ts)
 Display query/verify information for each header in iterator.
void rpmDisplayQueryTags (FILE *fp)
 Display list of tags that can be used in --queryformat.
int rpmQueryVerify (QVA_t qva, rpmts ts, const char *arg)
 Common query/verify source interface, called once for each CLI arg.
int showQueryPackage (QVA_t qva, rpmts ts, Header h)
 Display results of package query.
int rpmcliArgIter (rpmts ts, QVA_t qva, ARGV_t argv)
 Iterate over query/verify arg list.
int rpmcliQuery (rpmts ts, QVA_t qva, const char **argv)
 Display package information.
int rpmVerifyFile (const rpmts ts, rpmfi fi, rpmVerifyAttrs *res, rpmVerifyAttrs omitMask)
 Verify file attributes (including MD5 sum).
int showVerifyPackage (QVA_t qva, rpmts ts, Header h)
 Display results of package verify.
int rpmcliVerify (rpmts ts, QVA_t qva, const char **argv)
 Verify package install.

RPMK

enum  rpmSignFlags_e {
  RPMSIGN_NONE = 0, RPMSIGN_CHK_SIGNATURE = 'K', RPMSIGN_NEW_SIGNATURE = 'R', RPMSIGN_ADD_SIGNATURE = 'A',
  RPMSIGN_DEL_SIGNATURE = 'D', RPMSIGN_IMPORT_PUBKEY = 'I'
}
 Bit(s) to control rpmReSign() operation. More...
poptOption rpmSignPoptTable []
 Signature mode options.
typedef enum rpmSignFlags_e rpmSignFlags
 Bit(s) to control rpmReSign() operation.
rpmRC rpmcliImportPubkey (const rpmts ts, const unsigned char *pkt, ssize_t pktlen)
 Import public key packet(s).
int rpmcliSign (rpmts ts, QVA_t qva, const char **argv)
 Create/Modify/Check elements from signature header.

RPMEIU

enum  rpmInstallInterfaceFlags_e {
  INSTALL_NONE = 0, INSTALL_PERCENT = (1 << 0), INSTALL_HASH = (1 << 1), INSTALL_NODEPS = (1 << 2),
  INSTALL_NOORDER = (1 << 3), INSTALL_LABEL = (1 << 4), INSTALL_UPGRADE = (1 << 5), INSTALL_FRESHEN = (1 << 6),
  INSTALL_INSTALL = (1 << 7), INSTALL_ERASE = (1 << 8)
}
 Bit(s) to control rpmInstall() operation. More...
enum  rpmEraseInterfaceFlags_e { UNINSTALL_NONE = 0, UNINSTALL_NODEPS = (1 << 0), UNINSTALL_ALLMATCHES = (1 << 1) }
 Bit(s) to control rpmErase() operation. More...
typedef enum rpmInstallInterfaceFlags_e rpmInstallInterfaceFlags
 Bit(s) to control rpmInstall() operation.
typedef enum rpmEraseInterfaceFlags_e rpmEraseInterfaceFlags
 Bit(s) to control rpmErase() operation.

RPMBT

rpmBuildArguments_s rpmBTArgs
poptOption rpmBuildPoptTable []
typedef rpmBuildArguments_sBTA_t

RPMEIU

rpmInstallArguments_s rpmIArgs
poptOption rpmInstallPoptTable []
void * rpmShowProgress (const void *arg, const rpmCallbackType what, const unsigned long amount, const unsigned long total, fnpyKey key, void *data)
 The rpm CLI generic transaction callback handler.
int rpmInstallSource (rpmts ts, const char *arg, const char **specFilePtr, const char **cookie)
 Install source rpm package.
int rpmInstall (rpmts ts, struct rpmInstallArguments_s *ia, const char **fileArgv)
 Install/upgrade/freshen binary rpm package.
int rpmErase (rpmts ts, struct rpmInstallArguments_s *ia, const char **argv)
 Erase binary rpm package.
int rpmRollback (rpmts ts, struct rpmInstallArguments_s *ia, const char **argv)
 Rollback transactions, erasing new, reinstalling old, package(s).

RPMDB

rpmDatabaseArguments_s rpmDBArgs
poptOption rpmDatabasePoptTable []

RPMTS

void rpmShowRpmlibProvides (FILE *fp)
 Display current rpmlib feature provides.

Typedefs

typedef rpmgi_s * rpmgi
 Generalized iterator.

Functions

static int checkSpec (rpmts ts, Header h)
static int rpmReSign (rpmts ts, QVA_t qva, const char **argv)
 Create/modify elements in signature header.
static int rpmcliImportPubkeys (const rpmts ts, QVA_t qva, const char **argv)
 Import public key(s).

Variables

int _noDirTokens
 Should version 3 packages be produced?
poptOption rpmcliAllPoptTable []
 Popt option table for options shared by all modes and executables.

Typedef Documentation

typedef struct rpmBuildArguments_s* BTA_t

Definition at line 495 of file rpmcli.h.

typedef int(*) QSpecF_t(rpmts ts, QVA_t qva, const char *arg)

Function to query spec file.

Parameters:
ts transaction set
qva parsed query/verify options
arg query argument
Returns:
0 on success

Definition at line 254 of file rpmcli.h.

typedef struct rpmQVKArguments_s* QVA_t

Definition at line 232 of file rpmcli.h.

typedef int(*) QVF_t(QVA_t qva, rpmts ts, Header h)

Function to display iterator matches.

Parameters:
qva parsed query/verify options
ts transaction set
h header to use for query/verify
Returns:
0 on success

Definition at line 242 of file rpmcli.h.

typedef enum rpmEraseInterfaceFlags_e rpmEraseInterfaceFlags

Bit(s) to control rpmErase() operation.

typedef struct rpmgi_s* rpmgi

Generalized iterator.

Definition at line 118 of file rpmlib.h.

typedef enum rpmInstallInterfaceFlags_e rpmInstallInterfaceFlags

Bit(s) to control rpmInstall() operation.

Todo:
Move to rpmcli.h

typedef enum rpmQueryFlags_e rpmQueryFlags

Bit(s) to control rpmQuery() operation, stored in qva_flags.

Todo:
Merge rpmQueryFlags, rpmVerifyFlags, and rpmVerifyAttrs?.

typedef enum rpmQVSources_e rpmQVSources

Query/Verify argument qualifiers.

Todo:
Reassign to tag values.

typedef enum rpmSignFlags_e rpmSignFlags

Bit(s) to control rpmReSign() operation.

typedef enum rpmVerifyAttrs_e rpmVerifyAttrs

Bit(s) for rpmVerifyFile() attributes and result.

typedef enum rpmVerifyFlags_e rpmVerifyFlags

Bit(s) to control rpmVerify() operation, stored in qva_flags.

Todo:
Merge rpmQueryFlags, rpmVerifyFlags, and rpmVerifyAttrs values?.


Enumeration Type Documentation

enum rpmEraseInterfaceFlags_e

Bit(s) to control rpmErase() operation.

Enumerator:
UNINSTALL_NONE 
UNINSTALL_NODEPS  from --nodeps
UNINSTALL_ALLMATCHES  from --allmatches

Definition at line 1192 of file rpmlib.h.

enum rpmInstallInterfaceFlags_e

Bit(s) to control rpmInstall() operation.

Todo:
Move to rpmcli.h
Enumerator:
INSTALL_NONE 
INSTALL_PERCENT  from --percent
INSTALL_HASH  from --hash
INSTALL_NODEPS  from --nodeps
INSTALL_NOORDER  from --noorder
INSTALL_LABEL  from --verbose (notify)
INSTALL_UPGRADE  from --upgrade
INSTALL_FRESHEN  from --freshen
INSTALL_INSTALL  from --install
INSTALL_ERASE  from --erase

Definition at line 1176 of file rpmlib.h.

enum rpmQueryFlags_e

Bit(s) to control rpmQuery() operation, stored in qva_flags.

Todo:
Merge rpmQueryFlags, rpmVerifyFlags, and rpmVerifyAttrs?.
Enumerator:
QUERY_FOR_DEFAULT 
QUERY_MD5  from --nomd5
QUERY_SIZE  from --nosize
QUERY_LINKTO  from --nolink
QUERY_USER  from --nouser)
QUERY_GROUP  from --nogroup)
QUERY_MTIME  from --nomtime)
QUERY_MODE  from --nomode)
QUERY_RDEV  from --nodev
QUERY_CONTEXTS  verify: from --nocontexts
QUERY_FILES  verify: from --nofiles
QUERY_DEPS  verify: from --nodeps
QUERY_SCRIPT  verify: from --noscripts
QUERY_DIGEST  verify: from --nodigest
QUERY_SIGNATURE  verify: from --nosignature
QUERY_PATCHES  verify: from --nopatches
QUERY_HDRCHK  verify: from --nohdrchk
QUERY_FOR_LIST  query: from --list
QUERY_FOR_STATE  query: from --state
QUERY_FOR_DOCS  query: from --docfiles
QUERY_FOR_CONFIG  query: from --configfiles
QUERY_FOR_DUMPFILES  query: from --dump

Definition at line 150 of file rpmcli.h.

enum rpmQVSources_e

Query/Verify argument qualifiers.

Todo:
Reassign to tag values.
Enumerator:
RPMQV_PACKAGE  ... from package name db search.
RPMQV_PATH  ... from file path db search.
RPMQV_ALL  ... from each installed package.
RPMQV_RPM  ... from reading binary rpm package.
RPMQV_GROUP  ... from group db search.
RPMQV_WHATPROVIDES  ... from provides db search.
RPMQV_WHATREQUIRES  ... from requires db search.
RPMQV_TRIGGEREDBY  ... from trigger db search.
RPMQV_DBOFFSET  ... from database header instance.
RPMQV_SPECFILE  ... from spec file parse (query only).
RPMQV_PKGID  ... from package id (header+payload MD5).
RPMQV_HDRID  ... from header id (immutable header SHA1).
RPMQV_FILEID  ... from file id (file MD5).
RPMQV_TID  ... from install transaction id (time stamp).
RPMQV_HDLIST  ... from system hdlist.
RPMQV_FTSWALK  ... from fts(3) walk.

Definition at line 101 of file rpmcli.h.

enum rpmSignFlags_e

Bit(s) to control rpmReSign() operation.

Enumerator:
RPMSIGN_NONE 
RPMSIGN_CHK_SIGNATURE  from --checksig
RPMSIGN_NEW_SIGNATURE  from --resign
RPMSIGN_ADD_SIGNATURE  from --addsign
RPMSIGN_DEL_SIGNATURE  from --delsign
RPMSIGN_IMPORT_PUBKEY  from --import

Definition at line 775 of file rpmcli.h.

enum rpmVerifyAttrs_e

Bit(s) for rpmVerifyFile() attributes and result.

Enumerator:
RPMVERIFY_NONE 
RPMVERIFY_MD5  from verify(md5)
RPMVERIFY_FILESIZE  from verify(size)
RPMVERIFY_LINKTO  from verify(link)
RPMVERIFY_USER  from verify(user)
RPMVERIFY_GROUP  from verify(group)
RPMVERIFY_MTIME  from verify(mtime)
RPMVERIFY_MODE  from verify(mode)
RPMVERIFY_RDEV  from verify(rdev)
RPMVERIFY_CONTEXTS  verify: from --nocontexts
RPMVERIFY_READLINKFAIL  readlink failed
RPMVERIFY_READFAIL  file read failed
RPMVERIFY_LSTATFAIL  lstat failed
RPMVERIFY_LGETFILECONFAIL  lgetfilecon failed

Definition at line 123 of file rpmcli.h.

enum rpmVerifyFlags_e

Bit(s) to control rpmVerify() operation, stored in qva_flags.

Todo:
Merge rpmQueryFlags, rpmVerifyFlags, and rpmVerifyAttrs values?.
Enumerator:
VERIFY_DEFAULT 
VERIFY_MD5  from --nomd5
VERIFY_SIZE  from --nosize
VERIFY_LINKTO  from --nolinkto
VERIFY_USER  from --nouser
VERIFY_GROUP  from --nogroup
VERIFY_MTIME  from --nomtime
VERIFY_MODE  from --nomode
VERIFY_RDEV  from --nodev
VERIFY_CONTEXTS  verify: from --nocontexts
VERIFY_FILES  verify: from --nofiles
VERIFY_DEPS  verify: from --nodeps
VERIFY_SCRIPT  verify: from --noscripts
VERIFY_DIGEST  verify: from --nodigest
VERIFY_SIGNATURE  verify: from --nosignature
VERIFY_PATCHES  verify: from --nopatches
VERIFY_HDRCHK  verify: from --nohdrchk
VERIFY_FOR_LIST  query: from --list
VERIFY_FOR_STATE  query: from --state
VERIFY_FOR_DOCS  query: from --docfiles
VERIFY_FOR_CONFIG  query: from --configfiles
VERIFY_FOR_DUMPFILES  query: from --dump

Definition at line 192 of file rpmcli.h.


Function Documentation

static int checkSpec ( rpmts  ts,
Header  h 
) [static]

Definition at line 23 of file build.c.

References _, headerIsEntry(), RPMMESS_ERROR, rpmMessage, rpmpsFree(), rpmpsNumProblems(), rpmpsPrint(), RPMTAG_CONFLICTNAME, RPMTAG_REQUIRENAME, rpmtsAddInstallElement(), rpmtsCheck(), rpmtsClean(), and rpmtsProblems().

Referenced by buildForTarget().

int rpmcliArgIter ( rpmts  ts,
QVA_t  qva,
ARGV_t  argv 
)

Iterate over query/verify arg list.

Parameters:
ts transaction set
qva parsed query/verify options
argv query argument(s) (or NULL)
Returns:
0 on success, else no. of failures

Definition at line 706 of file query.c.

References FTS_COMFOLLOW, FTS_LOGICAL, FTS_NOSTAT, ftsOpts, giFlags, rpmQVKArguments_s::qva_gi, rpmQVKArguments_s::qva_rc, rpmQVKArguments_s::qva_source, RPMDBI_ARGLIST, RPMDBI_FTSWALK, RPMDBI_HDLIST, RPMDBI_PACKAGES, RPMGI_NOGLOB, RPMGI_NOHEADER, RPMGI_NONE, RPMGI_TSADD, rpmgiFree(), rpmgiHdrPath(), rpmgiNew(), rpmgiNext(), rpmgiSetArgs(), rpmQueryVerify(), RPMQV_ALL, RPMQV_FTSWALK, RPMQV_HDLIST, RPMQV_RPM, RPMRC_NOTFOUND, RPMRC_OK, and rpmtsEmpty().

Referenced by rpmcliQuery(), and rpmcliVerify().

rpmRC rpmcliImportPubkey ( const rpmts  ts,
const unsigned char *  pkt,
ssize_t  pktlen 
)

Import public key packet(s).

Todo:
Implicit --update policy for gpg-pubkey headers.
Parameters:
ts transaction set
pkt pgp pubkey packet(s)
pktlen pgp pubkey length
Returns:
RPMRC_OK/RPMRC_FAIL

Definition at line 421 of file rpmchecksig.c.

References _free(), headerAddEntry(), headerAddOrAppendEntry(), headerFree(), headerNew(), headerSprintf(), pgpFreeDig(), pgpHexStr(), pgpNewDig(), pgpPrtPkts(), pgpDig_s::pubkey, RPM_INT32_TYPE, RPM_STRING_ARRAY_TYPE, RPM_STRING_TYPE, rpmdbAdd(), rpmHeaderFormats, RPMRC_FAIL, RPMRC_OK, RPMSENSE_EQUAL, RPMSENSE_KEYRING, RPMTAG_BUILDHOST, RPMTAG_BUILDTIME, RPMTAG_DESCRIPTION, RPMTAG_GROUP, RPMTAG_INSTALLTIME, RPMTAG_LICENSE, RPMTAG_NAME, RPMTAG_PROVIDEFLAGS, RPMTAG_PROVIDENAME, RPMTAG_PROVIDEVERSION, RPMTAG_PUBKEYS, RPMTAG_RELEASE, RPMTAG_RPMVERSION, RPMTAG_SIZE, RPMTAG_SOURCERPM, RPMTAG_SUMMARY, RPMTAG_VERSION, rpmTagTable, rpmtsGetRdb(), rpmtsGetTid(), rpmtsOpenDB(), RPMVERSION, pgpDigParams_s::signid, stpcpy(), pgpDigParams_s::time, pgpDigParams_s::userid, pgpDigParams_s::version, and xmalloc().

Referenced by rpmcliImportPubkeys(), and rpmts_PgpImportPubkey().

static int rpmcliImportPubkeys ( const rpmts  ts,
QVA_t  qva,
const char **  argv 
) [static]

Import public key(s).

Todo:
Implicit --update policy for gpg-pubkey headers.
Parameters:
ts transaction set
qva mode flags and parameters
argv array of pubkey file names (NULL terminated)
Returns:
0 on success

Definition at line 564 of file rpmchecksig.c.

References _, _free(), PGPARMOR_PUBKEY, pgpReadPkts(), rpmcliImportPubkey(), RPMERR_IMPORT, rpmError, rpmExpand(), RPMRC_OK, and rpmtsClean().

Referenced by rpmcliSign().

int rpmcliQuery ( rpmts  ts,
QVA_t  qva,
const char **  argv 
)

Display package information.

Todo:
hack: RPMQV_ALL can pass char ** arglist = NULL, not char * arg. Union?
Parameters:
ts transaction set
qva parsed query/verify options
argv query argument(s) (or NULL)
Returns:
0 on success, else no. of failures

Definition at line 790 of file query.c.

References _free(), _QUERY_FOR_BITS, _RPMVSF_NODIGESTS, _RPMVSF_NOSIGNATURES, rpmQVKArguments_s::qva_flags, rpmQVKArguments_s::qva_queryFormat, rpmQVKArguments_s::qva_showPackage, rpmcliArgIter(), rpmExpand(), rpmExpandNumeric(), rpmtsSetVSFlags(), RPMVSF_NOHDRCHK, showQueryPackage(), VERIFY_DIGEST, VERIFY_HDRCHK, VERIFY_SIGNATURE, vsflags, and xstrdup().

Referenced by main().

int rpmcliShowMatches ( QVA_t  qva,
rpmts  ts 
)

Display query/verify information for each header in iterator.

This routine uses:

Parameters:
qva parsed query/verify options
ts transaction set
Returns:
result of last non-zero showPackage() return

Definition at line 402 of file query.c.

References rpmQVKArguments_s::qva_mi, rpmQVKArguments_s::qva_showPackage, rpmQVKArguments_s::qva_source, rpmdbFreeIterator(), rpmdbNextIterator(), and RPMQV_DBOFFSET.

Referenced by rpmQueryVerify().

int rpmcliSign ( rpmts  ts,
QVA_t  qva,
const char **  argv 
)

Create/Modify/Check elements from signature header.

Parameters:
ts transaction set
qva mode flags and parameters
argv array of arguments (NULL terminated)
Returns:
0 on success

Definition at line 1064 of file rpmchecksig.c.

References _, Fclose(), Ferror(), Fopen(), Fstrerror(), rpmQVKArguments_s::qva_mode, rpmcliImportPubkeys(), RPMERR_OPEN, rpmError, rpmReSign(), RPMSIGN_ADD_SIGNATURE, RPMSIGN_CHK_SIGNATURE, RPMSIGN_DEL_SIGNATURE, RPMSIGN_IMPORT_PUBKEY, RPMSIGN_NEW_SIGNATURE, RPMSIGN_NONE, and rpmVerifySignatures().

Referenced by main().

int rpmcliVerify ( rpmts  ts,
QVA_t  qva,
const char **  argv 
)

Verify package install.

Todo:
hack: RPMQV_ALL can pass char ** arglist = NULL, not char * arg. Union?
Parameters:
ts transaction set
qva parsed query/verify options
argv verify argument(s) (or NULL)
Returns:
0 on success, else no. of failures

Definition at line 475 of file verify.c.

References _RPMVSF_NODIGESTS, _RPMVSF_NOSIGNATURES, rpmQVKArguments_s::qva_flags, rpmQVKArguments_s::qva_showPackage, rpmcliArgIter(), rpmExpandNumeric(), rpmtsEmpty(), rpmtsSetVSFlags(), RPMVSF_NEEDPAYLOAD, RPMVSF_NOHDRCHK, showVerifyPackage(), VERIFY_DIGEST, VERIFY_HDRCHK, VERIFY_SIGNATURE, and vsflags.

Referenced by main().

void rpmDisplayQueryTags ( FILE *  fp  ) 

Display list of tags that can be used in --queryformat.

Parameters:
fp file handle to use for display

Definition at line 353 of file query.c.

References ext, HEADER_EXT_MORE, headerTagTableEntry_s::name, rpmHeaderFormats, rpmTagTable, and rpmTagTableSize.

Referenced by main(), and rpmcliAllArgCallback().

int rpmErase ( rpmts  ts,
struct rpmInstallArguments_s ia,
const char **  argv 
)

Erase binary rpm package.

Parameters:
ts transaction set
ia control args/bits
argv array of package file names (NULL terminated)
Returns:
0 on success

Definition at line 752 of file rpminstall.c.

References _, _RPMVSF_NODIGESTS, _RPMVSF_NOSIGNATURES, rpmInstallArguments_s::eraseInterfaceFlags, rpmEIU::h, INSTALL_LABEL, INSTALL_NOORDER, rpmInstallArguments_s::installInterfaceFlags, rpmEIU::numFailed, rpmInstallArguments_s::probFilter, rpmInstallArguments_s::qva_flags, rpmdbFreeIterator(), rpmdbGetIteratorOffset(), RPMDBI_LABEL, rpmdbNextIterator(), rpmExpandNumeric(), rpmIsVerbose, RPMMESS_ERROR, rpmMessage, RPMPROB_FILTER_DISKNODES, RPMPROB_FILTER_DISKSPACE, rpmpsFree(), rpmpsNumProblems(), rpmpsPrint(), rpmShowProgress(), RPMTRANS_FLAG_REPACKAGE, RPMTRANS_FLAG_REVERSE, rpmtsAddEraseElement(), rpmtsCheck(), rpmtsClean(), rpmtsEmpty(), rpmtsFlags(), rpmtsInitIterator(), rpmtsOrder(), rpmtsProblems(), rpmtsRun(), rpmtsSetFlags(), rpmtsSetNotifyCallback(), rpmtsSetVSFlags(), RPMVSF_NOHDRCHK, rpmInstallArguments_s::transFlags, UNINSTALL_ALLMATCHES, UNINSTALL_NODEPS, VERIFY_DIGEST, VERIFY_HDRCHK, VERIFY_SIGNATURE, and vsflags.

Referenced by main().

int rpmInstall ( rpmts  ts,
struct rpmInstallArguments_s ia,
const char **  fileArgv 
)

Install/upgrade/freshen binary rpm package.

Todo:
Generalize --freshen policies.

Definition at line 286 of file rpminstall.c.

References _, _free(), _RPMVSF_NODIGESTS, _RPMVSF_NOSIGNATURES, alloca(), Fclose(), Ferror(), Fopen(), Fstrerror(), ftpStrerror(), headerFree(), headerFreeData(), headerGetEntry(), headerIsEntry(), headerNVR(), INSTALL_FRESHEN, INSTALL_LABEL, INSTALL_NODEPS, INSTALL_NOORDER, INSTALL_UPGRADE, rpmInstallArguments_s::installInterfaceFlags, rpmInstallArguments_s::probFilter, rpmInstallArguments_s::qva_flags, rpmEIU::relocations, rpmInstallArguments_s::relocations, rpmcliPackagesTotal, rpmdbFreeIterator(), rpmdbGetIteratorCount(), rpmdbNextIterator(), rpmdsFree(), rpmdsSingle(), RPMERR_MANIFEST, RPMERR_OPEN, rpmError, rpmExpandNumeric(), rpmGenPath(), rpmGetPath(), rpmGlob(), rpmInstallSourcePackage(), rpmIsVerbose, RPMMESS_DEBUG, RPMMESS_ERROR, RPMMESS_NORMAL, rpmMessage, rpmpsFree(), rpmpsNumProblems(), rpmpsPrint(), RPMRC_FAIL, RPMRC_NOKEY, RPMRC_NOTFOUND, RPMRC_NOTTRUSTED, RPMRC_OK, rpmReadPackageFile(), rpmReadPackageManifest(), rpmShowProgress(), RPMTAG_NAME, RPMTAG_PREFIXES, RPMTAG_REQUIRENAME, RPMTAG_SOURCEPACKAGE, RPMTRANS_FLAG_NOCONTEXTS, RPMTRANS_FLAG_REPACKAGE, RPMTRANS_FLAG_TEST, rpmtsAddInstallElement(), rpmtsCheck(), rpmtsClean(), rpmtsFlags(), rpmtsInitIterator(), rpmtsOrder(), rpmtsProblems(), rpmtsRootDir(), rpmtsRun(), rpmtsSELinuxEnabled(), rpmtsSetFlags(), rpmtsSetNotifyCallback(), rpmtsSetVSFlags(), rpmtsSolve(), rpmVersionCompare(), RPMVSF_NEEDPAYLOAD, RPMVSF_NOHDRCHK, rpmInstallArguments_s::transFlags, URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_PATH, urlGetFile(), urlIsURL(), urlPath(), VERIFY_DIGEST, VERIFY_HDRCHK, VERIFY_SIGNATURE, vsflags, xrealloc(), and xstrdup().

Referenced by main().

int rpmInstallSource ( rpmts  ts,
const char *  arg,
const char **  specFilePtr,
const char **  cookie 
)

Install source rpm package.

Parameters:
ts transaction set
arg source rpm file name
Return values:
*specFilePtr (installed) spec file name
*cookie 
Returns:
0 on success

Definition at line 865 of file rpminstall.c.

References _, _free(), Fclose(), rpmEIU::fd, Ferror(), Fopen(), Fstrerror(), rpmInstallSourcePackage(), rpmIsVerbose, RPMMESS_ERROR, rpmMessage, rpmEIU::rpmrc, RPMRC_OK, rpmtsSetVSFlags(), rpmtsVSFlags(), and RPMVSF_NEEDPAYLOAD.

Referenced by main().

int rpmQueryVerify ( QVA_t  qva,
rpmts  ts,
const char *  arg 
)

Common query/verify source interface, called once for each CLI arg.

This routine uses:

Parameters:
qva parsed query/verify options
ts transaction set
arg name of source to query/verify
Returns:
showPackage() result, 1 if rpmdbInitIterator() is NULL

Definition at line 436 of file query.c.

References _, _free(), currentDirectory(), errno, F_OK, nibble(), PATH_MAX, rpmQVKArguments_s::qva_mi, rpmQVKArguments_s::qva_showPackage, rpmQVKArguments_s::qva_source, rpmQVKArguments_s::qva_specQuery, realpath(), rpmCleanPath(), rpmcliShowMatches(), rpmdbCheckSignals(), rpmdbFreeIterator(), RPMDBI_LABEL, RPMDBI_PACKAGES, rpmdbNextIterator(), RPMERR_QUERY, RPMERR_QUERYINFO, rpmError, rpmGetPath(), rpmgiShowMatches(), RPMMESS_DEBUG, rpmMessage, RPMQV_ALL, RPMQV_DBOFFSET, RPMQV_FILEID, RPMQV_FTSWALK, RPMQV_GROUP, RPMQV_HDLIST, RPMQV_HDRID, RPMQV_PACKAGE, RPMQV_PATH, RPMQV_PKGID, RPMQV_RPM, RPMQV_SPECFILE, RPMQV_TID, RPMQV_TRIGGEREDBY, RPMQV_WHATPROVIDES, RPMQV_WHATREQUIRES, RPMTAG_BASENAMES, RPMTAG_FILEMD5S, RPMTAG_GROUP, RPMTAG_INSTALLTID, RPMTAG_PROVIDENAME, RPMTAG_REQUIRENAME, RPMTAG_SHA1HEADER, RPMTAG_SIGMD5, RPMTAG_TRIGGERNAME, rpmtsInitIterator(), strerror, strtoul, and xstrdup().

Referenced by rpmcliArgIter().

static int rpmReSign ( rpmts  ts,
QVA_t  qva,
const char **  argv 
) [static]

Create/modify elements in signature header.

Parameters:
ts transaction set
qva mode flags and parameters
argv array of package file names (NULL terminated)
Returns:
0 on success

Definition at line 172 of file rpmchecksig.c.

References _, _free(), copyFile(), EXIT_FAILURE, Fstrerror(), getSignid(), headerAddEntry(), headerCopyLoad(), headerFree(), headerFreeData(), headerFreeIterator(), headerGetEntry(), headerInitIterator(), headerLink(), headerNew(), headerNextIterator(), headerReload(), headerRemoveEntry(), manageFile(), rpmQVKArguments_s::passPhrase, pgpHexStr(), rpmQVKArguments_s::qva_mode, readLead(), rpmAddSignature(), RPMERR_BADSIGTYPE, RPMERR_READLEAD, RPMERR_SIGGEN, RPMERR_WRITELEAD, rpmError, rpmFreeSignature(), RPMLOOKUPSIG_QUERY, rpmLookupSignatureType(), RPMMESS_WARNING, rpmMessage, RPMRC_OK, rpmReadSignature(), RPMSIGN_DEL_SIGNATURE, RPMSIGTAG_BADSHA1_1, RPMSIGTAG_BADSHA1_2, RPMSIGTAG_DSA, RPMSIGTAG_GPG, RPMSIGTAG_LEMD5_1, RPMSIGTAG_LEMD5_2, RPMSIGTAG_MD5, RPMSIGTAG_PGP, RPMSIGTAG_PGP5, RPMSIGTAG_RSA, RPMSIGTAG_SHA1, RPMSIGTAG_SIZE, RPMSIGTYPE_HEADERSIG, RPMTAG_HEADERSIGNATURES, rpmWriteSignature(), rpmlead::type, and writeLead().

Referenced by rpmcliSign().

int rpmRollback ( rpmts  ts,
struct rpmInstallArguments_s ia,
const char **  argv 
)

Rollback transactions, erasing new, reinstalling old, package(s).

Todo:
Transaction handling, more, needs work.

Definition at line 1088 of file rpminstall.c.

References _, _free(), _RPMVSF_NODIGESTS, _RPMVSF_NOSIGNATURES, IDT_s::h, headerFree(), IDTindex_s::idt, IDTXglob(), IDTXload(), INSTALL_ERASE, INSTALL_FRESHEN, INSTALL_INSTALL, INSTALL_LABEL, INSTALL_UPGRADE, rpmInstallArguments_s::installInterfaceFlags, IDT_s::instance, IDT_s::key, IDTindex_s::nidt, rpmInstallArguments_s::probFilter, rpmInstallArguments_s::qva_flags, rpmInstallArguments_s::relocations, rpmcliPackagesTotal, rpmExpand(), rpmExpandNumeric(), rpmIsDebug, rpmIsVerbose, RPMMESS_DEBUG, RPMMESS_ERROR, RPMMESS_NORMAL, rpmMessage, RPMPROB_FILTER_OLDPACKAGE, rpmpsFree(), rpmpsNumProblems(), rpmpsPrint(), rpmShowProgress(), RPMTAG_INSTALLTID, RPMTAG_REMOVETID, RPMTRANS_FLAG_REVERSE, RPMTRANS_TYPE_ROLLBACK, rpmtsAddEraseElement(), rpmtsAddInstallElement(), rpmtsCheck(), rpmtsClean(), rpmtsEmpty(), rpmtsOrder(), rpmtsProblems(), rpmtsRun(), rpmtsSetFlags(), rpmtsSetNotifyCallback(), rpmtsSetType(), rpmtsSetVSFlags(), RPMVSF_NEEDPAYLOAD, RPMVSF_NOHDRCHK, rpmInstallArguments_s::transFlags, IDT_s::u32, IDT_s::val, VERIFY_DIGEST, VERIFY_HDRCHK, and VERIFY_SIGNATURE.

Referenced by main(), and rpmts_Rollback().

void* rpmShowProgress ( const void *  arg,
const rpmCallbackType  what,
const unsigned long  amount,
const unsigned long  total,
fnpyKey  key,
void *  data 
)

The rpm CLI generic transaction callback handler.

Todo:
Remove headerSprintf() from the progress callback.
Deprecated:
Transaction callback arguments need to change, so don't rely on this routine in the rpmcli API.
Parameters:
arg per-callback private data (e.g. an rpm header)
what callback identifier
amount per-callback progress info
total per-callback progress info
key opaque header key (e.g. file name or PyObject)
data private data (e.g. rpmInstallInterfaceFlags)
Returns:
per-callback data (e.g. an opened FD_t)

Definition at line 92 of file rpminstall.c.

Referenced by rpmErase(), rpmInstall(), and rpmRollback().

void rpmShowRpmlibProvides ( FILE *  fp  ) 

Display current rpmlib feature provides.

Parameters:
fp output file handle

Definition at line 62 of file rpmlibprov.c.

References rpmlibProvides_s::featureDescription, rpmlibProvides_s::featureEVR, rpmlibProvides_s::featureFlags, rpmlibProvides_s::featureName, rpmdsDNEVR(), rpmdsFree(), rpmdsSingle(), rpmlibProvides, and RPMTAG_PROVIDENAME.

Referenced by rpmShowRC().

int rpmVerifyFile ( const rpmts  ts,
rpmfi  fi,
rpmVerifyAttrs res,
rpmVerifyAttrs  omitMask 
)

Verify file attributes (including MD5 sum).

Todo:
gnorpm and python bindings prevent this from being static.
Parameters:
ts transaction set
fi file info (with linked header and current file index)
Return values:
*res bit(s) returned to indicate failure
Parameters:
omitMask bit(s) to disable verify checks
Returns:
0 on success (or not installed), 1 on error

Definition at line 27 of file verify.c.

References alloca(), domd5(), gidToGname(), Lstat(), Readlink(), rpmfiFFlags(), rpmfiFGroup(), rpmfiFLink(), rpmfiFMode(), rpmfiFMtime(), rpmfiFN(), rpmfiFRdev(), rpmfiFSize(), rpmfiFState(), rpmfiFUser(), RPMFILE_GHOST, RPMFILE_STATE_NETSHARED, RPMFILE_STATE_NORMAL, RPMFILE_STATE_NOTINSTALLED, RPMFILE_STATE_REPLACED, RPMFILE_STATE_WRONGCOLOR, rpmfiMD5(), rpmfiVFlags(), rpmtsRootDir(), rpmtsSELinuxEnabled(), RPMVERIFY_FAILURES, RPMVERIFY_FILESIZE, RPMVERIFY_GROUP, RPMVERIFY_LINKTO, RPMVERIFY_LSTATFAIL, RPMVERIFY_MD5, RPMVERIFY_MODE, RPMVERIFY_MTIME, RPMVERIFY_NONE, RPMVERIFY_RDEV, RPMVERIFY_READFAIL, RPMVERIFY_READLINKFAIL, RPMVERIFY_USER, S_ISDEV, S_ISLNK, stpcpy(), and uidToUname().

Referenced by verifyHeader().

int showQueryPackage ( QVA_t  qva,
rpmts  ts,
Header  h 
)

Display results of package query.

Todo:
Devise a meaningful return code.
Parameters:
qva parsed query/verify options
ts transaction set
h header to use for query
Returns:
0 always

Definition at line 149 of file query.c.

References _, _free(), flushBuffer(), printFileInfo(), QUERY_FOR_CONFIG, QUERY_FOR_DOCS, QUERY_FOR_DUMPFILES, QUERY_FOR_LIST, QUERY_FOR_STATE, queryHeader(), rpmQVKArguments_s::qva_fflags, rpmQVKArguments_s::qva_flags, rpmQVKArguments_s::qva_queryFormat, RPMERR_INTERNAL, rpmError, rpmfiFC(), rpmfiFFlags(), rpmfiFGroup(), rpmfiFLink(), rpmfiFMode(), rpmfiFMtime(), rpmfiFN(), rpmfiFNlink(), rpmfiFRdev(), rpmfiFree(), rpmfiFSize(), rpmfiFState(), rpmfiFUser(), rpmfiInit(), RPMFILE_CONFIG, RPMFILE_DOC, RPMFILE_GHOST, RPMFILE_STATE_MISSING, RPMFILE_STATE_NETSHARED, RPMFILE_STATE_NORMAL, RPMFILE_STATE_NOTINSTALLED, RPMFILE_STATE_REPLACED, RPMFILE_STATE_WRONGCOLOR, rpmfiMD5(), rpmfiNew(), rpmfiNext(), rpmIsVerbose, RPMTAG_BASENAMES, stpcpy(), xmalloc(), and xrealloc().

Referenced by rpmcliQuery().

int showVerifyPackage ( QVA_t  qva,
rpmts  ts,
Header  h 
)

Display results of package verify.

Parameters:
qva parsed query/verify options
ts transaction set
h header to use for verify
Returns:
result of last non-zero verify return

Definition at line 435 of file verify.c.

References _rpmds_unspecified_epoch_noise, Fclose(), fdDup(), headerIsEntry(), rpmQVKArguments_s::qva_flags, rpmfiFree(), rpmfiNew(), rpmIsVerbose, RPMTAG_BASENAMES, RPMTAG_VERIFYSCRIPT, rpmVerifyScript(), VERIFY_DEPS, VERIFY_FILES, VERIFY_SCRIPT, verifyDependencies(), and verifyHeader().

Referenced by rpmcliVerify().


Variable Documentation

int _noDirTokens

Should version 3 packages be produced?

Definition at line 256 of file legacy.c.

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

struct rpmBuildArguments_s rpmBTArgs

Definition at line 16 of file poptBT.c.

Referenced by buildArgCallback(), and main().

struct poptOption rpmBuildPoptTable[]

Definition at line 153 of file poptBT.c.

struct poptOption rpmcliAllPoptTable[]

Popt option table for options shared by all modes and executables.

Definition at line 250 of file poptALL.c.

rpmQueryFlags rpmcliQueryFlags

Bit(s) from common command line options.

Definition at line 101 of file poptALL.c.

Referenced by main(), and rpmcliAllArgCallback().

struct poptOption rpmDatabasePoptTable[]

Definition at line 16 of file poptDB.c.

struct rpmDatabaseArguments_s rpmDBArgs

Definition at line 12 of file poptDB.c.

Referenced by main().

struct rpmInstallArguments_s rpmIArgs

Definition at line 17 of file poptI.c.

Referenced by installArgCallback(), and main().

struct poptOption rpmInstallPoptTable[]

Definition at line 161 of file poptI.c.

struct poptOption rpmQueryPoptTable[]

Query mode options.

Definition at line 262 of file poptQV.c.

struct rpmQVKArguments_s rpmQVKArgs

Definition at line 15 of file poptQV.c.

Referenced by main(), queryArgCallback(), and rpmQVSourceArgCallback().

struct poptOption rpmQVSourcePoptTable[]

Common query/verify mode options.

Definition at line 101 of file poptQV.c.

struct poptOption rpmSignPoptTable[]

Signature mode options.

Definition at line 398 of file poptQV.c.

struct poptOption rpmVerifyPoptTable[]

Verify mode options.

Definition at line 307 of file poptQV.c.

int specedit

Definition at line 18 of file poptQV.c.


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