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

Popt tables for all rpm modes. More...

#include "system.h"
#include <rpmio.h>
#include <rpmiotypes.h>
#include <fts.h>
#include <mire.h>
#include <poptIO.h>
#include <rpmjs.h>
#include <rpmruby.h>
#include <rpmtag.h>
#include <rpmtypes.h>
#include <rpmversion.h>
#include <rpmmdb.h>
#include <rpmns.h>
#include <rpmrc.h>
#include <fs.h>
#include <rpmcli.h>
#include "debug.h"
Include dependency graph for poptALL.c:

Go to the source code of this file.

Macros

#define _RPMIOB_INTERNAL
 
#define QVA_ISSET(_qvaflags, _FLAG)   ((_qvaflags) & (VERIFY_##_FLAG))
 
#define VSF_ISSET(_vsflags, _FLAG)   ((_vsflags) & (RPMVSF_##_FLAG))
 
#define VSF_SET(_vsflags, _FLAG)   (_vsflags) |= (RPMVSF_##_FLAG)
 
#define VSF_CLR(_vsflags, _FLAG)   (_vsflags) &= ~(RPMVSF_##_FLAG)
 
#define POPT_SHOWVERSION   -999
 
#define POPT_SHOWRC   -998
 
#define POPT_QUERYTAGS   -997
 
#define POPT_PREDEFINE   -996
 
#define POPT_UNDEFINE   -994
 

Functions

static void printVersion (FILE *fp)
 Display rpm version. More...
 
void rpmcliConfigured (void)
 Make sure that rpm configuration has been read. More...
 
static const char * rpmcliEvalSlurp (const char *arg)
 
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. More...
 
static int checkfd (const char *devnull, int fdno, int flags)
 
poptContext rpmcliInit (int argc, char *const argv[], struct poptOption *optionsTable)
 Initialize most everything needed by an rpm CLI executable context. More...
 

Variables

const char * __progname
 
unsigned int * keyids
 
static int _debug = 0
 
int _rpmds_nopromote
 
int _fps_debug
 
int _fsm_debug
 
int _fsm_threads
 
int _hdr_debug
 
int _hdrqf_debug
 
int _pkgio_debug
 
int _rpmrepo_debug
 
int _print_pkts
 
int _psm_debug
 
rpmioPool _psmPool
 
int _psm_threads
 
int _rpmal_debug
 
rpmioPool _rpmalPool
 
int _rpmds_debug
 
rpmioPool _rpmdsPool
 
int _rpmfc_debug
 
rpmioPool _rpmfcPool
 
int _rpmfi_debug
 
rpmioPool _rpmfiPool
 
int _rpmgi_debug
 
rpmioPool _rpmgiPool
 
int _rpmmi_debug
 
int _rpmps_debug
 
rpmioPool _rpmpsPool
 
int _rpmsq_debug
 
int _rpmte_debug
 
rpmioPool _rpmtePool
 
rpmioPool _rpmtsiPool
 
int _rpmts_debug
 
rpmioPool _rpmtsPool
 
int _rpmwf_debug
 
int _rpmts_macros
 
int _rpmts_stats
 
int _hdr_stats
 Global header stats enabler. More...
 
rpmQueryFlags rpmcliQueryFlags
 Bit(s) from common command line options. More...
 
const char * rpmcliTargets = NULL
 
static int rpmcliInitialized = -1
 
static const char * rpmpoptfiles = RPMPOPTFILES
 
int global_depFlags = RPMDEPS_FLAG_ADDINDEPS
 
struct poptOption rpmcliDepFlagsPoptTable []
 
struct poptOption rpmcliAllPoptTable []
 Popt option table for options shared by all modes and executables. More...
 

Detailed Description

Popt tables for all rpm modes.

Definition in file poptALL.c.

Macro Definition Documentation

§ _RPMIOB_INTERNAL

#define _RPMIOB_INTERNAL

Definition at line 17 of file poptALL.c.

§ POPT_PREDEFINE

#define POPT_PREDEFINE   -996

Definition at line 67 of file poptALL.c.

Referenced by rpmcliAllArgCallback().

§ POPT_QUERYTAGS

#define POPT_QUERYTAGS   -997

Definition at line 66 of file poptALL.c.

Referenced by rpmcliAllArgCallback().

§ POPT_SHOWRC

#define POPT_SHOWRC   -998

Definition at line 65 of file poptALL.c.

Referenced by rpmcliAllArgCallback().

§ POPT_SHOWVERSION

#define POPT_SHOWVERSION   -999

Definition at line 64 of file poptALL.c.

Referenced by rpmcliAllArgCallback().

§ POPT_UNDEFINE

#define POPT_UNDEFINE   -994

Definition at line 68 of file poptALL.c.

Referenced by rpmcliAllArgCallback().

§ QVA_ISSET

#define QVA_ISSET (   _qvaflags,
  _FLAG 
)    ((_qvaflags) & (VERIFY_##_FLAG))

Definition at line 53 of file poptALL.c.

§ VSF_CLR

#define VSF_CLR (   _vsflags,
  _FLAG 
)    (_vsflags) &= ~(RPMVSF_##_FLAG)

Definition at line 57 of file poptALL.c.

Referenced by rpmcliAllArgCallback().

§ VSF_ISSET

#define VSF_ISSET (   _vsflags,
  _FLAG 
)    ((_vsflags) & (RPMVSF_##_FLAG))

Definition at line 55 of file poptALL.c.

§ VSF_SET

#define VSF_SET (   _vsflags,
  _FLAG 
)    (_vsflags) |= (RPMVSF_##_FLAG)

Definition at line 56 of file poptALL.c.

Referenced by rpmcliAllArgCallback().

Function Documentation

§ checkfd()

static int checkfd ( const char *  devnull,
int  fdno,
int  flags 
)
inlinestatic

Definition at line 617 of file poptALL.c.

References errno, getenv(), LOCALEDIR, setenv(), SYSCONFIGDIR, and USRLIBRPM.

Referenced by rpmcliInit().

§ printVersion()

static void printVersion ( FILE *  fp)
static

Display rpm version.

Definition at line 193 of file poptALL.c.

References _, __progname, RPM_NAME, rpmEVR, rpmIsVerbose, rpmlibTimestamp(), rpmlibVendor(), and rpmlibVersion().

Referenced by argerror(), and rpmcliAllArgCallback().

§ rpmcliAllArgCallback()

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

§ rpmcliConfigured()

void rpmcliConfigured ( void  )

Make sure that rpm configuration has been read.

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

Definition at line 203 of file poptALL.c.

References _free(), EXIT_FAILURE, rpmReadConfigFiles(), and xstrdup().

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

§ rpmcliEvalSlurp()

static const char* rpmcliEvalSlurp ( const char *  arg)
static

Definition at line 227 of file poptALL.c.

References rpmExpand(), rpmiobAppend(), rpmiobFree(), rpmiobNew(), rpmiobSlurp(), and Stat().

Referenced by rpmcliAllArgCallback().

§ rpmcliFini()

poptContext rpmcliFini ( poptContext  optCon)

Destroy most everything needed by an rpm CLI executable context.

Parameters
optConpopt context
Returns
NULL always

Definition at line 522 of file poptALL.c.

References _free(), _headerPool, _rpmdbPool, _rpmjsI, _rpmjsPool, _rpmmiPool, _rpmrepoPool, _rpmrubyI, _rpmrubyPool, _scpPool, evr_tuple_match, evr_tuple_mire, evr_tuple_order, mireFree(), rpmCLIMacroContext, rpmFreeFilesystems(), rpmFreeMacros(), rpmFreeRpmrc(), rpmioClean(), rpmioFreePool(), rpmjsFree(), rpmnsClean(), rpmrubyFree(), and tagClean().

Referenced by main(), and rpmcliAllArgCallback().

§ rpmcliInit()

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 665 of file poptALL.c.

References _, __progname, _free(), _rpmts_stats, bindtextdomain, checkfd(), EXIT_FAILURE, PACKAGE, rpmcliConfigured(), rpmGetPath(), rpmGlob(), rpmIncreaseVerbosity, rpmlog(), RPMLOG_NOTICE, RPMLOG_WARNING, rpmSecuritySaneFile(), rpmSetVerbosity, setlocale, setprogname, textdomain, USRLIBRPM, and xstrdup().

Referenced by main().

Variable Documentation

§ __progname

const char* __progname

Definition at line 65 of file poptIO.c.

Referenced by printVersion(), and rpmcliInit().

§ _debug

int _debug = 0
static

Definition at line 74 of file poptALL.c.

§ _fps_debug

int _fps_debug

Definition at line 232 of file transaction.c.

§ _fsm_debug

int _fsm_debug

Definition at line 61 of file fsm.c.

Referenced by fsmSetup().

§ _fsm_threads

int _fsm_threads

Definition at line 65 of file fsm.c.

Referenced by fsmSetup().

§ _hdr_debug

int _hdr_debug

Definition at line 40 of file header.c.

Referenced by headerGet(), and headerReload().

§ _hdr_stats

int _hdr_stats

Global header stats enabler.

Definition at line 84 of file header.c.

§ _hdrqf_debug

int _hdrqf_debug

Definition at line 69 of file hdrfmt.c.

Referenced by escapedChar(), formatValue(), headerSprintf(), parseExpression(), and parseFormat().

§ _pkgio_debug

int _pkgio_debug

Definition at line 55 of file pkgio.c.

§ _print_pkts

int _print_pkts

Definition at line 47 of file rpmchecksig.c.

§ _psm_debug

int _psm_debug

Definition at line 76 of file psm.c.

§ _psm_threads

int _psm_threads

Definition at line 78 of file psm.c.

Referenced by rpmpsmNext().

§ _psmPool

rpmioPool _psmPool

Definition at line 2202 of file psm.c.

Referenced by rpmpsmGetPool().

§ _rpmal_debug

int _rpmal_debug

Definition at line 31 of file rpmal.c.

§ _rpmalPool

rpmioPool _rpmalPool

Definition at line 160 of file rpmal.c.

Referenced by rpmalGetPool().

§ _rpmds_debug

int _rpmds_debug

Definition at line 123 of file rpmds.c.

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

§ _rpmds_nopromote

int _rpmds_nopromote

§ _rpmdsPool

rpmioPool _rpmdsPool

Definition at line 191 of file rpmds.c.

Referenced by rpmdsGetPool().

§ _rpmfc_debug

int _rpmfc_debug

§ _rpmfcPool

rpmioPool _rpmfcPool

Definition at line 2288 of file rpmfc.c.

Referenced by rpmfcGetPool().

§ _rpmfi_debug

int _rpmfi_debug

Definition at line 67 of file rpmfi.c.

Referenced by rpmfi_alloc(), rpmfi_Debug(), rpmfi_free(), rpmfi_init(), and rpmfi_new().

§ _rpmfiPool

rpmioPool _rpmfiPool

Definition at line 1357 of file rpmfi.c.

Referenced by rpmfiGetPool().

§ _rpmgi_debug

int _rpmgi_debug

Definition at line 37 of file rpmgi.c.

§ _rpmgiPool

rpmioPool _rpmgiPool

Definition at line 525 of file rpmgi.c.

Referenced by rpmgiGetPool().

§ _rpmmi_debug

int _rpmmi_debug

Definition at line 64 of file rpmdb.c.

§ _rpmps_debug

int _rpmps_debug

§ _rpmpsPool

rpmioPool _rpmpsPool

Definition at line 45 of file rpmps.c.

Referenced by rpmpsGetPool().

§ _rpmrepo_debug

int _rpmrepo_debug

Definition at line 66 of file rpmrepo.c.

§ _rpmsq_debug

int _rpmsq_debug

Definition at line 278 of file rpmsq.c.

§ _rpmte_debug

int _rpmte_debug

Definition at line 26 of file rpmte.c.

Referenced by rpmte_Debug().

§ _rpmtePool

rpmioPool _rpmtePool

Definition at line 227 of file rpmte.c.

Referenced by rpmteGetPool().

§ _rpmts_debug

int _rpmts_debug

Definition at line 93 of file rpmts.c.

Referenced by _rpmtsCheck(), _rpmtsRun(), and main().

§ _rpmts_macros

int _rpmts_macros

Definition at line 99 of file rpmts.c.

§ _rpmts_stats

int _rpmts_stats

Definition at line 96 of file rpmts.c.

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

§ _rpmtsiPool

rpmioPool _rpmtsiPool

Definition at line 773 of file rpmte.c.

Referenced by rpmtsiGetPool().

§ _rpmtsPool

rpmioPool _rpmtsPool

Definition at line 772 of file rpmts.c.

Referenced by rpmtsGetPool().

§ _rpmwf_debug

int _rpmwf_debug

§ global_depFlags

int global_depFlags = RPMDEPS_FLAG_ADDINDEPS

Definition at line 379 of file poptALL.c.

Referenced by main().

§ keyids

unsigned int* keyids

Definition at line 34 of file package.c.

Referenced by pgpStashKeyid().

§ rpmcliAllPoptTable

struct poptOption rpmcliAllPoptTable[]

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

Definition at line 417 of file poptALL.c.

§ rpmcliDepFlagsPoptTable

struct poptOption rpmcliDepFlagsPoptTable[]

Definition at line 382 of file poptALL.c.

§ rpmcliInitialized

int rpmcliInitialized = -1
static

Definition at line 178 of file poptALL.c.

§ rpmcliQueryFlags

rpmQueryFlags rpmcliQueryFlags

Bit(s) from common command line options.

Definition at line 172 of file poptALL.c.

Referenced by main().

§ rpmcliTargets

const char* rpmcliTargets = NULL

Definition at line 175 of file poptALL.c.

Referenced by rpmspecQuery().

§ rpmpoptfiles

const char* rpmpoptfiles = RPMPOPTFILES
static

Definition at line 187 of file poptALL.c.