]> git.pld-linux.org Git - packages/rpm.git/blob - rpm-noexpand.patch
- update against rpm5 changeset 9161
[packages/rpm.git] / rpm-noexpand.patch
1 --- rpm-4.4.3/build/parseChangelog.c.orig       2005-11-12 01:20:12.000000000 +0100
2 +++ rpm-4.4.3/build/parseChangelog.c    2005-11-18 19:46:50.357322048 +0100
3 @@ -255,7 +255,7 @@
4         line = xstrtolocale(line);
5         appendStringBuf(sb, spec->line);
6         line = _free(line);
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         }
12 --- rpm-4.3/build/parseSpec.c   Fri May 16 00:08:57 2003
13 +++ rpm-5.0.1/build/parseSpec.c 2008-01-31 00:43:18.388524335 +0200
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,
23 @@ -230,12 +230,16 @@
24  /*@=mods@*/
25  
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);
34                 return RPMRC_FAIL;
35         }
36 +       }
37         spec->nextline = spec->lbuf;
38      }
39      return 0;
40 @@ -273,6 +277,7 @@
41      SKIPSPACE(s);
42  
43      match = -1;
44 +    if (! (strip & STRIP_NOEXPAND)) {
45      if (!spec->readStack->reading && !strncmp("%if", s, sizeof("%if")-1)) {
46         match = 0;
47      } else if (! strncmp("%ifarch", s, sizeof("%ifarch")-1)) {
48 @@ -346,7 +351,7 @@
49  
50        /* Copy next file line into the spec line buffer */
51  
52 -      if ((rc = copyNextLineFromOFI(spec, ofi)) != 0) {
53 +      if ((rc = copyNextLineFromOFI(spec, ofi, strip)) != 0) {
54         if (rc == RPMRC_FAIL)
55             goto retry;
56         return rc;
57 @@ -354,6 +359,7 @@
58         ofi = spec->fileStack;
59         goto retry;
60      }
61 +    }
62  
63      if (match != -1) {
64         rl = xmalloc(sizeof(*rl));
65 --- rpm-4.3/build/rpmbuild.h.wiget      Sat May 10 17:19:33 2003
66 +++ rpm-4.3/build/rpmbuild.h    Fri May 16 00:06:47 2003
67 @@ -75,6 +75,7 @@
68  #define STRIP_NOTHING             0
69  #define STRIP_TRAILINGSPACE (1 << 0)
70  #define STRIP_COMMENTS      (1 << 1)
71 +#define STRIP_NOEXPAND      (1 << 2)
72  
73  #ifdef __cplusplus
74  extern "C" {
This page took 0.0353 seconds and 3 git commands to generate.