]> git.pld-linux.org Git - packages/rpm.git/blame - rpm-noexpand.patch
- typo
[packages/rpm.git] / rpm-noexpand.patch
CommitLineData
64d70a3f
ER
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
3@@ -318,7 +318,7 @@
3fbaf6a5 4 line = xstrtolocale(line);
0a6e9fd1 5 appendStringBuf(sb, spec->line);
3fbaf6a5 6 line = _free(line);
0a6e9fd1 7- if ((rc = readLine(spec, STRIP_COMMENTS)) > 0) {
8+ if ((rc = readLine(spec, STRIP_COMMENTS | STRIP_NOEXPAND)) > 0) {
9 nextPart = PART_NONE;
10 break;
11 }
64d70a3f
ER
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
71d7b7be
ER
14@@ -168,7 +168,7 @@
15
16 /**
17 */
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,
21 fileSystem @*/
22 /*@modifies spec->nextline, spec->nextpeekc, spec->lbuf, spec->line,
e04c27a7 23@@ -230,12 +230,16 @@
5c9a08aa 24 /*@=mods@*/
0a6e9fd1 25
26 /* Don't expand macros (eg. %define) in false branch of %if clause */
af197e8e 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 */
0a6e9fd1 29+ if (!(strip & STRIP_NOEXPAND)) {
13e787b0 30 if (spec->readStack->reading &&
e04c27a7 31 expandMacros(spec, spec->macros, spec->lbuf, spec->lbuf_len)) {
5c9a08aa 32 rpmlog(RPMLOG_ERR, _("line %d: %s\n"),
13e787b0 33 spec->lineNum, spec->lbuf);
5c9a08aa 34 return RPMRC_FAIL;
13e787b0 35 }
e04c27a7 36+ }
0a6e9fd1 37 spec->nextline = spec->lbuf;
38 }
e04c27a7 39 return 0;
64d70a3f 40@@ -347,7 +351,7 @@
71d7b7be
ER
41
42 /* Copy next file line into the spec line buffer */
43
44- if ((rc = copyNextLineFromOFI(spec, ofi)) != 0) {
45+ if ((rc = copyNextLineFromOFI(spec, ofi, strip)) != 0) {
46 if (rc == RPMRC_FAIL)
47 goto retry;
48 return rc;
64d70a3f
ER
49@@ -360,6 +364,7 @@
50 SKIPSPACE(s);
51
52 match = -1;
53+ if (! (strip & STRIP_NOEXPAND)) {
54 if (!spec->readStack->reading && !strncmp("%if", s, sizeof("%if")-1)) {
55 match = 0;
56 } else if (! strncmp("%ifarch", s, sizeof("%ifarch")-1)) {
57@@ -441,6 +446,7 @@
5b0f0ac9
MM
58 ofi = spec->fileStack;
59 goto retry;
af197e8e 60 }
5b0f0ac9
MM
61+ }
62
af197e8e 63 if (match != -1) {
5b0f0ac9 64 rl = xmalloc(sizeof(*rl));
64d70a3f
ER
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
67@@ -83,6 +83,7 @@
0a6e9fd1 68 #define STRIP_NOTHING 0
69 #define STRIP_TRAILINGSPACE (1 << 0)
70 #define STRIP_COMMENTS (1 << 1)
71+#define STRIP_NOEXPAND (1 << 2)
72
64d70a3f
ER
73 /*@unchecked@*/
74 extern int _rpmbuildFlags;
This page took 0.08166 seconds and 4 git commands to generate.