4 #include <rpm/rpmcli.h> 
    5 #include <rpm/rpmlib.h>                  
    6 #include <rpm/rpmlog.h> 
   14 #if defined(IAM_RPMQ) || defined(IAM_RPMV) 
   22 #define MODES_QV (MODE_QUERY | MODE_VERIFY) 
   26 #define MODES_IE (MODE_INSTALL | MODE_ERASE) 
   31 #define MODES_FOR_NODEPS        (MODES_IE | MODE_VERIFY) 
   32 #define MODES_FOR_TEST          (MODES_IE) 
   41         N_(
"Query/Verify package selection options:"),
 
   46         N_(
"Query options (with -q or --query):"),
 
   51         N_(
"Verify options (with -V or --verify):"),
 
   57         N_(
"Install/Upgrade/Erase options:"),
 
   61  { 
"quiet", 
'\0', POPT_ARGFLAG_DOC_HIDDEN, &
quiet, 0, NULL, NULL},
 
   64         N_(
"Common options for all rpm modes and executables:"),
 
   72 int main(
int argc, 
char *argv[])
 
   77 #if defined(IAM_RPMQV) 
   99 #if defined(IAM_RPMQV) 
  121             argerror(
_(
"one type of query/verify may be performed at a " 
  124     if (qva->
qva_flags && (bigMode & ~MODES_QV)) 
 
  142             argerror(
_(
"only one major mode may be specified"));
 
  150 #if defined(IAM_RPMEIU) 
  153         argerror(
_(
"only installation and upgrading may be forced"));
 
  155         argerror(
_(
"files may only be relocated during package installation"));
 
  158         argerror(
_(
"cannot use --prefix with --relocate or --excludepath"));
 
  161         argerror(
_(
"--relocate and --excludepath may only be used when installing new packages"));
 
  164         argerror(
_(
"--prefix may only be used when installing new packages"));
 
  167         argerror(
_(
"arguments to --prefix must begin with a /"));
 
  170         argerror(
_(
"--hash (-h) may only be specified during package " 
  171                         "installation and erasure"));
 
  174         argerror(
_(
"--percent may only be specified during package " 
  175                         "installation and erasure"));
 
  178         argerror(
_(
"--replacepkgs may only be specified during package " 
  182         argerror(
_(
"--excludedocs may only be specified during package " 
  186         argerror(
_(
"--includedocs may only be specified during package " 
  190         argerror(
_(
"only one of --excludedocs and --includedocs may be " 
  194         argerror(
_(
"--ignorearch may only be specified during package " 
  198         argerror(
_(
"--ignoreos may only be specified during package " 
  203         argerror(
_(
"--ignoresize may only be specified during package " 
  207         argerror(
_(
"--allmatches may only be specified during package " 
  211         argerror(
_(
"--allfiles may only be specified during package " 
  216         argerror(
_(
"--justdb may only be specified during package " 
  217                    "installation and erasure"));
 
  221         argerror(
_(
"script disabling options may only be specified during " 
  222                    "package installation and erasure"));
 
  226         argerror(
_(
"trigger disabling options may only be specified during " 
  227                    "package installation and erasure"));
 
  230         argerror(
_(
"--nodeps may only be specified during package " 
  231                    "installation, erasure, and verification"));
 
  234         argerror(
_(
"--test may only be specified during package installation " 
  239         argerror(
_(
"arguments to --root (-r) must begin with a /"));
 
  255         if (!poptPeekArg(optCon)) {
 
  256             argerror(
_(
"no packages given for erase"));
 
  289         if (!poptPeekArg(optCon)) {
 
  290             argerror(
_(
"no packages given for install"));
 
  302             argerror(
_(
"no arguments given for query"));
 
  314             argerror(
_(
"no arguments given for verify"));
 
  319 #if !defined(IAM_RPMQV) 
  323 #if !defined(IAM_RPMEIU) 
  328         if (poptPeekArg(optCon) != NULL || argc <= 1 || 
rpmIsVerbose()) {
 
void printUsage(poptContext con, FILE *fp, int flags)
int main(int argc, char *argv[])
rpmprobFilterFlags probFilter
static struct poptOption optionsTable[]
rpmts rpmtsFree(rpmts ts)
Destroy transaction set, closing the database as well. 
int rpmErase(rpmts ts, struct rpmInstallArguments_s *ia, ARGV_const_t argv)
Erase binary rpm package. 
poptContext rpmcliInit(int argc, char *const argv[], struct poptOption *optionsTable)
Initialize most everything needed by an rpm CLI executable context. 
int rpmcliQuery(rpmts ts, QVA_t qva, ARGV_const_t argv)
Display package information. 
rpmRelocation * relocations
struct rpmts_s * rpmts
The main types involved in transaction manipulation. 
Describe query/verify/signature command line operation. 
struct rpmQVKArguments_s rpmQVKArgs
rpmts rpmtsCreate(void)
Create an empty transaction set. 
struct poptOption rpmInstallPoptTable[]
poptContext rpmcliFini(poptContext optCon)
Destroy most everything needed by an rpm CLI executable context. 
const char * rpmcliPipeOutput
void argerror(const char *desc)
struct poptOption rpmQueryPoptTable[]
static int rstreq(const char *s1, const char *s2)
Test for string equality. 
struct poptOption rpmQVSourcePoptTable[]
int rpmcliVerify(rpmts ts, QVA_t qva, ARGV_const_t argv)
Verify package install. 
int rpmExpandNumeric(const char *arg)
Return macro expansion as a numeric value. 
rpmInstallFlags installInterfaceFlags
struct rpmInstallArguments_s rpmIArgs
const char * rpmcliRootDir
struct poptOption rpmcliAllPoptTable[]
Popt option table for options shared by all modes and executables. 
char *const * ARGV_const_t
#define UNINSTALL_ALLMATCHES
Describe database command line requests. 
struct poptOption rpmVerifyPoptTable[]
int rpmInstall(rpmts ts, struct rpmInstallArguments_s *ia, ARGV_t fileArgv)
Install/upgrade/freshen binary rpm package. 
#define rpmSetVerbosity(_lvl)
int rpmtsSetRootDir(rpmts ts, const char *rootDir)
Set transaction rootDir, i.e. 
#define xrealloc(_ptr, _size)