summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <proyvind@moondrake.org>2017-01-31 10:25:38 +0100
committerPanu Matilainen <pmatilai@redhat.com>2017-04-04 10:32:09 +0300
commitd2f48e93d32e222d4727b9684d2032f9bb9fc498 (patch)
tree5b4b6e832f78ce0ce2562fd712c41cc275d7d597
parent0216aaec69feb0bb619dbc59ed77db6de3902b0c (diff)
downloadrpm-d2f48e93d32e222d4727b9684d2032f9bb9fc498.tar.gz
Add --target as global option
As specifying target will load & set macro definitions according to target specified, it's still useful to provide it anywhere where ie. --eval may be used, as by specifying --target first, it'll change the target specific macros to load which is perfectly sane and useful for checking macro specific definitions. Remove now redundant --target= argument for rpmspec as it's now global.
-rw-r--r--lib/poptALL.c6
-rw-r--r--lib/rpmcli.h1
-rw-r--r--rpmspec.c2
3 files changed, 7 insertions, 2 deletions
diff --git a/lib/poptALL.c b/lib/poptALL.c
index 9cd4360f7..0fea76b01 100644
--- a/lib/poptALL.c
+++ b/lib/poptALL.c
@@ -159,6 +159,10 @@ static void rpmcliAllArgCallback( poptContext con,
case RPMCLI_POPT_NOHDRCHK:
rpmcliQueryFlags |= VERIFY_HDRCHK;
break;
+
+ case RPMCLI_POPT_TARGETPLATFORM:
+ rpmcliInitialized = rpmReadConfigFiles(rpmcliRcfile, arg);
+ break;
}
}
@@ -182,6 +186,8 @@ struct poptOption rpmcliAllPoptTable[] = {
{ "eval", 'E', POPT_ARG_STRING, 0, 'E',
N_("print macro expansion of EXPR"),
N_("'EXPR'") },
+ { "target", '\0', POPT_ARG_STRING, NULL, RPMCLI_POPT_TARGETPLATFORM,
+ N_("Specify target platform"), N_("CPU-VENDOR-OS") },
{ "macros", '\0', POPT_ARG_STRING, &macrofiles, 0,
N_("read <FILE:...> instead of default file(s)"),
N_("<FILE:...>") },
diff --git a/lib/rpmcli.h b/lib/rpmcli.h
index 9e5149cb3..f593bef96 100644
--- a/lib/rpmcli.h
+++ b/lib/rpmcli.h
@@ -70,6 +70,7 @@ rpmcliFini(poptContext optCon);
#define RPMCLI_POPT_NOHDRCHK -1031
#define RPMCLI_POPT_NOCONTEXTS -1032
#define RPMCLI_POPT_NOCAPS -1033
+#define RPMCLI_POPT_TARGETPLATFORM -1034
/* ==================================================================== */
/** \name RPMQV */
diff --git a/rpmspec.c b/rpmspec.c
index 68adaf6fc..86e3285ad 100644
--- a/rpmspec.c
+++ b/rpmspec.c
@@ -31,8 +31,6 @@ static struct poptOption specOptsTable[] = {
N_("operate on binary rpms that would be built from spec"), NULL },
{ "srpm", 0, POPT_ARG_VAL, &source, RPMQV_SPECSRPM,
N_("operate on source rpm generated by spec"), NULL },
- { "target", 0, POPT_ARG_STRING, &target, 0,
- N_("override target platform"), NULL },
{ "queryformat", 0, POPT_ARG_STRING, &queryformat, 0,
N_("use the following query format"), "QUERYFORMAT" },
{ "qf", 0, (POPT_ARG_STRING | POPT_ARGFLAG_DOC_HIDDEN), &queryformat, 0,