RPM Community Forums

Mailing List Message of <rpm-devel>

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

From: Jeff Johnson <n3npq@mac.com>
Date: Fri 25 Jan 2008 - 23:00:07 CET
Message-Id: <28DDB011-6E0D-4384-AB0C-A36D170C89C3@mac.com>
Nothing wrong with the patch at all, but ...

It does impose certain difficult (for packagers) issues
wrto when the macro probe is expanded. This is
the obvious failure case
     %build
      export CC=someothercc
      CC="%{getenv:CC}"
which will probe rpmbuild's, not the %build, environment surprisingly.

*shrug*

73 de Jeff

On Jan 25, 2008, at 4:39 PM, Ralf S. Engelschall wrote:

>   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:   25-Jan-2008  
> 22:39:44
>   Branch: HEAD                             Handle: 2008012521394300
>
>   Modified files:
>     rpm                     CHANGES
>     rpm/rpmio               macro.c
>
>   Log:
>     Allow sub-shell and Lua independent speedy lookup of environment
>     variables via %{getenv:<name>} in macros
>
>   Summary:
>     Revision    Changes     Path
>     1.2096      +1  -0      rpm/CHANGES
>     2.179       +5  -0      rpm/rpmio/macro.c
>    
> ______________________________________________________________________ 
> ______
>
>   patch -p0 <<'@@ .'
>   Index: rpm/CHANGES
>    
> ====================================================================== 
> ======
>   $ cvs diff -u -r1.2095 -r1.2096 CHANGES
>   --- rpm/CHANGES	25 Jan 2008 17:04:23 -0000	1.2095
>   +++ rpm/CHANGES	25 Jan 2008 21:39:43 -0000	1.2096
>   @@ -1,4 +1,5 @@
>    5.0.0 -> 5.1a1:
>   +    - rse: allow sub-shell and Lua independent speedy lookup of  
> environment variables via %{getenv:<name>} in macros
>        - jbj: QNX needs defines for fts.c.
>        - rse: upgrade from Lua 5.1.2 to Lua 5.1.3 (external and  
> internal)
>        - jbj: include <pthread.h> everywhere.
>   @@ .
>   patch -p0 <<'@@ .'
>   Index: rpm/rpmio/macro.c
>    
> ====================================================================== 
> ======
>   $ cvs diff -u -r2.178 -r2.179 macro.c
>   --- rpm/rpmio/macro.c	21 Jan 2008 18:40:42 -0000	2.178
>   +++ rpm/rpmio/macro.c	25 Jan 2008 21:39:43 -0000	2.179
>   @@ -1207,6 +1207,10 @@
>                    b = buf;
>                }
>            }
>   +    } else if (STREQ("getenv", f, fn)) {
>   +        char *cp;
>   +        if ((cp = getenv(buf)) != NULL)
>   +            b = cp;
>        } else if (STREQ("suffix", f, fn)) {
>    	if ((b = strrchr(buf, '.')) != NULL)
>    	    b++;
>   @@ -1601,6 +1605,7 @@
>    	if (STREQ("basename", f, fn) ||
>    	    STREQ("dirname", f, fn) ||
>    	    STREQ("realpath", f, fn) ||
>   +	    STREQ("getenv", f, fn) ||
>    	    STREQ("suffix", f, fn) ||
>    	    STREQ("expand", f, fn) ||
>    	    STREQ("verbose", f, fn) ||
>   @@ .
> ______________________________________________________________________
> RPM Package Manager                                    http://rpm5.org
> CVS Sources Repository                                rpm-cvs@rpm5.org
Received on Fri Jan 25 23:00:32 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.