X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=rpm-noexpand.patch;h=7e796f6934474201c8d79ff434d59e584f2c83e0;hb=1b5fbdd6b61436bd0cdff1cc939ef80c2bb59a9e;hp=1edb31b08ee17aab4859c76afd87c277311a8463;hpb=0a6e9fd18fb9abecd65b1b8e94de0fa0a27415ba;p=packages%2Frpm.git diff --git a/rpm-noexpand.patch b/rpm-noexpand.patch index 1edb31b..7e796f6 100644 --- a/rpm-noexpand.patch +++ b/rpm-noexpand.patch @@ -1,61 +1,74 @@ -diff -urN rpm-4.0.2/build/parseChangelog.c rpm-4.0.2.new/build/parseChangelog.c ---- rpm-4.0.2/build/parseChangelog.c Tue Jan 16 00:10:04 2001 -+++ rpm-4.0.2.new/build/parseChangelog.c Thu Aug 30 23:41:32 2001 -@@ -213,7 +213,7 @@ - - while (! (nextPart = isPart(spec->line))) { +--- rpm-5.0.1.noexpand/build/parseChangelog.c 2008-01-31 01:18:18.506330692 +0200 ++++ rpm-5.0.1/build/parseChangelog.c 2008-01-31 01:20:45.467027848 +0200 +@@ -318,7 +318,7 @@ + line = xstrtolocale(line); appendStringBuf(sb, spec->line); + line = _free(line); - if ((rc = readLine(spec, STRIP_COMMENTS)) > 0) { + if ((rc = readLine(spec, STRIP_COMMENTS | STRIP_NOEXPAND)) > 0) { nextPart = PART_NONE; break; } -diff -urN rpm-4.0.2/build/parseDescription.c rpm-4.0.2.new/build/parseDescription.c ---- rpm-4.0.2/build/parseDescription.c Tue Jan 16 00:10:04 2001 -+++ rpm-4.0.2.new/build/parseDescription.c Thu Aug 30 23:41:47 2001 -@@ -106,7 +106,7 @@ - appendLineStringBuf(sb, spec->line); - if (t) t->t_nlines++; - if ((rc = -- readLine(spec, STRIP_TRAILINGSPACE | STRIP_COMMENTS)) > 0) { -+ readLine(spec, STRIP_TRAILINGSPACE | STRIP_COMMENTS | STRIP_NOEXPAND)) > 0) { - nextPart = PART_NONE; - break; - } -diff -urN rpm-4.0.2/build/parseSpec.c rpm-4.0.2.new/build/parseSpec.c ---- rpm-4.0.2/build/parseSpec.c Tue Jan 16 14:08:55 2001 -+++ rpm-4.0.2.new/build/parseSpec.c Thu Aug 30 23:58:52 2001 -@@ -131,12 +131,16 @@ - ofi->readPtr = from; +--- rpm-5.0.1.noexpand/build/parseSpec.c 2008-01-31 01:18:18.509664191 +0200 ++++ rpm-5.0.1/build/parseSpec.c 2008-01-31 01:20:45.073674806 +0200 +@@ -168,7 +168,7 @@ + + /** + */ +-static int copyNextLineFromOFI(Spec spec, OFI_t * ofi) ++static int copyNextLineFromOFI(Spec spec, OFI_t * ofi, int strip) + /*@globals rpmGlobalMacroContext, h_errno, + fileSystem @*/ + /*@modifies spec->nextline, spec->nextpeekc, spec->lbuf, spec->line, +@@ -230,12 +230,16 @@ + /*@=mods@*/ /* Don't expand macros (eg. %define) in false branch of %if clause */ -- if (spec->readStack->reading && -- expandMacros(spec, spec->macros, spec->lbuf, sizeof(spec->lbuf))) { -- rpmError(RPMERR_BADSPEC, _("line %d: %s\n"), -- spec->lineNum, spec->lbuf); -- return RPMERR_BADSPEC; -- } -+ /* Also don't expand macros in %changelog and %description, where -+ we set STRIP_NOEXPAND flag */ ++ /* Also don't expand macros in %changelog where we set STRIP_NOEXPAND flag */ ++ /* (first line is ommited, so if there is e.g. %date macro, it will be expanded */ + if (!(strip & STRIP_NOEXPAND)) { -+ if (spec->readStack->reading && -+ expandMacros(spec, spec->macros, spec->lbuf, sizeof(spec->lbuf))) { -+ rpmError(RPMERR_BADSPEC, _("line %d: %s\n"), -+ spec->lineNum, spec->lbuf); -+ return RPMERR_BADSPEC; -+ } -+ } + if (spec->readStack->reading && + expandMacros(spec, spec->macros, spec->lbuf, spec->lbuf_len)) { + rpmlog(RPMLOG_ERR, _("line %d: %s\n"), + spec->lineNum, spec->lbuf); + return RPMRC_FAIL; + } ++ } spec->nextline = spec->lbuf; } + return 0; +@@ -347,7 +351,7 @@ + + /* Copy next file line into the spec line buffer */ + +- if ((rc = copyNextLineFromOFI(spec, ofi)) != 0) { ++ if ((rc = copyNextLineFromOFI(spec, ofi, strip)) != 0) { + if (rc == RPMRC_FAIL) + goto retry; + return rc; +@@ -360,6 +364,7 @@ + SKIPSPACE(s); + + match = -1; ++ if (! (strip & STRIP_NOEXPAND)) { + if (!spec->readStack->reading && !strncmp("%if", s, sizeof("%if")-1)) { + match = 0; + } else if (! strncmp("%ifarch", s, sizeof("%ifarch")-1)) { +@@ -441,6 +446,7 @@ + ofi = spec->fileStack; + goto retry; + } ++ } -diff -urN rpm-4.0.2/build/rpmbuild.h rpm-4.0.2.new/build/rpmbuild.h ---- rpm-4.0.2/build/rpmbuild.h Thu Jan 11 15:15:15 2001 -+++ rpm-4.0.2.new/build/rpmbuild.h Thu Aug 30 23:25:00 2001 -@@ -69,6 +69,7 @@ + if (match != -1) { + rl = xmalloc(sizeof(*rl)); +--- rpm-5.0.1.noexpand/build/rpmbuild.h 2008-01-31 01:18:18.509664191 +0200 ++++ rpm-5.0.1/build/rpmbuild.h 2008-01-31 01:20:45.073674806 +0200 +@@ -83,6 +83,7 @@ #define STRIP_NOTHING 0 #define STRIP_TRAILINGSPACE (1 << 0) #define STRIP_COMMENTS (1 << 1) +#define STRIP_NOEXPAND (1 << 2) - #ifdef __cplusplus - extern "C" { + /*@unchecked@*/ + extern int _rpmbuildFlags;