RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: rpm/rpmio/ macro.c

From: Mark Hatle <fray@rpm5.org>
Date: Thu 12 Jul 2007 - 04:02:34 CEST
Message-Id: <20070712020234.DBAA03484F1@rpm5.org>
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Mark Hatle
  Root:   /v/rpm/cvs                       Email:  fray@rpm5.org
  Module: rpm                              Date:   12-Jul-2007 04:02:34
  Branch: HEAD                             Handle: 2007071203023400

  Modified files:
    rpm/rpmio               macro.c

  Log:
    Add a check to the macro checker routine (normally if def'ed out) to
    allow "%if", "%else", and "%endif".  All other values will continue to be
    defined such as:
    
    %define ifarch %%ifarch
    
    This is required because it's not possible to define "%if" and "%%if"
    because it's too short to be a legal macro.

  Summary:
    Revision    Changes     Path
    2.121       +10 -3      rpm/rpmio/macro.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/rpmio/macro.c
  ============================================================================
  $ cvs diff -u -r2.120 -r2.121 macro.c
  --- rpm/rpmio/macro.c	22 Jun 2007 12:58:11 -0000	2.120
  +++ rpm/rpmio/macro.c	12 Jul 2007 02:02:34 -0000	2.121
  @@ -1544,9 +1544,16 @@
   		c = '%';	/* XXX only need to save % */
   		SAVECHAR(mb, c);
   #else
  -		rpmError(RPMERR_BADSPEC,
  -			_("Macro %%%.*s not found, skipping\n"), fn, f);
  -		s = se;
  +		if (!strncmp(f, "if", fn) ||
  +		    !strncmp(f, "else", fn) ||
  +		    !strncmp(f, "endif", fn)) {
  +			c = '%';        /* XXX only need to save % */
  +			SAVECHAR(mb, c);
  +		} else {
  +			rpmError(RPMERR_BADSPEC,
  +				_("Macro %%%.*s not found, skipping\n"), fn, f);
  +			s = se;
  +		}
   #endif
   		continue;
   	}
  @@ .
Received on Thu Jul 12 04:02:34 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.