Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

rpmcli.h File Reference

#include "rpmlib.h"
#include "rpmurl.h"
#include "rpmmacro.h"

Go to the source code of this file.

Data Structures

struct  rpmQVKArguments_s
struct  rpmBuildArguments_s
struct  rpmInstallArguments_s
struct  IDT_s
 A rollback transaction id element. More...
struct  IDTindex_s
 A rollback transaction id index. More...
struct  rpmDatabaseArguments_s

RPMQV

#define RPMVERIFY_ALL   ~(RPMVERIFY_NONE)
#define RPMVERIFY_FAILURES   (RPMVERIFY_LSTATFAIL|RPMVERIFY_READFAIL|RPMVERIFY_READLINKFAIL|RPMVERIFY_LGETFILECONFAIL)
#define _QUERY_FOR_BITS
#define VERIFY_ATTRS
#define VERIFY_ALL
typedef enum rpmQVSources_e rpmQVSources
typedef enum rpmVerifyAttrs_e rpmVerifyAttrs
typedef enum rpmQueryFlags_e rpmQueryFlags
typedef enum rpmVerifyFlags_e rpmVerifyFlags
typedef rpmQVKArguments_sQVA_t
typedef int(* QVF_t )(QVA_t qva, rpmts ts, Header h)
typedef int(* QSpecF_t )(rpmts ts, QVA_t qva, const char *arg)
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
}
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)
}
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)
}
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)
}
int rpmcliShowMatches (QVA_t qva, rpmts ts)
void rpmDisplayQueryTags (FILE *fp)
int rpmQueryVerify (QVA_t qva, rpmts ts, const char *arg)
int showQueryPackage (QVA_t qva, rpmts ts, Header h)
int rpmcliQuery (rpmts ts, QVA_t qva, const char **argv)
int rpmVerifyFile (const rpmts ts, rpmfi fi, rpmVerifyAttrs *res, rpmVerifyAttrs omitMask)
int showVerifyPackage (QVA_t qva, rpmts ts, Header h)
int rpmVerifySignatures (QVA_t qva, rpmts ts, FD_t fd, const char *fn)
 Check package and header signatures.
int rpmcliVerify (rpmts ts, QVA_t qva, const char **argv)
rpmQueryFlags rpmcliQueryFlags
rpmQVKArguments_s rpmQVKArgs
poptOption rpmQVSourcePoptTable []
 Common query/verify mode options.
int specedit
poptOption rpmQueryPoptTable []
 Query mode options.
poptOption rpmVerifyPoptTable []
 Verify mode options.

RPMBT

typedef rpmBuildArguments_sBTA_t
rpmBuildArguments_s rpmBTArgs
poptOption rpmBuildPoptTable []

RPMEIU

typedef IDT_sIDT
 A rollback transaction id element.
typedef IDTindex_sIDTX
 A rollback transaction id index.
void * rpmShowProgress (const void *arg, const rpmCallbackType what, const unsigned long amount, const unsigned long total, fnpyKey key, void *data)
int rpmInstallSource (rpmts ts, const char *arg, const char **specFilePtr, const char **cookie)
int rpmInstall (rpmts ts, struct rpmInstallArguments_s *ia, const char **fileArgv)
int rpmErase (rpmts ts, struct rpmInstallArguments_s *ia, const char **argv)
IDTX IDTXfree (IDTX idtx)
 Destroy id index.
IDTX IDTXnew (void)
 Create id index.
IDTX IDTXgrow (IDTX idtx, int need)
 Insure that index has room for "need" elements.
IDTX IDTXsort (IDTX idtx)
 Sort tag (instance,value) pairs.
IDTX IDTXload (rpmts ts, rpmTag tag)
 Load tag (instance,value) pairs from rpm databse, and return sorted id index.
IDTX IDTXglob (rpmts ts, const char *globstr, rpmTag tag)
 Load tag (instance,value) pairs from packages, and return sorted id index.
int rpmRollback (rpmts ts, struct rpmInstallArguments_s *ia, const char **argv)
int rpmcliPackagesTotal
int rpmcliHashesCurrent
int rpmcliHashesTotal
int rpmcliProgressCurrent
int rpmcliProgressTotal
rpmInstallArguments_s rpmIArgs
poptOption rpmInstallPoptTable []

RPMK

typedef enum rpmSignFlags_e rpmSignFlags
enum  rpmSignFlags_e {
  RPMSIGN_NONE = 0, RPMSIGN_CHK_SIGNATURE = 'K', RPMSIGN_NEW_SIGNATURE = 'R', RPMSIGN_ADD_SIGNATURE = 'A',
  RPMSIGN_IMPORT_PUBKEY = 'I'
}
rpmRC rpmcliImportPubkey (const rpmts ts, const unsigned char *pkt, ssize_t pktlen)
int rpmcliSign (rpmts ts, QVA_t qva, const char **argv)
poptOption rpmSignPoptTable []
 Signature mode options.

RPMDB

rpmDatabaseArguments_s rpmDBArgs
poptOption rpmDatabasePoptTable []

Defines

#define RPMCLI_POPT_NODEPS   -1025
 Common/global popt tokens used for command line option tables.
#define RPMCLI_POPT_FORCE   -1026
#define RPMCLI_POPT_NOMD5   -1027
#define RPMCLI_POPT_NOSCRIPTS   -1028
#define RPMCLI_POPT_NOSIGNATURE   -1029
#define RPMCLI_POPT_NODIGEST   -1030
#define RPMCLI_POPT_NOHDRCHK   -1031
#define RPMCLI_POPT_NOCONTEXTS   -1032

Functions

poptContext rpmcliInit (int argc, char *const argv[], struct poptOption *optionsTable)
 Initialize most everything needed by an rpm CLI executable context.
void rpmcliConfigured (void)
 Make sure that rpm configuration has been read.
poptContext rpmcliFini (poptContext optCon)
 Destroy most everything needed by an rpm CLI executable context.

Variables

int _noDirTokens
poptOption rpmcliAllPoptTable []
const char * rpmcliPipeOutput
const char * rpmcliRcfile
const char * rpmcliRootDir


Detailed Description

Definition in file rpmcli.h.


Define Documentation

#define _QUERY_FOR_BITS
 

Value:

Definition at line 169 of file rpmcli.h.

#define RPMCLI_POPT_FORCE   -1026
 

Definition at line 78 of file rpmcli.h.

Referenced by buildArgCallback(), installArgCallback(), and queryArgCallback().

#define RPMCLI_POPT_NOCONTEXTS   -1032
 

Definition at line 84 of file rpmcli.h.

Referenced by installArgCallback(), and queryArgCallback().

#define RPMCLI_POPT_NODEPS   -1025
 

Common/global popt tokens used for command line option tables.

Definition at line 77 of file rpmcli.h.

Referenced by buildArgCallback(), installArgCallback(), and queryArgCallback().

#define RPMCLI_POPT_NODIGEST   -1030
 

Definition at line 82 of file rpmcli.h.

Referenced by buildArgCallback(), installArgCallback(), queryArgCallback(), and rpmcliAllArgCallback().

#define RPMCLI_POPT_NOHDRCHK   -1031
 

Definition at line 83 of file rpmcli.h.

Referenced by buildArgCallback(), installArgCallback(), queryArgCallback(), and rpmcliAllArgCallback().

#define RPMCLI_POPT_NOMD5   -1027
 

Definition at line 79 of file rpmcli.h.

Referenced by installArgCallback(), and queryArgCallback().

#define RPMCLI_POPT_NOSCRIPTS   -1028
 

Definition at line 80 of file rpmcli.h.

Referenced by installArgCallback(), and queryArgCallback().

#define RPMCLI_POPT_NOSIGNATURE   -1029
 

Definition at line 81 of file rpmcli.h.

Referenced by buildArgCallback(), installArgCallback(), queryArgCallback(), and rpmcliAllArgCallback().

#define RPMVERIFY_ALL   ~(RPMVERIFY_NONE)
 

Definition at line 133 of file rpmcli.h.

#define RPMVERIFY_FAILURES   (RPMVERIFY_LSTATFAIL|RPMVERIFY_READFAIL|RPMVERIFY_READLINKFAIL|RPMVERIFY_LGETFILECONFAIL)
 

Definition at line 134 of file rpmcli.h.

#define VERIFY_ALL
 

Value:

Definition at line 217 of file rpmcli.h.

#define VERIFY_ATTRS
 

Value:

Definition at line 214 of file rpmcli.h.


Typedef Documentation

typedef struct IDT_s * IDT
 

A rollback transaction id element.

Referenced by IDTintcmp(), IDTXfree(), IDTXglob(), IDTXload(), IDTXnew(), rpmRollback(), rpmts_IDTXglob(), and rpmts_IDTXload().

typedef struct IDTindex_s * IDTX
 

A rollback transaction id index.

Referenced by IDTXfree(), IDTXglob(), IDTXgrow(), IDTXload(), IDTXnew(), IDTXsort(), rpmRollback(), rpmts_IDTXglob(), and rpmts_IDTXload().


Function Documentation

IDTX IDTXfree IDTX  idtx  ) 
 

Destroy id index.

Parameters:
idtx id index
Returns:
NULL always

Definition at line 916 of file rpminstall.c.

References _free(), IDT_s::h, headerFree(), IDT, IDTX, and IDT_s::key.

Referenced by rpmRollback(), rpmts_IDTXglob(), and rpmts_IDTXload().

IDTX IDTXglob rpmts  ts,
const char *  globstr,
rpmTag  tag
 

Load tag (instance,value) pairs from packages, and return sorted id index.

Parameters:
ts transaction set
globstr glob expression
tag rpm tag
Returns:
id index

Definition at line 1011 of file rpminstall.c.

References _, _free(), Fclose(), FD_t, Ferror(), Fopen(), Fstrerror(), IDT_s::h, Header, headerFree(), headerIsEntry(), headerLink(), HGE_t, IDTindex_s::idt, IDT, IDTX, IDTXgrow(), IDTXsort(), IDT_s::instance, int_32, IDT_s::key, IDTindex_s::nidt, RPMERR_OPEN, rpmError, rpmGlob(), rpmRC, RPMRC_NOKEY, RPMRC_NOTTRUSTED, RPMRC_OK, rpmReadPackageFile(), RPMTAG_SOURCEPACKAGE, rpmTagType, IDT_s::u32, and IDT_s::val.

Referenced by rpmRollback(), and rpmts_IDTXglob().

IDTX IDTXgrow IDTX  idtx,
int  need
 

Insure that index has room for "need" elements.

Parameters:
idtx id index
need additional no. of elements needed
Returns:
id index (with room for "need" elements)

Definition at line 940 of file rpminstall.c.

References IDTindex_s::alloced, IDTindex_s::delta, IDTindex_s::idt, IDTX, IDTXnew(), IDTindex_s::nidt, IDTindex_s::size, and xrealloc().

Referenced by IDTXglob(), and IDTXload().

IDTX IDTXload rpmts  ts,
rpmTag  tag
 

Load tag (instance,value) pairs from rpm databse, and return sorted id index.

Parameters:
ts transaction set
tag rpm tag
Returns:
id index

Definition at line 964 of file rpminstall.c.

References IDT_s::h, Header, headerLink(), HGE_t, IDTindex_s::idt, IDT, IDTX, IDTXgrow(), IDTXsort(), IDT_s::instance, int_32, IDT_s::key, IDTindex_s::nidt, RPM_INT32_TYPE, rpmdbFreeIterator(), rpmdbGetIteratorOffset(), rpmdbMatchIterator, rpmdbNextIterator(), rpmdbSetIteratorRE(), RPMMIRE_DEFAULT, RPMTAG_NAME, rpmTagType, rpmtsInitIterator(), IDT_s::u32, and IDT_s::val.

Referenced by rpmRollback(), and rpmts_IDTXload().

IDTX IDTXnew void   ) 
 

Create id index.

Returns:
new id index

Definition at line 932 of file rpminstall.c.

References IDTindex_s::delta, IDT, IDTX, IDTindex_s::size, and xcalloc().

Referenced by IDTXgrow().

IDTX IDTXsort IDTX  idtx  ) 
 

Sort tag (instance,value) pairs.

Parameters:
idtx id index
Returns:
id index

Definition at line 957 of file rpminstall.c.

References IDTindex_s::idt, IDTintcmp(), IDTX, IDTindex_s::nidt, and IDTindex_s::size.

Referenced by IDTXglob(), and IDTXload().

void rpmcliConfigured void   ) 
 

Make sure that rpm configuration has been read.

Warning:
Options like --rcfile and --verbose must precede callers option.

Definition at line 127 of file poptALL.c.

References EXIT_FAILURE, rpmcliInitialized, rpmcliRcfile, and rpmReadConfigFiles().

Referenced by main(), rpmcliAllArgCallback(), and rpmcliInit().

poptContext rpmcliFini poptContext  optCon  ) 
 

Destroy most everything needed by an rpm CLI executable context.

Parameters:
optCon popt context
Returns:
NULL always

Definition at line 337 of file poptALL.c.

References poptContext, and poptFreeContext().

Referenced by main().

poptContext rpmcliInit int  argc,
char *const   argv[],
struct poptOption optionsTable
 

Initialize most everything needed by an rpm CLI executable context.

Parameters:
argc no. of args
argv arg array
optionsTable popt option table
Returns:
popt context (or NULL)

Definition at line 352 of file poptALL.c.

References _, __progname, argv, bindtextdomain, EXIT_FAILURE, LIBRPMALIAS_FILENAME, LOCALEDIR, PACKAGE, POPT_BADOPTION_NOALIAS, poptBadOption(), poptContext, poptGetContext(), poptGetNextOpt(), poptGetOptArg(), poptReadConfigFile(), poptReadDefaultConfig(), poptSetExecPath(), poptStrerror(), rpmcliConfigured(), RPMCONFIGDIR, rpmIncreaseVerbosity, RPMMESS_NORMAL, rpmSetVerbosity, setlocale, setprogname, and textdomain.

Referenced by main().

int rpmVerifySignatures QVA_t  qva,
rpmts  ts,
FD_t  fd,
const char *  fn
 

Check package and header signatures.

Parameters:
qva parsed query/verify options
ts transaction set
fd package file handle
fn package file name
Returns:
0 on success, 1 on failure

Definition at line 680 of file rpmchecksig.c.

References _, _free(), _print_pkts, FD_t, fdInitDigest(), Header, headerFreeIterator(), headerInitIterator(), headerIsEntry(), HeaderIterator, headerNextIterator(), int_32, pgpCleanDig(), pgpDig, pgpDigParams, PGPHASHALGO_MD5, PGPHASHALGO_SHA1, pgpPrtPkts(), rpmQVKArguments_s::qva_flags, QVA_t, readFile(), readLead(), RPMERR_BADSIGTYPE, RPMERR_READLEAD, RPMERR_SIGGEN, RPMERR_SIGVFY, rpmError, rpmFreeSignature(), rpmIsDebug, rpmIsVerbose, rpmRC, RPMRC_NOKEY, RPMRC_NOTTRUSTED, RPMRC_OK, rpmReadSignature(), RPMSIGTAG_DSA, RPMSIGTAG_GPG, RPMSIGTAG_LEMD5_1, RPMSIGTAG_LEMD5_2, RPMSIGTAG_MD5, RPMSIGTAG_PGP, RPMSIGTAG_PGP5, RPMSIGTAG_RSA, RPMSIGTAG_SHA1, RPMSIGTAG_SIZE, rpmtsCleanDig(), rpmtsDig(), rpmtsSetSig(), rpmtsSignature(), rpmVerifySignature(), stpcpy(), stpncpy(), and pgpDigParams_s::version.

Referenced by rpmcliSign().


Variable Documentation

int rpmcliHashesCurrent
 

Definition at line 26 of file rpminstall.c.

Referenced by printHash(), and rpmShowProgress().

int rpmcliHashesTotal
 

Definition at line 28 of file rpminstall.c.

Referenced by printHash().

int rpmcliPackagesTotal
 

Definition at line 24 of file rpminstall.c.

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

const char* rpmcliPipeOutput
 

Definition at line 87 of file poptALL.c.

Referenced by main().

int rpmcliProgressCurrent
 

Definition at line 30 of file rpminstall.c.

Referenced by printHash(), and rpmShowProgress().

int rpmcliProgressTotal
 

Definition at line 32 of file rpminstall.c.

Referenced by printHash(), and rpmShowProgress().

const char* rpmcliRcfile
 

Definition at line 90 of file poptALL.c.

Referenced by main(), and rpmcliConfigured().

const char* rpmcliRootDir
 

Definition at line 93 of file poptALL.c.

Referenced by main().


Generated on Wed Dec 28 16:43:52 2005 for rpm by  doxygen 1.3.9.1