]> git.pld-linux.org Git - packages/rpm.git/commitdiff
- fixed this patch (info in rpm.spec)
authorfilon <filon@sokrates.mimuw.edu.pl>
Sat, 1 Sep 2001 17:23:37 +0000 (17:23 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    rpm-noexpand.patch -> 1.2

rpm-noexpand.patch

index 1edb31b08ee17aab4859c76afd87c277311a8463..1b740bd1200f14387f600c45ad773d719d3d788b 100644 (file)
@@ -1,6 +1,6 @@
-diff -urN rpm-4.0.2/build/parseChangelog.c rpm-4.0.2.new/build/parseChangelog.c
+diff -urN rpm-4.0.2/build/parseChangelog.c rpm-4.0.2.patched/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
++++ rpm-4.0.2.patched/build/parseChangelog.c   Sat Sep  1 15:11:55 2001
 @@ -213,7 +213,7 @@
      
      while (! (nextPart = isPart(spec->line))) {
@@ -10,21 +10,9 @@ diff -urN rpm-4.0.2/build/parseChangelog.c rpm-4.0.2.new/build/parseChangelog.c
            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
+diff -urN rpm-4.0.2/build/parseSpec.c rpm-4.0.2.patched/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
++++ rpm-4.0.2.patched/build/parseSpec.c        Sat Sep  1 15:36:00 2001
 @@ -131,12 +131,16 @@
        ofi->readPtr = from;
  
@@ -35,8 +23,8 @@ diff -urN rpm-4.0.2/build/parseSpec.c rpm-4.0.2.new/build/parseSpec.c
 -                      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))) {
@@ -48,9 +36,175 @@ diff -urN rpm-4.0.2/build/parseSpec.c rpm-4.0.2.new/build/parseSpec.c
        spec->nextline = spec->lbuf;
      }
  
-diff -urN rpm-4.0.2/build/rpmbuild.h rpm-4.0.2.new/build/rpmbuild.h
+@@ -241,86 +245,88 @@
+     SKIPSPACE(s);
+     match = -1;
+-    if (! strncmp("%ifarch", s, sizeof("%ifarch")-1)) {
+-      const char *arch = rpmExpand("%{_target_cpu}", NULL);
+-      s += 7;
+-      match = matchTok(arch, s);
+-      free((void *)arch);
+-    } else if (! strncmp("%ifnarch", s, sizeof("%ifnarch")-1)) {
+-      const char *arch = rpmExpand("%{_target_cpu}", NULL);
+-      s += 8;
+-      match = !matchTok(arch, s);
+-      free((void *)arch);
+-    } else if (! strncmp("%ifos", s, sizeof("%ifos")-1)) {
+-      const char *os = rpmExpand("%{_target_os}", NULL);
+-      s += 5;
+-      match = matchTok(os, s);
+-      free((void *)os);
+-    } else if (! strncmp("%ifnos", s, sizeof("%ifnos")-1)) {
+-      const char *os = rpmExpand("%{_target_os}", NULL);
+-      s += 6;
+-      match = !matchTok(os, s);
+-      free((void *)os);
+-    } else if (! strncmp("%if", s, sizeof("%if")-1)) {
+-      s += 3;
+-        match = parseExpressionBoolean(spec, s);
+-      if (match < 0) {
+-          rpmError(RPMERR_UNMATCHEDIF,
+-                      _("%s:%d: parseExpressionBoolean returns %d\n"),
+-                      ofi->fileName, ofi->lineNum, match);
+-          return RPMERR_BADSPEC;
+-      }
+-    } else if (! strncmp("%else", s, sizeof("%else")-1)) {
+-      s += 5;
+-      if (! spec->readStack->next) {
+-          /* Got an else with no %if ! */
+-          rpmError(RPMERR_UNMATCHEDIF,
+-                      _("%s:%d: Got a %%else with no %%if\n"),
+-                      ofi->fileName, ofi->lineNum);
+-          return RPMERR_UNMATCHEDIF;
+-      }
+-      spec->readStack->reading =
+-          spec->readStack->next->reading && ! spec->readStack->reading;
+-      spec->line[0] = '\0';
+-    } else if (! strncmp("%endif", s, sizeof("%endif")-1)) {
+-      s += 6;
+-      if (! spec->readStack->next) {
+-          /* Got an end with no %if ! */
+-          rpmError(RPMERR_UNMATCHEDIF,
+-                      _("%s:%d: Got a %%endif with no %%if\n"),
+-                      ofi->fileName, ofi->lineNum);
+-          return RPMERR_UNMATCHEDIF;
+-      }
+-      rl = spec->readStack;
+-      spec->readStack = spec->readStack->next;
+-      free(rl);
+-      spec->line[0] = '\0';
+-    } else if (! strncmp("%include", s, sizeof("%include")-1)) {
+-      char *fileName, *endFileName, *p;
+-
+-      s += 8;
+-      fileName = s;
+-      if (! isspace(*fileName)) {
+-          rpmError(RPMERR_BADSPEC, _("malformed %%include statement\n"));
+-          return RPMERR_BADSPEC;
+-      }
+-      SKIPSPACE(fileName);
+-      endFileName = fileName;
+-      SKIPNONSPACE(endFileName);
+-      p = endFileName;
+-      SKIPSPACE(p);
+-      if (*p != '\0') {
+-          rpmError(RPMERR_BADSPEC, _("malformed %%include statement\n"));
+-          return RPMERR_BADSPEC;
+-      }
+-      *endFileName = '\0';
++    if (! (strip & STRIP_NOEXPAND)) {
++        if (! strncmp("%ifarch", s, sizeof("%ifarch")-1)) {
++          const char *arch = rpmExpand("%{_target_cpu}", NULL);
++          s += 7;
++          match = matchTok(arch, s);
++          free((void *)arch);
++      } else if (! strncmp("%ifnarch", s, sizeof("%ifnarch")-1)) {
++          const char *arch = rpmExpand("%{_target_cpu}", NULL);
++          s += 8;
++          match = !matchTok(arch, s);
++          free((void *)arch);
++      } else if (! strncmp("%ifos", s, sizeof("%ifos")-1)) {
++          const char *os = rpmExpand("%{_target_os}", NULL);
++          s += 5;
++          match = matchTok(os, s);
++          free((void *)os);
++      } else if (! strncmp("%ifnos", s, sizeof("%ifnos")-1)) {
++          const char *os = rpmExpand("%{_target_os}", NULL);
++          s += 6;
++          match = !matchTok(os, s);
++          free((void *)os);
++      } else if (! strncmp("%if", s, sizeof("%if")-1)) {
++          s += 3;
++          match = parseExpressionBoolean(spec, s);
++          if (match < 0) {
++              rpmError(RPMERR_UNMATCHEDIF,
++                          _("%s:%d: parseExpressionBoolean returns %d\n"),
++                          ofi->fileName, ofi->lineNum, match);
++              return RPMERR_BADSPEC;
++          }
++      } else if (! strncmp("%else", s, sizeof("%else")-1)) {
++          s += 5;
++          if (! spec->readStack->next) {
++              /* Got an else with no %if ! */
++              rpmError(RPMERR_UNMATCHEDIF,
++                          _("%s:%d: Got a %%else with no %%if\n"),
++                          ofi->fileName, ofi->lineNum);
++              return RPMERR_UNMATCHEDIF;
++          }
++          spec->readStack->reading =
++              spec->readStack->next->reading && ! spec->readStack->reading;
++          spec->line[0] = '\0';
++      } else if (! strncmp("%endif", s, sizeof("%endif")-1)) {
++          s += 6;
++          if (! spec->readStack->next) {
++              /* Got an end with no %if ! */
++              rpmError(RPMERR_UNMATCHEDIF,
++                          _("%s:%d: Got a %%endif with no %%if\n"),
++                          ofi->fileName, ofi->lineNum);
++              return RPMERR_UNMATCHEDIF;
++          }
++          rl = spec->readStack;
++          spec->readStack = spec->readStack->next;
++          free(rl);
++          spec->line[0] = '\0';
++      } else if (! strncmp("%include", s, sizeof("%include")-1)) {
++          char *fileName, *endFileName, *p;
++
++          s += 8;
++          fileName = s;
++          if (! isspace(*fileName)) {
++              rpmError(RPMERR_BADSPEC, _("malformed %%include statement\n"));
++              return RPMERR_BADSPEC;
++          }
++          SKIPSPACE(fileName);
++          endFileName = fileName;
++          SKIPNONSPACE(endFileName);
++          p = endFileName;
++          SKIPSPACE(p);
++          if (*p != '\0') {
++              rpmError(RPMERR_BADSPEC, _("malformed %%include statement\n"));
++              return RPMERR_BADSPEC;
++          }
++          *endFileName = '\0';
+-      forceIncludeFile(spec, fileName);
++          forceIncludeFile(spec, fileName);
+-      ofi = spec->fileStack;
+-      goto retry;
++          ofi = spec->fileStack;
++          goto retry;
++      }
+     }
+-
++    
+     if (match != -1) {
+       rl = xmalloc(sizeof(struct ReadLevelEntry));
+       rl->reading = spec->readStack->reading && match;
+diff -urN rpm-4.0.2/build/rpmbuild.h rpm-4.0.2.patched/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
++++ rpm-4.0.2.patched/build/rpmbuild.h Sat Sep  1 15:11:55 2001
 @@ -69,6 +69,7 @@
  #define STRIP_NOTHING             0
  #define STRIP_TRAILINGSPACE (1 << 0)
This page took 0.042698 seconds and 4 git commands to generate.