1 --- rpm-5.0.1.noexpand/build/parseChangelog.c 2008-01-31 01:18:18.506330692 +0200
2 +++ rpm-5.0.1/build/parseChangelog.c 2008-01-31 01:20:45.467027848 +0200
4 line = xstrtolocale(line);
5 appendStringBuf(sb, spec->line);
7 - if ((rc = readLine(spec, STRIP_COMMENTS)) > 0) {
8 + if ((rc = readLine(spec, STRIP_COMMENTS | STRIP_NOEXPAND)) > 0) {
12 --- rpm-5.0.1.noexpand/build/parseSpec.c 2008-01-31 01:18:18.509664191 +0200
13 +++ rpm-5.0.1/build/parseSpec.c 2008-01-31 01:20:45.073674806 +0200
18 -static int copyNextLineFromOFI(Spec spec, OFI_t * ofi)
19 +static int copyNextLineFromOFI(Spec spec, OFI_t * ofi, int strip)
20 /*@globals rpmGlobalMacroContext, h_errno,
22 /*@modifies spec->nextline, spec->nextpeekc, spec->lbuf, spec->line,
26 /* Don't expand macros (eg. %define) in false branch of %if clause */
27 + /* Also don't expand macros in %changelog where we set STRIP_NOEXPAND flag */
28 + /* (first line is ommited, so if there is e.g. %date macro, it will be expanded */
29 + if (!(strip & STRIP_NOEXPAND)) {
30 if (spec->readStack->reading &&
31 expandMacros(spec, spec->macros, spec->lbuf, spec->lbuf_len)) {
32 rpmlog(RPMLOG_ERR, _("line %d: %s\n"),
33 spec->lineNum, spec->lbuf);
37 spec->nextline = spec->lbuf;
42 /* Copy next file line into the spec line buffer */
44 - if ((rc = copyNextLineFromOFI(spec, ofi)) != 0) {
45 + if ((rc = copyNextLineFromOFI(spec, ofi, strip)) != 0) {
53 + if (! (strip & STRIP_NOEXPAND)) {
54 if (!spec->readStack->reading && !strncmp("%if", s, sizeof("%if")-1)) {
56 } else if (! strncmp("%ifarch", s, sizeof("%ifarch")-1)) {
58 ofi = spec->fileStack;
64 rl = xmalloc(sizeof(*rl));
65 --- rpm-5.0.1.noexpand/build/rpmbuild.h 2008-01-31 01:18:18.509664191 +0200
66 +++ rpm-5.0.1/build/rpmbuild.h 2008-01-31 01:20:45.073674806 +0200
68 #define STRIP_NOTHING 0
69 #define STRIP_TRAILINGSPACE (1 << 0)
70 #define STRIP_COMMENTS (1 << 1)
71 +#define STRIP_NOEXPAND (1 << 2)
74 extern int _rpmbuildFlags;