rpm 5.2.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

Files | Data Structures | Functions | Variables
RPMCLI.
Collaboration diagram for 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 stayl.nosp@m.or@r.nosp@m.edhat.nosp@m..com was here, now he's not.
file | rpmrollback.c
file | verify.c
| Verify installed payload files from package metadata.
file | poptDB.c
| Popt tables for database modes.

## Data Structures
struct | rpmQVKArguments_s
| Command line option information. More...
struct | rpmBuildArguments_s
| Describe build command line request. More...

## Functions
static int | checkSpec (rpmts ts, Header h)
| Parse spec file and build package. More...
static int | rpmReSign (rpmts ts, QVA_t qva, const char **argv)
| Create/modify elements in signature header. More...
static int | rpmcliImportPubkeys (const rpmts ts, QVA_t qva, const char **argv)
| Import public key(s). More...
static int | rpmVerifyFile (const rpmts ts, const rpmfi fi, rpmVerifyAttrs *res, rpmVerifyAttrs omitMask)
| Verify file attributes (including file digest). More...

## Variables
int | _noDirTokens
| Should version 3 packages be produced? More...
struct poptOption | rpmcliAllPoptTable []
| Popt option table for options shared by all modes and executables. More...
struct rpmQVKArguments_s | rpmQVKArgs
struct rpmQVKArguments_s | rpmIArgs
struct rpmQVKArguments_s | rpmDBArgs

## RPMQV
enum | rpmQVSources_e { RPMQV_PACKAGE = 0, RPMQV_PATH, RPMQV_ALL, RPMQV_RPM, RPMQV_GROUP = RPMTAG_GROUP, RPMQV_WHATPROVIDES, RPMQV_WHATREQUIRES, RPMQV_TRIGGEREDBY = RPMTAG_TRIGGERNAME, RPMQV_DBOFFSET, RPMQV_SPECFILE, RPMQV_PKGID, RPMQV_HDRID, RPMQV_FILEID, RPMQV_TID, RPMQV_HDLIST, RPMQV_FTSWALK, RPMQV_WHATNEEDS, RPMQV_SPECSRPM, RPMQV_SOURCEPKGID, RPMQV_WHATCONFLICTS = RPMTAG_CONFLICTNAME, RPMQV_WHATOBSOLETES = RPMTAG_OBSOLETENAME }
| Query/Verify argument qualifiers. More...
enum | rpmVerifyAttrs_e { RPMVERIFY_NONE = 0, RPMVERIFY_FDIGEST = (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_FDIGEST = (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_FDIGEST = (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...
typedef enum rpmQVSources_e | rpmQVSources
| Query/Verify argument qualifiers. More...
typedef enum rpmVerifyAttrs_e | rpmVerifyAttrs
| Bit(s) for rpmVerifyFile() attributes and result. More...
typedef enum rpmQueryFlags_e | rpmQueryFlags
| Bit(s) to control rpmQuery() operation, stored in qva_flags. More...
typedef enum rpmVerifyFlags_e | rpmVerifyFlags
| Bit(s) to control rpmVerify() operation, stored in qva_flags. More...
typedef struct rpmQVKArguments_s * | QVA_t
typedef int(* | QVF_t )(QVA_t qva, rpmts ts, Header h)
| Function to display iterator matches. More...
typedef int(* | QSpecF_t )(rpmts ts, QVA_t qva, const char *arg)
| Function to query spec file. More...
rpmQueryFlags | rpmcliQueryFlags
| Bit(s) from common command line options. More...
struct poptOption | rpmQVSourcePoptTable []
| Common query/verify mode options. More...
int | specedit
struct poptOption | rpmQueryPoptTable []
| Query mode options. More...
struct poptOption | rpmVerifyPoptTable []
| Verify mode options. More...
int | rpmcliShowMatches (QVA_t qva, rpmts ts)
| Display query/verify information for each header in iterator. More...
int | rpmQueryVerify (QVA_t qva, rpmts ts, const char *arg)
| Common query/verify source interface, called once for each CLI arg. More...
int | showQueryPackage (QVA_t qva, rpmts ts, Header h)
| Display results of package query. More...
int | rpmcliArgIter (rpmts ts, QVA_t qva, const char **argv)
| Iterate over query/verify arg list. More...
int | rpmcliQuery (rpmts ts, QVA_t qva, const char **argv)
| Display package information. More...
int | showVerifyPackage (QVA_t qva, rpmts ts, Header h)
| Display results of package verify. More...
int | rpmcliVerify (rpmts ts, QVA_t qva, const char **argv)
| Verify package install. More...

## 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), INSTALL_ALLMATCHES = (1 << 9) }
| Bit(s) to control rpmcliInstall() and rpmErase() operation. More...
typedef enum rpmInstallInterfaceFlags_e | rpmInstallInterfaceFlags
| Bit(s) to control rpmcliInstall() and rpmErase() operation. More...
struct poptOption | rpmInstallPoptTable []
int | rpmcliPackagesTotal
int | rpmcliHashesCurrent
int | rpmcliHashesTotal
rpmuint64_t | rpmcliProgressCurrent
rpmuint64_t | rpmcliProgressTotal
void * | rpmShowProgress (const void *arg, const rpmCallbackType what, const rpmuint64_t amount, const rpmuint64_t total, fnpyKey key, void *data)
| The rpm CLI generic transaction callback handler. More...
int | rpmInstallSource (rpmts ts, const char *arg, const char **specFilePtr, const char **cookie)
| Install source rpm package. More...
int | rpmcliInstallProblems (rpmts ts, const char *msg, int rc)
| Report package problems (if any). More...
int | rpmcliInstallSuggests (rpmts ts)
| Report packages(if any) that satisfy unresolved dependencies. More...
int | rpmcliInstallCheck (rpmts ts)
| Check package element dependencies in a transaction set, reporting problems. More...
int | rpmcliInstallOrder (rpmts ts)
| Order package elements in a transaction set, reporting problems. More...
int | rpmcliInstallRun (rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet)
| Install/erase package elements in a transaction set, reporting problems. More...
int | rpmcliInstall (rpmts ts, QVA_t ia, const char **argv)
| Install/upgrade/freshen binary rpm package. More...
int | rpmErase (rpmts ts, QVA_t ia, const char **argv)
| Erase binary rpm package. More...

## RPMDB
struct poptOption | rpmDatabasePoptTable []

## 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...
typedef enum rpmSignFlags_e | rpmSignFlags
| Bit(s) to control rpmReSign() operation. More...
struct poptOption | rpmSignPoptTable []
| Signature mode options. More...
rpmRC | rpmcliImportPubkey (const rpmts ts, const unsigned char *pkt, ssize_t pktlen)
| Import public key packet(s). More...
int | rpmcliSign (rpmts ts, QVA_t qva, const char **argv)
| Create/Modify/Check elements from signature header. More...

## RPMBT
typedef struct rpmBuildArguments_s * | BTA_t
struct rpmBuildArguments_s | rpmBTArgs
struct poptOption | rpmBuildPoptTable []

## Detailed Description

## Typedef Documentation

typedef struct rpmBuildArguments_s* BTA_t

Definition at line 750 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 271 of file rpmcli.h.

typedef struct rpmQVKArguments_s* QVA_t

Definition at line 249 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 259 of file rpmcli.h.

typedef enum rpmInstallInterfaceFlags_e rpmInstallInterfaceFlags

Bit(s) to control rpmcliInstall() and rpmErase() operation.

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 rpmInstallInterfaceFlags_e

Bit(s) to control rpmcliInstall() and rpmErase() operation.

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
INSTALL_ALLMATCHES | from –allmatches (erase)

Definition at line 415 of file rpmcli.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_FDIGEST | from –nofdigest
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 167 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 |
RPMQV_WHATPROVIDES | ... from provides db search.
RPMQV_WHATREQUIRES | ... from requires db search.
RPMQV_TRIGGEREDBY |
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 digest, usually MD5).
RPMQV_TID | ... from install transaction id (time stamp).
RPMQV_HDLIST | ... from system hdlist.
RPMQV_FTSWALK | ... from fts(3) walk.
RPMQV_WHATNEEDS | ... from requires using contained provides.
RPMQV_SPECSRPM | ... srpm from spec file parse (query only).
RPMQV_SOURCEPKGID | ... from source package id (header+payload MD5).
RPMQV_WHATCONFLICTS |
RPMQV_WHATOBSOLETES |

Definition at line 112 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 603 of file rpmcli.h.

enum rpmVerifyAttrs_e

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

Enumerator
RPMVERIFY_NONE |
RPMVERIFY_FDIGEST | from verify(digest)
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 139 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_FDIGEST | from –nofdigest
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 209 of file rpmcli.h.

## Function Documentation

static int checkSpec | ( | rpmts | ts,
|  | Header | h
| ) |  |
| static

Parse spec file and build package.

Definition at line 33 of file build.c.

References _free(), F_OK, and rpmGetPath().

int rpmcliArgIter | ( | rpmts | ts,
|  | QVA_t | qva,
|  | const char ** | 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

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 479 of file rpmchecksig.c.

References _free(), alloca(), _HE_s::append, rpmDataType_u::argv, _HE_s::c, headerAddI18NString(), headerFree(), headerNew(), headerPut(), headerSprintf(), _HE_s::p, pgpDigFree(), pgpDigNew(), pgpGetPubkey(), pgpHexStr(), pgpPrtPkts(), rpmDataType_u::ptr, RPM_STRING_ARRAY_TYPE, RPM_STRING_TYPE, RPM_UINT32_TYPE, rpmdbAdd(), rpmHeaderFormats, RPMRC_FAIL, RPMRC_OK, RPMSENSE_EQUAL, RPMTAG_ARCH, RPMTAG_BUILDHOST, RPMTAG_BUILDTIME, RPMTAG_DESCRIPTION, RPMTAG_GROUP, RPMTAG_INSTALLTIME, RPMTAG_LICENSE, RPMTAG_NAME, RPMTAG_OS, RPMTAG_PROVIDEFLAGS, RPMTAG_PROVIDENAME, RPMTAG_PROVIDEVERSION, RPMTAG_PUBKEYS, RPMTAG_RELEASE, RPMTAG_RPMVERSION, RPMTAG_SIZE, RPMTAG_SOURCERPM, RPMTAG_SUMMARY, RPMTAG_VERSION, rpmtsGetRdb(), rpmtsGetTid(), rpmtsOpenDB(), RPMVERSION, stpcpy(), rpmDataType_u::str, _HE_s::t, _HE_s::tag, rpmDataType_u::ui32p, xmalloc(), and xstrdup().

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 731 of file rpmchecksig.c.

References _, _free(), PGPARMOR_PUBKEY, pgpReadPkts(), rpmcliImportPubkey(), rpmExpand(), rpmlog(), RPMLOG_ERR, RPMRC_OK, and rpmtsClean().

Referenced by rpmcliSign().

int rpmcliInstall | ( | rpmts | ts,
|  | QVA_t | ia,
|  | const char ** | argv
| ) |  |

Install/upgrade/freshen binary rpm package.

Todo:
  Use rpmdsCompare rather than rpmVersionCompare.

Parameters

  ts | transaction set
  ia | mode flags and parameters
  argv | array of package file names (NULL terminated)

Returns
  0 on success

Todo:
  Generalize –freshen policies.

Definition at line 495 of file rpminstall.c.

References _, _free(), _RPMVSF_NODIGESTS, _RPMVSF_NOSIGNATURES, addMacro(), alloca(), rpmQVKArguments_s::arbtid, rpmDataType_u::argv, argvAdd(), argvFree(), _HE_s::c, D_, delMacro(), rpmQVKArguments_s::depFlags, FTS_COMFOLLOW, FTS_LOGICAL, FTS_NOSTAT, headerFree(), headerGet(), headerLink(), INSTALL_FRESHEN, INSTALL_LABEL, INSTALL_NODEPS, INSTALL_NOORDER, INSTALL_UPGRADE, rpmQVKArguments_s::installInterfaceFlags, matchpathcon_fini, rpmRelocation_s::newPath, rpmRelocation_s::oldPath, _HE_s::p, rpmQVKArguments_s::probFilter, rpmDataType_u::ptr, rpmQVKArguments_s::qva_flags, rpmQVKArguments_s::qva_source, rpmQVKArguments_s::relocations, RMIL_GLOBAL, rpmcliEraseElement(), rpmcliInstallCheck(), rpmcliInstallElementPath(), rpmcliInstallOrder(), rpmcliInstallRun(), rpmcliInstallSuggests(), rpmcliPackagesTotal, RPMDBI_ARGLIST, RPMDBI_FTSWALK, rpmExpandNumeric(), RPMGI_NONE, rpmgiFree(), rpmgiHdrPath(), rpmgiHeader(), rpmgiNew(), rpmgiNext(), rpmgiReadHeader(), rpmgiSetArgs(), rpmioFtsOpts, rpmIsVerbose, rpmlog(), RPMLOG_DEBUG, RPMLOG_ERR, rpmmiCount(), rpmmiFree(), rpmmiNext(), RPMQV_FTSWALK, RPMRC_FAIL, RPMRC_NOTFOUND, RPMRC_OK, rpmShowProgress(), RPMTAG_NAME, RPMTAG_NVRA, RPMTAG_PREFIXES, RPMTRANS_FLAG_NOCONTEXTS, RPMTRANS_FLAG_REPACKAGE, rpmtsAddInstallElement(), rpmtsClean(), rpmtsEmpty(), rpmtsInitIterator(), rpmtsNElements(), rpmtsSetARBGoal(), rpmtsSetDFlags(), rpmtsSetFlags(), rpmtsSetGoal(), rpmtsSetNotifyCallback(), rpmtsSetVSFlags(), rpmVersionCompare(), RPMVSF_NEEDPAYLOAD, RPMVSF_NOHDRCHK, rpmDataType_u::str, _HE_s::tag, rpmQVKArguments_s::transFlags, TSM_INSTALL, VERIFY_DIGEST, VERIFY_HDRCHK, VERIFY_SIGNATURE, vsflags, and xstrdup().

Referenced by main().

int rpmcliInstallCheck | ( | rpmts | ts | ) |

Check package element dependencies in a transaction set, reporting problems.

Parameters

  ts | transaction set

Returns
  no. of (added) packages

Definition at line 310 of file rpminstall.c.

References _, rpmcliInstallProblems(), and rpmtsCheck().

Referenced by main(), rpmcliInstall(), and rpmErase().

int rpmcliInstallOrder | ( | rpmts | ts | ) |

Order package elements in a transaction set, reporting problems.

Parameters

  ts | transaction set

Returns
  no. of (added) packages

Definition at line 317 of file rpminstall.c.

References _, rpmcliInstallProblems(), and rpmtsOrder().

Referenced by main(), rpmcliInstall(), and rpmErase().

int rpmcliInstallProblems | ( | rpmts | ts,
|  | const char * | msg,
|  | int | rc
| ) |  |

Report package problems (if any).

Parameters

  ts | transaction set
  msg | problem context string to display
  rc | result of a tranbsaction operation

Returns
  no. of (added) packages

Definition at line 278 of file rpminstall.c.

References rpmlog(), RPMLOG_ERR, rpmpsFree(), rpmpsNumProblems(), rpmpsPrint(), and rpmtsProblems().

Referenced by rpmcliInstallCheck(), rpmcliInstallOrder(), rpmcliInstallRun(), and rpmRollback().

int rpmcliInstallRun | ( | rpmts | ts,
|  | rpmps | okProbs,
|  | rpmprobFilterFlags | ignoreSet
| ) |  |

Install/erase package elements in a transaction set, reporting problems.

Parameters

  ts | transaction set
  okProbs | previously known problems (or NULL)
  ignoreSet | bits to filter problem types

Returns
  0 on success, -1 on error, >0 no, of failed elements

Definition at line 324 of file rpminstall.c.

References _, rpmcliInstallProblems(), and rpmtsRun().

Referenced by main(), rpmcliInstall(), and rpmErase().

int rpmcliInstallSuggests | ( | rpmts | ts | ) |

Report packages(if any) that satisfy unresolved dependencies.

Parameters

  ts | transaction set

Returns
  0 always

Definition at line 293 of file rpminstall.c.

References _, _free(), rpmlog(), and RPMLOG_NOTICE.

Referenced by rpmcliInstall().

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 841 of file query.c.

References _free(), _QUERY_FOR_BITS, _RPMVSF_NODIGESTS, _RPMVSF_NOSIGNATURES, rpmQVKArguments_s::depFlags, rpmQVKArguments_s::qva_flags, rpmQVKArguments_s::qva_queryFormat, rpmQVKArguments_s::qva_showPackage, rpmcliArgIter(), rpmExpand(), rpmExpandNumeric(), rpmtsSetDFlags(), rpmtsSetFlags(), rpmtsSetVSFlags(), RPMVSF_NOHDRCHK, showQueryPackage(), rpmQVKArguments_s::transFlags, 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:

- qva->qva_mi rpm database iterator
- qva->qva_showPackage query/verify display routine

Parameters

  qva | parsed query/verify options
  ts | transaction set

Returns
  result of last non-zero showPackage() return

Definition at line 417 of file query.c.

References rpmQVKArguments_s::qva_mi, rpmQVKArguments_s::qva_showFAIL, rpmQVKArguments_s::qva_showOK, rpmQVKArguments_s::qva_showPackage, rpmQVKArguments_s::qva_source, rpmmiFree(), rpmmiNext(), 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 1142 of file rpmchecksig.c.

References _, Fclose(), Ferror(), Fopen(), Fstrerror(), FTS_COMFOLLOW, FTS_LOGICAL, FTS_NOSTAT, rpmQVKArguments_s::qva_mode, rpmQVKArguments_s::qva_source, rpmcliImportPubkeys(), RPMDBI_ARGLIST, RPMDBI_FTSWALK, RPMGI_NOHEADER, RPMGI_NONE, rpmgiFree(), rpmgiHdrPath(), rpmgiNew(), rpmgiNext(), rpmgiSetArgs(), rpmioFtsOpts, rpmlog(), RPMLOG_ERR, RPMQV_FTSWALK, RPMRC_OK, 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 537 of file verify.c.

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

Referenced by main().

int rpmErase | ( | rpmts | ts,
|  | QVA_t | ia,
|  | const char ** | argv
| ) |  |

Erase binary rpm package.

Parameters

  ts | transaction set
  ia | control args/bits
  argv | array of package names (NULL terminated)

Returns
  0 on success

Definition at line 716 of file rpminstall.c.

References _, _RPMVSF_NODIGESTS, _RPMVSF_NOSIGNATURES, rpmQVKArguments_s::arbtid, D_, rpmQVKArguments_s::depFlags, INSTALL_ALLMATCHES, INSTALL_LABEL, INSTALL_NODEPS, INSTALL_NOORDER, rpmQVKArguments_s::installInterfaceFlags, rpmQVKArguments_s::probFilter, rpmQVKArguments_s::qva_flags, rpmcliInstallCheck(), rpmcliInstallOrder(), rpmcliInstallRun(), RPMDBI_LABEL, rpmExpandNumeric(), rpmIsVerbose, rpmlog(), RPMLOG_DEBUG, RPMLOG_ERR, rpmmiFree(), rpmmiInstance(), rpmmiNext(), RPMPROB_FILTER_DISKNODES, RPMPROB_FILTER_DISKSPACE, rpmShowProgress(), RPMTRANS_FLAG_REPACKAGE, rpmtsAddEraseElement(), rpmtsClean(), rpmtsEmpty(), rpmtsInitIterator(), rpmtsSetARBGoal(), rpmtsSetDFlags(), rpmtsSetFlags(), rpmtsSetGoal(), rpmtsSetNotifyCallback(), rpmtsSetVSFlags(), RPMVSF_NOHDRCHK, rpmQVKArguments_s::transFlags, TSM_ERASE, VERIFY_DIGEST, VERIFY_HDRCHK, VERIFY_SIGNATURE, and vsflags.

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 815 of file rpminstall.c.

References _, _free(), Fclose(), Ferror(), Fopen(), Fstrerror(), rpmInstallSourcePackage(), rpmIsVerbose, rpmlog(), RPMLOG_ERR, 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:

- qva->qva_mi rpm database iterator
- qva->qva_showPackage query/verify display routine

Parameters

  qva | parsed query/verify options
  ts | transaction set
  arg | name of source to query/verify

Returns
  showPackage() result, 1 if rpmmiInit() is NULL

Definition at line 453 of file query.c.

References _, _free(), alloca(), currentDirectory(), D_, errno, Lstat(), nibble(), PATH_MAX, rpmQVKArguments_s::qva_mi, rpmQVKArguments_s::qva_showFAIL, rpmQVKArguments_s::qva_showOK, rpmQVKArguments_s::qva_showPackage, rpmQVKArguments_s::qva_source, rpmQVKArguments_s::qva_specQuery, Realpath(), rpmCleanPath(), rpmcliShowMatches(), rpmdbCheckSignals(), RPMDBI_LABEL, RPMDBI_PACKAGES, rpmGetPath(), rpmgiShowMatches(), rpmlog(), RPMLOG_DEBUG, RPMLOG_ERR, RPMLOG_NOTICE, RPMQV_ALL, RPMQV_DBOFFSET, RPMQV_FILEID, RPMQV_FTSWALK, RPMQV_GROUP, RPMQV_HDLIST, RPMQV_HDRID, RPMQV_PACKAGE, RPMQV_PATH, RPMQV_PKGID, RPMQV_RPM, RPMQV_SOURCEPKGID, RPMQV_SPECFILE, RPMQV_SPECSRPM, RPMQV_TID, RPMQV_TRIGGEREDBY, RPMQV_WHATCONFLICTS, RPMQV_WHATNEEDS, RPMQV_WHATOBSOLETES, RPMQV_WHATPROVIDES, RPMQV_WHATREQUIRES, RPMTAG_BASENAMES, RPMTAG_FILEDIGESTS, RPMTAG_GROUP, RPMTAG_INSTALLTID, RPMTAG_PKGID, RPMTAG_PROVIDENAME, RPMTAG_REQUIRENAME, RPMTAG_SHA1HEADER, RPMTAG_SOURCEPKGID, RPMTAG_TRIGGERNAME, rpmtsInitIterator(), tagName(), 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 178 of file rpmchecksig.c.

References _, _free(), alloca(), copyFile(), EXIT_FAILURE, Fstrerror(), FTS_COMFOLLOW, FTS_LOGICAL, FTS_NOSTAT, getSignid(), headerCopyLoad(), headerDel(), headerFini(), headerFree(), headerGet(), headerInit(), headerLink(), headerNew(), headerNext(), headerPut(), headerReload(), manageFile(), _HE_s::p, rpmQVKArguments_s::passPhrase, pgpHexStr(), rpmDataType_u::ptr, rpmQVKArguments_s::qva_mode, rpmQVKArguments_s::qva_source, Rename(), rpmAddSignature(), RPMDBI_ARGLIST, RPMDBI_FTSWALK, RPMGI_NOHEADER, RPMGI_NONE, rpmgiFree(), rpmgiHdrPath(), rpmgiNew(), rpmgiNext(), rpmgiSetArgs(), rpmioFtsOpts, rpmlog(), RPMLOG_ERR, RPMLOG_WARNING, rpmpkgRead(), rpmpkgWrite(), RPMQV_FTSWALK, RPMRC_OK, 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, RPMTAG_HEADERSIGNATURES, stpcpy(), _HE_s::tag, and Unlink().

Referenced by rpmcliSign().

void* rpmShowProgress | ( | const void * | arg,
|  | const rpmCallbackType | what,
|  | const rpmuint64_t | amount,
|  | const rpmuint64_t | total,
|  | fnpyKey | key,
|  | void * | data
| ) |  |

The rpm CLI generic transaction callback handler.

Todo:
  Remove headerSprintf() from the progress callback.

Warning
  This function's args have changed, so the function cannot be used portably

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 103 of file rpminstall.c.

References _, _free(), Fclose(), fdFree(), fdLink(), Ferror(), Fopen(), Fstrerror(), headerSprintf(), INSTALL_HASH, INSTALL_LABEL, INSTALL_PERCENT, printHash(), RPMCALLBACK_CPIO_ERROR, RPMCALLBACK_INST_CLOSE_FILE, RPMCALLBACK_INST_OPEN_FILE, RPMCALLBACK_INST_PROGRESS, RPMCALLBACK_INST_START, RPMCALLBACK_REPACKAGE_PROGRESS, RPMCALLBACK_REPACKAGE_START, RPMCALLBACK_REPACKAGE_STOP, RPMCALLBACK_SCRIPT_ERROR, RPMCALLBACK_TRANS_PROGRESS, RPMCALLBACK_TRANS_START, RPMCALLBACK_TRANS_STOP, RPMCALLBACK_UNINST_PROGRESS, RPMCALLBACK_UNINST_START, RPMCALLBACK_UNINST_STOP, RPMCALLBACK_UNKNOWN, RPMCALLBACK_UNPACK_ERROR, rpmcliHashesCurrent, rpmcliPackagesTotal, rpmcliProgressCurrent, rpmcliProgressTotal, rpmExpand(), rpmHeaderFormats, rpmlog(), RPMLOG_ERR, URL_IS_HTTP, URL_IS_HTTPS, and urlPath().

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

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

Verify file attributes (including file digest).

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 46 of file verify.c.

References alloca(), dodigest(), gidToGname(), Lstat(), Readlink(), rpmfiDigest(), 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, rpmfiVFlags(), rpmtsRootDir(), RPMVERIFY_FAILURES, RPMVERIFY_FDIGEST, RPMVERIFY_FILESIZE, RPMVERIFY_GROUP, RPMVERIFY_LINKTO, RPMVERIFY_LSTATFAIL, 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 175 of file query.c.

References _, _free(), flushBuffer(), headerSetRpmdb(), 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, rpmfiDigest(), 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, rpmfiNew(), rpmfiNext(), rpmIsVerbose, rpmlog(), RPMLOG_CRIT, RPMTAG_BASENAMES, stpcpy(), xcalloc(), 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 494 of file verify.c.

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

Referenced by rpmcliVerify(), and unsatisfiedDepend().

## Variable Documentation

int _noDirTokens

Should version 3 packages be produced?

struct rpmBuildArguments_s rpmBTArgs

Definition at line 24 of file poptBT.c.

Referenced by buildArgCallback(), main(), prepFetch(), and prepFetchVerbose().

struct poptOption rpmBuildPoptTable[]

Definition at line 137 of file poptBT.c.

struct poptOption rpmcliAllPoptTable[]

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

Definition at line 382 of file poptALL.c.

int rpmcliHashesCurrent

Definition at line 42 of file rpminstall.c.

Referenced by printHash(), and rpmShowProgress().

int rpmcliHashesTotal

Definition at line 44 of file rpminstall.c.

Referenced by printHash().

int rpmcliPackagesTotal

Definition at line 40 of file rpminstall.c.

Referenced by rpmcliInstall(), rpmRollback(), rpmShowProgress(), and rpmtsAddInstallElement().

rpmuint64_t rpmcliProgressCurrent

Definition at line 46 of file rpminstall.c.

Referenced by printHash(), and rpmShowProgress().

rpmuint64_t rpmcliProgressTotal

Definition at line 48 of file rpminstall.c.

Referenced by printHash(), and rpmShowProgress().

rpmQueryFlags rpmcliQueryFlags

Bit(s) from common command line options.

Definition at line 153 of file poptALL.c.

Referenced by main(), and rpmcliAllArgCallback().

struct poptOption rpmDatabasePoptTable[]

Definition at line 19 of file poptDB.c.

struct rpmQVKArguments_s rpmDBArgs

Definition at line 15 of file poptDB.c.

Referenced by main().

struct rpmQVKArguments_s rpmIArgs

Definition at line 23 of file poptI.c.

Referenced by installArgCallback(), and main().

struct poptOption rpmInstallPoptTable[]

Definition at line 199 of file poptI.c.

struct poptOption rpmQueryPoptTable[]

Query mode options.

Definition at line 317 of file poptQV.c.

struct rpmQVKArguments_s rpmQVKArgs

Definition at line 19 of file poptQV.c.

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

struct poptOption rpmQVSourcePoptTable[]

Common query/verify mode options.

Definition at line 129 of file poptQV.c.

struct poptOption rpmSignPoptTable[]

Signature mode options.

Definition at line 479 of file poptQV.c.

struct poptOption rpmVerifyPoptTable[]

Verify mode options.

Definition at line 374 of file poptQV.c.

int specedit

Definition at line 22 of file poptQV.c.