summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2010-10-12 14:56:18 +0300
committerPanu Matilainen <pmatilai@redhat.com>2010-10-12 14:56:18 +0300
commit999431a4ab356c84c7488f6aff35b598b8a86586 (patch)
tree6e4a1b79947214580899601bf08e6f776eea4d12
parentfb369ee0cc4a2990d3d5569302386b70dfa6f096 (diff)
downloadrpm-999431a4ab356c84c7488f6aff35b598b8a86586.tar.gz
Support overriding target for rpmspec queries too
-rw-r--r--rpmspec.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/rpmspec.c b/rpmspec.c
index 9e79878bf..ff72570bf 100644
--- a/rpmspec.c
+++ b/rpmspec.c
@@ -17,6 +17,7 @@ enum modes {
static int mode = MODE_UNKNOWN;
static int source = RPMQV_SPECRPMS;
+const char *target = NULL;
/* the structure describing the options we take and the defaults */
static struct poptOption optionsTable[] = {
@@ -26,6 +27,8 @@ static struct poptOption optionsTable[] = {
N_("Operate on binary rpms generated by spec (default)"), 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 },
/* XXX FIXME: only queryformat is relevant for spec queries */
{ NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmQueryPoptTable, 0,
@@ -50,6 +53,12 @@ int main(int argc, char *argv[])
if (rpmcliPipeOutput && initPipe())
exit(EXIT_FAILURE);
+
+ if (target) {
+ rpmFreeMacros(NULL);
+ rpmFreeRpmrc();
+ rpmReadConfigFiles(rpmcliRcfile, target);
+ }
ts = rpmtsCreate();
switch (mode) {