# lib/poptALL.c File Reference

Popt tables for all rpm modes. More...

`#include "system.h"`
`#include <rpmio.h>`
`#include <rpmcli.h>`
`#include <fs.h>`
`#include <rpmns.h>`
`#include <fts.h>`
`#include <mire.h>`
`#include "debug.h"`

Include dependency graph for poptALL.c:

Go to the source code of this file.

## Defines

#define | _RPMPGP_INTERNAL
#define | POPT_SHOWVERSION -999
#define | POPT_SHOWRC -998
#define | POPT_QUERYTAGS -997
#define | POPT_PREDEFINE -996
#define | POPT_UNDEFINE -994
#define | POPT_CRYPTO -993

## 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.
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.

## Variables

const char * | program_name
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 | _rpmmg_debug
int | _rpmps_debug
int | _rpmsq_debug
int | _rpmsx_debug
int | _rpmte_debug
int | _rpmts_debug
int | _rpmwf_debug
int | _xar_debug
int | _rpmts_macros
int | _rpmts_stats
int | _hdr_stats
| Global header stats enabler.
int | _tar_debug
int | noLibio
const char * | rpmcliPipeOutput = NULL
const char * | rpmcliRootDir = "/"
rpmQueryFlags | rpmcliQueryFlags
| Bit(s) from common command line options.
const char * | rpmcliTargets = NULL
int | _ftp_debug
int | _av_debug
int | _dav_debug
int | _rpmio_debug
static int | rpmcliInitialized = -1
int | ftsOpts = 0
struct poptOption | rpmcliFtsPoptTable []
int | global_depFlags
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.

## Define Documentation

#define _RPMPGP_INTERNAL

Definition at line 16 of file poptALL.c.

#define POPT_CRYPTO -993

Definition at line 44 of file poptALL.c.

Referenced by rpmcliAllArgCallback().

#define POPT_PREDEFINE -996

Definition at line 39 of file poptALL.c.

Referenced by rpmcliAllArgCallback().

#define POPT_QUERYTAGS -997

Definition at line 38 of file poptALL.c.

Referenced by rpmcliAllArgCallback().

#define POPT_SHOWRC -998

Definition at line 37 of file poptALL.c.

Referenced by rpmcliAllArgCallback().

#define POPT_SHOWVERSION -999

Definition at line 36 of file poptALL.c.

Referenced by rpmcliAllArgCallback().

#define POPT_UNDEFINE -994

Definition at line 43 of file poptALL.c.

Referenced by rpmcliAllArgCallback().

## Function Documentation

static int checkfd | ( | const char * | devnull,
|  | int | fdno,
|  | int | flags |
| ) |  |  | `[inline, static]`

Definition at line 589 of file poptALL.c.

References errno.

Referenced by dbiOpen(), and rpmcliInit().

static void printVersion | ( | FILE * | fp | ) | `[static]`

Display rpm version.

Definition at line 175 of file poptALL.c.

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

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

Definition at line 209 of file poptALL.c.

References _free(), _RPMVSF_NODIGESTS, _RPMVSF_NOSIGNATURES, pgpDigVSFlags, pgpImplVecs, POPT_CRYPTO, POPT_PREDEFINE, POPT_QUERYTAGS, POPT_SHOWRC, POPT_SHOWVERSION, POPT_UNDEFINE, printVersion(), RMIL_CMDLINE, RPMCLI_POPT_NODIGEST, RPMCLI_POPT_NOHDRCHK, RPMCLI_POPT_NOSIGNATURE, RPMCLI_POPT_TARGETPLATFORM, rpmcliConfigured(), rpmcliFini(), rpmCLIMacroContext, rpmcliQueryFlags, rpmcliTargets, rpmDefineMacro(), rpmDisplayQueryTags(), rpmExpand(), rpmIncreaseVerbosity, RPMLOG_WARNING, rpmSetVerbosity, rpmShowRC(), rpmUndefineMacro(), RPMVSF_NOHDRCHK, stpcpy(), VERIFY_DIGEST, VERIFY_HDRCHK, VERIFY_SIGNATURE, xisspace(), xrealloc(), xstrcasecmp(), and xstrdup().

void rpmcliConfigured | ( | void |  | ) |

Make sure that rpm configuration has been read.

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

Definition at line 185 of file poptALL.c.

References _free(), EXIT_FAILURE, rpmcliInitialized, 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:

  | optCon | popt context

Returns:
  NULL always

Definition at line 558 of file poptALL.c.

References _free(), keyids, rpmCLIMacroContext, rpmcliTargets, rpmFreeFilesystems(), rpmFreeMacros(), rpmFreeRpmrc(), rpmioClean(), rpmnsClean(), and tagClean().

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:

  | argc | no. of args
  | argv | arg array
  | optionsTable | popt option table

Returns:
  popt context (or NULL)

Definition at line 601 of file poptALL.c.

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

Referenced by main().

## Variable Documentation

int _av_debug

Definition at line 158 of file rpmio.c.

int _cpio_debug

Definition at line 23 of file cpio.c.

Referenced by cpioHeaderRead(), and cpioHeaderWrite().

int _dav_debug

Definition at line 168 of file rpmio.c.

int _debug = 0`[static]`

Definition at line 50 of file poptALL.c.

Referenced by db3associate(), db3cclose(), db3ccount(), db3cdel(), db3cdup(), db3cget(), db3close(), db3copen(), db3cpget(), db3cput(), db3join(), db3open(), db3stat(), db3sync(), db_fini(), db_init(), dbg_keyval(), dbg_scp(), enterChroot(), leaveChroot(), rpmcliInit(), scpFree(), scpNew(), scpReset(), scpResetAv(), scpResetKeys(), sql_associate(), sql_cclose(), sql_ccount(), sql_cdup(), sql_cget(), sql_commitTransaction(), sql_copen(), sql_cpget(), sql_endTransaction(), sql_initDB(), sql_join(), sql_startTransaction(), and sql_step().

int _fps_debug

Definition at line 271 of file transaction.c.

int _fsm_debug

Definition at line 38 of file fsm.c.

Referenced by fsmSetup(), fsmStage(), and fsmTeardown().

int _fsm_threads

Definition at line 42 of file fsm.c.

Referenced by fsmNext().

int _ftp_debug

Definition at line 163 of file rpmio.c.

Referenced by checkResponse(), ftpCommand(), ftpLstat(), ftpOpendir(), ftpReadlink(), ftpReq(), ftpStat(), httpReq(), httpResp(), and tcpConnect().

int _hdr_debug

Definition at line 20 of file header.c.

Referenced by escapedChar(), headerLink(), headerSprintf(), headerUnlink(), parseExpression(), and parseFormat().

int _hdr_stats

Global header stats enabler.

Definition at line 72 of file header.c.

Referenced by headerFree(), headerGetStats(), and rpmcliInit().

int _mire_debug

int _print_pkts

Definition at line 32 of file rpmchecksig.c.

int _psm_debug

Definition at line 39 of file psm.c.

Referenced by XrpmpsmLink(), and XrpmpsmUnlink().

int _psm_threads

Definition at line 41 of file psm.c.

Referenced by rpmpsmNext().

int _rpmal_debug

Definition at line 21 of file rpmal.c.

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

int _rpmdb_debug

Definition at line 49 of file rpmdb.c.

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

int _rpmds_debug

Definition at line 105 of file rpmds.c.

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

int _rpmds_nopromote

Definition at line 108 of file rpmds.c.

Referenced by checkPackageSet(), ensureOlder(), rpmtsAddInstallElement(), setEpochPromote(), and unsatisfiedDepend().

int _rpmfc_debug

Definition at line 94 of file poptALL.c.

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

int _rpmfi_debug

Definition at line 33 of file rpmfi.c.

Referenced by rpmfi_alloc(), rpmfi_Debug(), rpmfi_free(), rpmfi_init(), rpmfi_new(), rpmfiFree(), rpmfiNew(), rpmfiNext(), rpmfiNextD(), XrpmfiLink(), and XrpmfiUnlink().

int _rpmgi_debug

Definition at line 32 of file rpmgi.c.

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

int _rpmio_debug

Definition at line 153 of file rpmio.c.

Referenced by Access(), Chmod(), Chown(), Chroot(), Closedir(), fdFgets(), Fdopen(), fdWritable(), Fopen(), Glob(), Globfree(), Lchown(), Link(), Lseek(), Lstat(), lzdClose(), Mkfifo(), Mknod(), Open(), Opendir(), Readdir(), Rename(), rpmioAccess(), Stat(), Symlink(), ufdOpen(), ufdRead(), ufdWrite(), Utime(), and Utimes().

int _rpmmg_debug

Definition at line 19 of file rpmmg.c.

Referenced by doUntar(), rpmmgBuffer(), rpmmgFile(), rpmmgFree(), and rpmmgNew().

int _rpmps_debug

Definition at line 20 of file rpmps.c.

Referenced by rpmps_alloc(), rpmps_ass_sub(), rpmps_dealloc(), rpmps_Debug(), rpmps_free(), rpmps_getattro(), rpmps_init(), rpmps_iter(), rpmps_iternext(), rpmps_length(), rpmps_new(), rpmps_print(), rpmps_setattro(), rpmps_subscript(), XrpmpsLink(), and XrpmpsUnlink().

int _rpmsq_debug

Definition at line 274 of file rpmsq.c.

int _rpmsx_debug

Definition at line 18 of file rpmsx.c.

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

int _rpmte_debug

Definition at line 21 of file rpmte.c.

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

int _rpmts_debug

Definition at line 79 of file rpmts.c.

Referenced by rpmts_AddErase(), rpmts_AddInstall(), rpmts_alloc(), rpmts_Check(), rpmts_Clean(), rpmts_CloseDB(), rpmts_Create(), rpmts_dealloc(), rpmts_Debug(), rpmts_free(), rpmts_HdrCheck(), rpmts_HdrFromFdno(), rpmts_IDTXglob(), rpmts_IDTXload(), rpmts_init(), rpmts_InitDB(), rpmts_iter(), rpmts_iternext(), rpmts_Match(), rpmts_new(), rpmts_Next(), rpmts_OpenDB(), rpmts_Order(), rpmts_PgpImportPubkey(), rpmts_PgpPrtPkts(), rpmts_Problems(), rpmts_RebuildDB(), rpmts_Rollback(), rpmts_Run(), rpmts_SetColor(), rpmts_SetDFlags(), rpmts_SetFlags(), rpmts_SetProbFilter(), rpmts_SetVSFlags(), rpmts_SolveCallback(), rpmts_VerifyDB(), rpmtsCallback(), XrpmtsLink(), and XrpmtsUnlink().

int _rpmts_macros

Definition at line 85 of file rpmts.c.

Referenced by rpmtsFree().

int _rpmts_stats

Definition at line 82 of file rpmts.c.

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

int _rpmwf_debug

int _tar_debug

Definition at line 20 of file tar.c.

Referenced by tarHeaderRead(), tarHeaderWrite(), tarHeaderWriteBlock(), tarHeaderWriteName(), and tarTrailerWrite().

int _xar_debug

int ftsOpts = 0

Definition at line 354 of file poptALL.c.

Referenced by rpmcliArgIter(), rpmcliInstall(), rpmcliSign(), and rpmReSign().

int global_depFlags

Definition at line 378 of file poptALL.c.

Referenced by main().

int noLibio

Definition at line 163 of file poptALL.c.

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

const char* program_name

Definition at line 7 of file poptALL.c.

struct poptOption rpmcliDepFlagsPoptTable[]

Definition at line 381 of file poptALL.c.

struct poptOption rpmcliFtsPoptTable[]

Initial value:

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

Definition at line 357 of file poptALL.c.

int rpmcliInitialized = -1`[static]`

Definition at line 170 of file poptALL.c.

Referenced by rpmcliConfigured().

const char* rpmcliPipeOutput = NULL

Definition at line 143 of file poptALL.c.

Referenced by main().

const char* rpmcliRootDir = "/"

Definition at line 146 of file poptALL.c.

Referenced by main().

const char* rpmcliTargets = NULL

Definition at line 152 of file poptALL.c.

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