rpm  4.5
Macros | Functions | Variables
poptALL.c File Reference

Popt tables for all rpm modes. More...

#include "system.h"
#include <rpmcli.h>
#include <rpmlua.h>
#include <fs.h>
#include <fts.h>
#include <mire.h>
#include "debug.h"
Include dependency graph for poptALL.c:

Go to the source code of this file.

Macros

#define POPT_SHOWVERSION   -999
 
#define POPT_SHOWRC   -998
 
#define POPT_QUERYTAGS   -997
 
#define POPT_PREDEFINE   -996
 

Functions

static void printVersion (FILE *fp)
 Display rpm version.
 
void rpmcliConfigured (void)
 Make sure that rpm configuration has been read.
 
static void rpmcliAllArgCallback (poptContext con, enum poptCallbackReason reason, const struct poptOption *opt, const char *arg, const void *data)
 
poptContext rpmcliFini (poptContext optCon)
 Destroy most everything needed by an rpm CLI executable context.
 
poptContext rpmcliInit (int argc, char *const argv[], struct poptOption *optionsTable)
 Initialize most everything needed by an rpm CLI executable context.
 

Variables

const char * __progname
 
int _tagcache
 
static int _debug = 0
 
int _rpmds_nopromote
 
int _cpio_debug
 
int _fps_debug
 
int _fsm_debug
 
int _fsm_threads
 
int _hdr_debug
 
int _mire_debug
 
int _print_pkts
 
int _psm_debug
 
int _psm_threads
 
int _rpmal_debug
 
int _rpmdb_debug
 
int _rpmds_debug
 
int _rpmfc_debug
 
int _rpmfi_debug
 
int _rpmgi_debug
 
int _rpmps_debug
 
int _rpmsq_debug
 
int _rpmsx_debug
 
int _rpmte_debug
 
int _rpmts_debug
 
int _rpmts_stats
 
int _tar_debug
 
int noLibio
 
const char * rpmcliPipeOutput = NULL
 
const char * rpmcliRcfile = NULL
 
const char * rpmcliRootDir = "/"
 
rpmQueryFlags rpmcliQueryFlags
 Bit(s) from common command line options.
 
const char * rpmcliTargets = NULL
 
int _ftp_debug
 
int _av_debug
 
int _rpmio_debug
 
static int rpmcliInitialized = -1
 
int ftsOpts = 0
 
struct poptOption rpmcliFtsPoptTable []
 
int global_depFlags = (RPMDEPS_FLAG_NOLINKTOS|RPMDEPS_FLAG_NOPARENTDIRS)
 
struct poptOption rpmcliDepFlagsPoptTable []
 
struct poptOption rpmcliAllPoptTable []
 Popt option table for options shared by all modes and executables.
 

Detailed Description

Popt tables for all rpm modes.

Definition in file poptALL.c.

Macro Definition Documentation

#define POPT_PREDEFINE   -996

Definition at line 20 of file poptALL.c.

Referenced by rpmcliAllArgCallback().

#define POPT_QUERYTAGS   -997

Definition at line 19 of file poptALL.c.

Referenced by rpmcliAllArgCallback().

#define POPT_SHOWRC   -998

Definition at line 18 of file poptALL.c.

Referenced by rpmcliAllArgCallback().

#define POPT_SHOWVERSION   -999

Definition at line 17 of file poptALL.c.

Referenced by rpmcliAllArgCallback().

Function Documentation

static void printVersion ( FILE *  fp)
static

Display rpm version.

Definition at line 143 of file poptALL.c.

References _, and rpmEVR.

Referenced by rpmcliAllArgCallback().

static void rpmcliAllArgCallback ( poptContext  con,
enum poptCallbackReason  reason,
const struct poptOption *  opt,
const char *  arg,
const void *  data 
)
static
void rpmcliConfigured ( void  )

Make sure that rpm configuration has been read.

Warning
Options like –rcfile and –verbose must precede callers option.

Definition at line 150 of file poptALL.c.

References _free(), EXIT_FAILURE, rpmcliInitialized, rpmcliRcfile, rpmcliTargets, rpmReadConfigFiles(), and xstrdup().

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

poptContext rpmcliFini ( poptContext  optCon)

Destroy most everything needed by an rpm CLI executable context.

Parameters
optConpopt context
Returns
NULL always

Definition at line 480 of file poptALL.c.

References _free(), headerTagIndices_s::byName, headerTagIndices_s::byValue, rpmCLIMacroContext, rpmcliTargets, rpmFreeFilesystems(), rpmFreeMacros(), rpmFreeRpmrc(), rpmlogClose(), rpmTags, and urlFreeCache().

Referenced by main(), and rpmcliAllArgCallback().

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

Initialize most everything needed by an rpm CLI executable context.

Parameters
argcno. of args
argvarg array
optionsTablepopt option table
Returns
popt context (or NULL)

Definition at line 510 of file poptALL.c.

References _, __progname, _debug, bindtextdomain, EXIT_FAILURE, LOCALEDIR, PACKAGE, rpmcliConfigured(), rpmIncreaseVerbosity, RPMMESS_NORMAL, RPMPOPTFILE, rpmSetVerbosity, setlocale, setprogname, textdomain, and USRLIBRPM.

Referenced by main().

Variable Documentation

const char* __progname

Definition at line 7 of file poptALL.c.

int _av_debug

Definition at line 151 of file rpmio.c.

int _cpio_debug

Definition at line 24 of file cpio.c.

Referenced by cpioHeaderRead(), and cpioHeaderWrite().

int _debug = 0
static

Definition at line 32 of file poptALL.c.

Referenced by rpmcliInit().

int _fps_debug

Definition at line 283 of file transaction.c.

int _fsm_debug

Definition at line 39 of file fsm.c.

int _fsm_threads

Definition at line 43 of file fsm.c.

Referenced by fsmNext().

int _ftp_debug
int _hdr_debug
int _mire_debug
int _print_pkts

Definition at line 27 of file rpmchecksig.c.

int _psm_debug

Definition at line 40 of file psm.c.

Referenced by XrpmpsmLink(), and XrpmpsmUnlink().

int _psm_threads

Definition at line 42 of file psm.c.

Referenced by rpmpsmNext().

int _rpmal_debug

Definition at line 19 of file rpmal.c.

Referenced by fieCompare(), rpmal_Debug(), rpmalAdd(), rpmalAllFileSatisfiesDepend(), and rpmalDel().

int _rpmdb_debug

Definition at line 35 of file rpmdb.c.

Referenced by dbiOpen(), rpmdbNew(), XrpmdbLink(), and XrpmdbUnlink().

int _rpmds_debug

Definition at line 104 of file rpmds.c.

Referenced by rpmds_alloc(), rpmds_Debug(), rpmds_free(), rpmds_init(), and rpmds_new().

int _rpmds_nopromote
int _rpmfc_debug

Definition at line 76 of file poptALL.c.

Referenced by main(), rpmdepPrint(), rpmfcGenerateDepends(), and rpmfcMergePR().

int _rpmfi_debug
int _rpmgi_debug

Definition at line 28 of file rpmgi.c.

Referenced by rpmgiInitFilter(), rpmgiNext(), rpmgiWalkPathFilter(), XrpmgiLink(), and XrpmgiUnlink().

int _rpmio_debug
int _rpmps_debug
int _rpmsq_debug

Definition at line 189 of file rpmsq.c.

int _rpmsx_debug

Definition at line 17 of file rpmsx.c.

Referenced by rpmsxFree(), rpmsxNext(), XrpmsxLink(), and XrpmsxUnlink().

int _rpmte_debug

Definition at line 20 of file rpmte.c.

Referenced by rpmte_Debug(), XrpmtsiFree(), and XrpmtsiInit().

int _rpmts_debug
int _rpmts_stats

Definition at line 76 of file rpmts.c.

Referenced by rpmtsFree(), and setStats().

int _tagcache

Definition at line 25 of file header.c.

Referenced by formatValue(), freeFormat(), and singleSprintf().

int _tar_debug
int ftsOpts = 0

Definition at line 275 of file poptALL.c.

Referenced by rpmcliArgIter(), and rpmgiSetArgs().

Definition at line 299 of file poptALL.c.

Referenced by main().

int noLibio

Definition at line 131 of file poptALL.c.

Referenced by Fclose(), Fdopen(), and ufdClose().

struct poptOption rpmcliDepFlagsPoptTable[]

Definition at line 302 of file poptALL.c.

struct poptOption rpmcliFtsPoptTable[]
Initial value:
= {
{ "comfollow", '\0', POPT_BIT_SET, &ftsOpts, FTS_COMFOLLOW,
N_("FTS_COMFOLLOW: follow command line symlinks"), NULL },
{ "logical", '\0', POPT_BIT_SET, &ftsOpts, FTS_LOGICAL,
N_("FTS_LOGICAL: logical walk"), NULL },
{ "nochdir", '\0', POPT_BIT_SET, &ftsOpts, FTS_NOCHDIR,
N_("FTS_NOCHDIR: don't change directories"), NULL },
{ "nostat", '\0', POPT_BIT_SET, &ftsOpts, FTS_NOSTAT,
N_("FTS_NOSTAT: don't get stat info"), NULL },
{ "physical", '\0', POPT_BIT_SET, &ftsOpts, FTS_PHYSICAL,
N_("FTS_PHYSICAL: physical walk"), NULL },
{ "seedot", '\0', POPT_BIT_SET, &ftsOpts, FTS_SEEDOT,
N_("FTS_SEEDOT: return dot and dot-dot"), NULL },
{ "xdev", '\0', POPT_BIT_SET, &ftsOpts, FTS_XDEV,
N_("FTS_XDEV: don't cross devices"), NULL },
{ "whiteout", '\0', POPT_BIT_SET, &ftsOpts, FTS_WHITEOUT,
N_("FTS_WHITEOUT: return whiteout information"), NULL },
POPT_TABLEEND
}

Definition at line 278 of file poptALL.c.

int rpmcliInitialized = -1
static

Definition at line 138 of file poptALL.c.

Referenced by rpmcliAllArgCallback(), and rpmcliConfigured().

const char* rpmcliPipeOutput = NULL

Definition at line 110 of file poptALL.c.

Referenced by main().

const char* rpmcliRcfile = NULL

Definition at line 113 of file poptALL.c.

Referenced by main(), rpmcliConfigured(), rpmRebuildTargetVars(), rpmShowRC(), and rpmspecQuery().

const char* rpmcliRootDir = "/"

Definition at line 116 of file poptALL.c.

Referenced by main().

const char* rpmcliTargets = NULL

Definition at line 122 of file poptALL.c.

Referenced by rpmcliAllArgCallback(), rpmcliConfigured(), rpmcliFini(), and rpmspecQuery().