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))
143 argerror(
_(
"only one major mode may be specified"));
151 #if defined(IAM_RPMEIU)
154 argerror(
_(
"only installation and upgrading may be forced"));
156 argerror(
_(
"files may only be relocated during package installation"));
159 argerror(
_(
"cannot use --prefix with --relocate or --excludepath"));
162 argerror(
_(
"--relocate and --excludepath may only be used when installing new packages"));
165 argerror(
_(
"--prefix may only be used when installing new packages"));
168 argerror(
_(
"arguments to --prefix must begin with a /"));
171 argerror(
_(
"--hash (-h) may only be specified during package "
172 "installation and erasure"));
175 argerror(
_(
"--percent may only be specified during package "
176 "installation and erasure"));
179 argerror(
_(
"--replacepkgs may only be specified during package "
183 argerror(
_(
"--excludedocs may only be specified during package "
187 argerror(
_(
"--includedocs may only be specified during package "
191 argerror(
_(
"only one of --excludedocs and --includedocs may be "
195 argerror(
_(
"--ignorearch may only be specified during package "
199 argerror(
_(
"--ignoreos may only be specified during package "
204 argerror(
_(
"--ignoresize may only be specified during package "
208 argerror(
_(
"--allmatches may only be specified during package "
212 argerror(
_(
"--allfiles may only be specified during package "
217 argerror(
_(
"--justdb may only be specified during package "
218 "installation and erasure"));
222 argerror(
_(
"script disabling options may only be specified during "
223 "package installation and erasure"));
227 argerror(
_(
"trigger disabling options may only be specified during "
228 "package installation and erasure"));
231 argerror(
_(
"--nodeps may only be specified during package "
232 "installation, erasure, and verification"));
235 argerror(
_(
"--test may only be specified during package installation "
240 argerror(
_(
"arguments to --root (-r) must begin with a /"));
256 if (!poptPeekArg(optCon)) {
257 argerror(
_(
"no packages given for erase"));
290 if (!poptPeekArg(optCon)) {
291 argerror(
_(
"no packages given for install"));
303 argerror(
_(
"no arguments given for query"));
315 argerror(
_(
"no arguments given for verify"));
320 #if !defined(IAM_RPMQV)
324 #if !defined(IAM_RPMEIU)
329 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/reinstall binary rpm package.
#define rpmSetVerbosity(_lvl)
int rpmtsSetRootDir(rpmts ts, const char *rootDir)
Set transaction rootDir, i.e.
#define xrealloc(_ptr, _size)