On Sunday 02 January 2011 18:42:23 Jeff Johnson wrote:
> Your patch NEEDS --specedit.
> 
> Can you describe the usage case so I can figure out a replacement?

Sorry for the late reply, to get a preprocessed specfile output we just use:
rpm -q --specfile --specedit gcc.spec

Where --specedit could be replaced by a more correct option name like, --
specdump or --preparse, --preprocess or anything that sounds better...

> (aside)
> The --specedit option was added to rip i18n out of *.spec 10 years ago
> and hasn't had any usage case till now.

Yes, I recall that it was printing multiple times the whole specfile for each 
language defined with e.g. using Summary(it), that's why, I think, I avoided 
using printNewSpecfile. We never used it in that way as well.

--- rpm-4.4.9.orig//build/parseSpec.c   2010-08-03 15:57:18.740342061 +0200
+++ rpm-4.4.9/build/parseSpec.c 2010-08-03 15:58:02.071216551 +0200
@@ -402,6 +402,12 @@
 
     if (! spec->readStack->reading) {
        spec->line[0] = '\0';
+    } else {
+        if (specedit) {
+           printf("%s",spec->line);
+           if (strchr(spec->line, '\n') == NULL && spec->line[strlen(spec-
>line)-1] != '\n')
+              printf("\n");
+       }
     }
 
     /*@-compmempass@*/ /* FIX: spec->readStack->next should be dependent */
--- rpm-4.4.9.orig//build/spec.c        2010-08-03 15:57:20.203092007 +0200
+++ rpm-4.4.9/build/spec.c      2010-08-03 15:56:45.128341759 +0200
@@ -724,7 +724,7 @@
 
     res = 0;
     if (specedit) {
-       printNewSpecfile(spec);
+//     printNewSpecfile(spec);
        goto exit;
     }

Silvan

-- 
mambaSoft di Calarco Silvan
Web: http://www.mambasoft.it
 
mambaSoft Store @ http://www.mambastore.it
openmamba GNU/Linux development @ http://www.openmamba.org
______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
Developer Communication List                        rpm-devel@rpm5.org

Reply via email to