diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2010-10-12 14:56:18 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2010-10-12 14:56:18 +0300 |
commit | 999431a4ab356c84c7488f6aff35b598b8a86586 (patch) | |
tree | 6e4a1b79947214580899601bf08e6f776eea4d12 | |
parent | fb369ee0cc4a2990d3d5569302386b70dfa6f096 (diff) | |
download | rpm-999431a4ab356c84c7488f6aff35b598b8a86586.tar.gz |
Support overriding target for rpmspec queries too
-rw-r--r-- | rpmspec.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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) { |