RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: rpm/ CHANGES rpm/lib/ poptALL.c rpm/rpmio/ macro.c

From: Ralf S. Engelschall <rse@rpm5.org>
Date: Fri 28 Dec 2007 - 12:26:50 CET
Message-Id: <20071228112650.80D4234845C@rpm5.org>
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Ralf S. Engelschall
  Root:   /v/rpm/cvs                       Email:  rse@rpm5.org
  Module: rpm                              Date:   28-Dec-2007 12:26:50
  Branch: HEAD                             Handle: 2007122811264901

  Modified files:
    rpm                     CHANGES
    rpm/lib                 poptALL.c
    rpm/rpmio               macro.c

  Log:
    Fix %{@foo} macro stack expansion including also the value at the stack
    bottom and remove the confusing additional --predefine behaviour when
    --define is used as the very first CLI option, as this is both a very
    bad hack from the year 2002 and especially results in the value of the
    first --define option to occur twice on %{@foo} macro stack expansions.

  Summary:
    Revision    Changes     Path
    1.2029      +2  -0      rpm/CHANGES
    2.68        +9  -0      rpm/lib/poptALL.c
    2.166       +1  -1      rpm/rpmio/macro.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.2028 -r1.2029 CHANGES
  --- rpm/CHANGES	28 Dec 2007 01:50:11 -0000	1.2028
  +++ rpm/CHANGES	28 Dec 2007 11:26:49 -0000	1.2029
  @@ -1,4 +1,6 @@
   5.0b3 -> 5.0b4:
  +    - rse: fix %{@foo} macro stack expansion including also the value at the stack bottom
  +    - rse: remove the confusing additional --predefine behaviour when --define is used as the first CLI option
       - jbj: simplify expandFIFO().
       - jbj: use "\n", not ",", as the default for %@foo expansion.
       - jbj: fixup %{@foo:, } per rse comments.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/poptALL.c
  ============================================================================
  $ cvs diff -u -r2.67 -r2.68 poptALL.c
  --- rpm/lib/poptALL.c	27 Dec 2007 17:07:09 -0000	2.67
  +++ rpm/lib/poptALL.c	28 Dec 2007 11:26:50 -0000	2.68
  @@ -217,9 +217,18 @@
   	}
   	t = s;
   	if (*t == '%') t++;
  +#if 0
   	/* XXX Predefine macro if not initialized yet. */
  +        /* rse: this is a very bad hack from the year 2002 which especially results in
  +           the value of the first --define option to occur twice on %{@foo} macro stack
  +           expansions. We have now disabled it because:
  +           1. it is a very confusing sematic
  +           2. it applies only to the absolutely first occurrence of a --define usage
  +           3. there is already the explicit --predefine in case one really has to
  +              define a macro before the config files are loaded. */
   	if (rpmcliInitialized < 0)
   	    (void) rpmDefineMacro(NULL, t, RMIL_CMDLINE);
  +#endif
   	rpmcliConfigured();
   /*@-type@*/
   	(void) rpmDefineMacro(NULL, t, RMIL_CMDLINE);
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/macro.c
  ============================================================================
  $ cvs diff -u -r2.165 -r2.166 macro.c
  --- rpm/rpmio/macro.c	28 Dec 2007 01:50:11 -0000	2.165
  +++ rpm/rpmio/macro.c	28 Dec 2007 11:26:50 -0000	2.166
  @@ -1309,7 +1309,7 @@
   {
       int rc = 0;
   
  -    if (me && me->prev && me->prev->prev) {
  +    if (me && me->prev) {
   	rc = expandFIFO(mb, me->prev, g, gn);
   	rc = expandT(mb, g, gn);
       }
  @@ .
Received on Fri Dec 28 12:26:50 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.