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[] = {
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,
if (rpmcliPipeOutput && initPipe())
exit(EXIT_FAILURE);
+
+ if (target) {
+ rpmFreeMacros(NULL);
+ rpmFreeRpmrc();
+ rpmReadConfigFiles(rpmcliRcfile, target);
+ }
ts = rpmtsCreate();
switch (mode) {