Adjust rpmspec -P to invoke non-build parse
authorAlexey Tourbin <alexey.tourbin@gmail.com>
Tue, 22 Jan 2013 00:47:15 +0000 (00:47 +0000)
committerPanu Matilainen <pmatilai@redhat.com>
Tue, 29 Jan 2013 06:14:46 +0000 (08:14 +0200)
In the query mode, rpmspecQuery puts the parser into non-build mode
by invoking rpmSpecParse with (RPMSPEC_ANYARCH|RPMSPEC_FORCE) flags.
The same flags should be applied in the parse mode, so that it is
possible to preprocess specfiles separately, i.e. without also
installing sources and patches.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
(cherry picked from commit 4eb824937ce536aeecdfdcab2d88e28083bba85b)

rpmspec.c

index f7f6962..2027ffa 100644 (file)
--- a/rpmspec.c
+++ b/rpmspec.c
@@ -90,7 +90,7 @@ int main(int argc, char *argv[])
            argerror(_("no arguments given for parse"));
 
        while ((spath = poptGetArg(optCon)) != NULL) {
-           rpmSpec spec = rpmSpecParse(spath, 0, NULL);
+           rpmSpec spec = rpmSpecParse(spath, (RPMSPEC_ANYARCH|RPMSPEC_FORCE), NULL);
            if (spec == NULL) {
                ec++;
                continue;