]> git.pld-linux.org Git - packages/rpm.git/blob - noexpand.patch
- disable expanding of rpm macros in %changelog and %description
[packages/rpm.git] / noexpand.patch
1 diff -ur rpm-4.16.0/build/parseChangelog.c rpm-4.16.0-noexpand/build/parseChangelog.c
2 --- rpm-4.16.0/build/parseChangelog.c   2020-12-18 20:09:28.341535424 +0100
3 +++ rpm-4.16.0-noexpand/build/parseChangelog.c  2020-12-18 20:01:53.963847399 +0100
4 @@ -321,7 +321,7 @@
5         goto exit;
6      }
7      
8 -    if ((res = parseLines(spec, STRIP_COMMENTS, &sb, NULL)) == PART_ERROR)
9 +    if ((res = parseLines(spec, STRIP_COMMENTS | STRIP_NOEXPAND, &sb, NULL)) == PART_ERROR)
10         goto exit;
11  
12      if (sb && addChangelog(spec->packages->header, sb)) {
13 diff -ur rpm-4.16.0/build/parseDescription.c rpm-4.16.0-noexpand/build/parseDescription.c
14 --- rpm-4.16.0/build/parseDescription.c 2020-05-28 12:04:25.002136494 +0200
15 +++ rpm-4.16.0-noexpand/build/parseDescription.c        2020-12-18 20:02:38.770619734 +0100
16 @@ -64,7 +64,7 @@
17      if (lookupPackage(spec, name, flag, &pkg))
18         goto exit;
19  
20 -    if ((nextPart = parseLines(spec, (STRIP_TRAILINGSPACE |STRIP_COMMENTS),
21 +    if ((nextPart = parseLines(spec, (STRIP_TRAILINGSPACE |STRIP_COMMENTS | STRIP_NOEXPAND),
22                                 NULL, &sb)) == PART_ERROR) {
23         goto exit;
24      }
25 diff -ur rpm-4.16.0/build/parseSpec.c rpm-4.16.0-noexpand/build/parseSpec.c
26 --- rpm-4.16.0/build/parseSpec.c        2020-05-28 12:04:25.007136522 +0200
27 +++ rpm-4.16.0-noexpand/build/parseSpec.c       2020-12-18 20:08:13.791373996 +0100
28 @@ -242,6 +242,9 @@
29         if (!spec->readStack->reading)
30             return 0;
31      }
32 +    /* Also don't expand macros in %changelog and %description, where we set STRIP_NOEXPAND flag */
33 +    if (strip & STRIP_NOEXPAND)
34 +       return 0;
35  
36      if (specExpand(spec, ofi->lineNum, spec->lbuf, &lbuf))
37         return 1;
38 diff -ur rpm-4.16.0/build/rpmbuild_internal.h rpm-4.16.0-noexpand/build/rpmbuild_internal.h
39 --- rpm-4.16.0/build/rpmbuild_internal.h        2020-12-18 20:09:28.354868788 +0100
40 +++ rpm-4.16.0-noexpand/build/rpmbuild_internal.h       2020-12-18 20:09:09.054827168 +0100
41 @@ -246,6 +246,7 @@
42  #define STRIP_NOTHING             0
43  #define STRIP_TRAILINGSPACE (1 << 0)
44  #define STRIP_COMMENTS      (1 << 1)
45 +#define STRIP_NOEXPAND      (1 << 2)
46  
47  #define ALLOW_EMPTY         (1 << 16)
48  
This page took 0.04321 seconds and 4 git commands to generate.