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()) {