Go to the documentation of this file.
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)
107 #if defined(IAM_RPMQV)
129 argerror(
_(
"one type of query/verify may be performed at a "
151 argerror(
_(
"only one major mode may be specified"));
159 #if defined(IAM_RPMEIU)
162 argerror(
_(
"only installation and upgrading may be forced"));
164 argerror(
_(
"files may only be relocated during package installation"));
167 argerror(
_(
"cannot use --prefix with --relocate or --excludepath"));
170 argerror(
_(
"--relocate and --excludepath may only be used when installing new packages"));
173 argerror(
_(
"--prefix may only be used when installing new packages"));
176 argerror(
_(
"arguments to --prefix must begin with a /"));
179 argerror(
_(
"--hash (-h) may only be specified during package "
180 "installation and erasure"));
183 argerror(
_(
"--percent may only be specified during package "
184 "installation and erasure"));
187 argerror(
_(
"--replacepkgs may only be specified during package "
191 argerror(
_(
"--excludedocs may only be specified during package "
195 argerror(
_(
"--includedocs may only be specified during package "
199 argerror(
_(
"only one of --excludedocs and --includedocs may be "
203 argerror(
_(
"--ignorearch may only be specified during package "
207 argerror(
_(
"--ignoreos may only be specified during package "
212 argerror(
_(
"--ignoresize may only be specified during package "
216 argerror(
_(
"--allmatches may only be specified during package "
220 argerror(
_(
"--allfiles may only be specified during package "
225 argerror(
_(
"--justdb may only be specified during package "
226 "installation and erasure"));
230 argerror(
_(
"script disabling options may only be specified during "
231 "package installation and erasure"));
235 argerror(
_(
"trigger disabling options may only be specified during "
236 "package installation and erasure"));
239 argerror(
_(
"--nodeps may only be specified during package "
240 "installation, erasure, and verification"));
243 argerror(
_(
"--test may only be specified during package installation "
252 argerror(
_(
"arguments to --root (-r) must begin with a /"));
268 if (!poptPeekArg(optCon)) {
269 argerror(
_(
"no packages given for erase"));
302 if (!poptPeekArg(optCon)) {
303 argerror(
_(
"no packages given for install"));
315 argerror(
_(
"no arguments given for query"));
327 argerror(
_(
"no arguments given for verify"));
332 #if !defined(IAM_RPMQV)
336 #if !defined(IAM_RPMEIU)
341 if (poptPeekArg(optCon) != NULL || argc <= 1 ||
rpmIsVerbose()) {
@ RPMPROB_FILTER_OLDPACKAGE
rpmprobFilterFlags probFilter
@ RPMTRANS_FLAG_NOTRIGGERS
@ RPMPROB_FILTER_DISKNODES
char *const * ARGV_const_t
struct poptOption rpmInstallPoptTable[]
int rpmErase(rpmts ts, struct rpmInstallArguments_s *ia, ARGV_const_t argv)
static struct poptOption optionsTable[]
rpmRelocation * relocations
@ RPMTRANS_FLAG_NOSCRIPTS
const char * rpmcliPipeOutput
struct rpmInstallArguments_s rpmIArgs
#define rpmSetVerbosity(_lvl)
#define UNINSTALL_ALLMATCHES
int rpmcliVerify(rpmts ts, QVA_t qva, ARGV_const_t argv)
poptContext rpmcliFini(poptContext optCon)
@ RPMPROB_FILTER_IGNOREOS
struct rpmQVKArguments_s rpmQVKArgs
@ RPMPROB_FILTER_DISKSPACE
const char * rpmcliRootDir
@ RPMPROB_FILTER_FORCERELOCATE
struct poptOption rpmQueryPoptTable[]
rpmInstallFlags installInterfaceFlags
void printUsage(poptContext con, FILE *fp, int flags)
void argerror(const char *desc)
int main(int argc, char *argv[])
int rpmExpandNumeric(const char *arg)
@ RPMPROB_FILTER_REPLACEPKG
struct poptOption rpmQVSourcePoptTable[]
#define xrealloc(_ptr, _size)
int rpmcliQuery(rpmts ts, QVA_t qva, ARGV_const_t argv)
poptContext rpmcliInit(int argc, char *const argv[], struct poptOption *optionsTable)
static int rstreq(const char *s1, const char *s2)
Test for string equality.
struct poptOption rpmcliAllPoptTable[]
@ RPMPROB_FILTER_IGNOREARCH
struct poptOption rpmVerifyPoptTable[]
int rpmtsSetRootDir(rpmts ts, const char *rootDir)
int rpmInstall(rpmts ts, struct rpmInstallArguments_s *ia, ARGV_t fileArgv)
rpmts rpmtsFree(rpmts ts)