RPM Community Forums

Mailing List Message of <rpm-devel>

Re: [CVS] RPM: rpm/ CHANGES rpm/build/ parseSpec.c rpm/lib/ depends.c

From: Jeff Johnson <n3npq@mac.com>
Date: Sun 09 Jan 2011 - 01:29:47 CET
Message-Id: <E486A8CC-76EC-4D0B-8537-0667F7ECF10C@mac.com>
Hmmm ... if this "works" okay.

But the better fix would be instantiating %_target_platform dynamically
(Name: == %name etc is already done that way). But what's always tricky
there is figgering the expansion point (I think I broke noarch subpackages
by rearranging where %arch was expanded within the last year or so).

I'll take a look next week ...

73 de Jeff

On Jan 8, 2011, at 6:07 PM, Per Řyvind Karlsen wrote:

>  RPM Package Manager, CVS Repository
>  http://rpm5.org/cvs/
>  ____________________________________________________________________________
> 
>  Server: rpm5.org                         Name:   Per Řyvind Karlsen
>  Root:   /v/rpm/cvs                       Email:  pkarlsen@rpm5.org
>  Module: rpm                              Date:   09-Jan-2011 00:07:13
>  Branch: HEAD                             Handle: 2011010823071101
> 
>  Modified files:
>    rpm                     CHANGES
>    rpm/build               parseSpec.c
>    rpm/lib                 depends.c
> 
>  Log:
>    fix noarch sub-packages not having it's corresponding platform tag
>    (mdvbz#61746).
> 
>  Summary:
>    Revision    Changes     Path
>    1.3548      +2  -0      rpm/CHANGES
>    2.144       +13 -1      rpm/build/parseSpec.c
>    1.465       +12 -0      rpm/lib/depends.c
>  ____________________________________________________________________________
> 
>  patch -p0 <<'@@ .'
>  Index: rpm/CHANGES
>  ============================================================================
>  $ cvs diff -u -r1.3547 -r1.3548 CHANGES
>  --- rpm/CHANGES	8 Jan 2011 20:21:16 -0000	1.3547
>  +++ rpm/CHANGES	8 Jan 2011 23:07:12 -0000	1.3548
>  @@ -1,4 +1,6 @@
>   5.4.0 -> 5.4.1:
>  +    - proyvind: fix noarch sub-packages not having it's corresponding platform
>  +	tag (mdvbz#61746).
>       - proyvind: lookup3: fix runtime valgrind check and make it local.
>       - eveith: rb: Make Ruby classes participate in GC process
>       - jbj: omp: use a thread team solely for file digests to avoid overhead.
>  @@ .
>  patch -p0 <<'@@ .'
>  Index: rpm/build/parseSpec.c
>  ============================================================================
>  $ cvs diff -u -r2.143 -r2.144 parseSpec.c
>  --- rpm/build/parseSpec.c	6 Mar 2010 03:31:19 -0000	2.143
>  +++ rpm/build/parseSpec.c	8 Jan 2011 23:07:11 -0000	2.144
>  @@ -700,6 +700,7 @@
>       /* Check for description in each package and add arch and os */
>     {
>       const char *platform = rpmExpand("%{_target_platform}", NULL);
>  +    const char *platformNoarch = NULL;
>       const char *arch = rpmExpand("%{_target_cpu}", NULL);
>       const char *os = rpmExpand("%{_target_os}", NULL);
> 
>  @@ -717,9 +718,18 @@
>   	he->c = 1;
>   	xx = headerPut(pkg->header, he, 0);
> 
>  +	/* 
>  +	 * If "noarch" subpackages of different arch, we need
>  +	 * to use a separate platform tag for these (mdvbz#61746).
>  +	 */
>  +	if(pkg->noarch && !platformNoarch && strcmp(arch, "noarch")) {
>  +	    addMacro(NULL, "_target_cpu", NULL, "noarch", RMIL_RPMRC);
>  +	    platformNoarch = rpmExpand("%{_target_platform}", NULL);
>  +	    addMacro(NULL, "_target_cpu", NULL, arch, RMIL_RPMRC);
>  +	}
>   	he->tag = RPMTAG_PLATFORM;
>   	he->t = RPM_STRING_TYPE;
>  -	he->p.str = platform;
>  +	he->p.str = (pkg->noarch && platformNoarch ? platformNoarch : platform);
>   	he->c = 1;
>   	xx = headerPut(pkg->header, he, 0);
> 
>  @@ -736,6 +746,7 @@
>   			he->p.str);
>   	    he->p.ptr = _free(he->p.ptr);
>   	    platform = _free(platform);
>  +	    platformNoarch = _free(platformNoarch);
>   	    arch = _free(arch);
>   	    os = _free(os);
>   	    spec = freeSpec(spec);
>  @@ -747,6 +758,7 @@
>       }
> 
>       platform = _free(platform);
>  +    platformNoarch = _free(platformNoarch);
>       arch = _free(arch);
>       os = _free(os);
>     }
>  @@ .
>  patch -p0 <<'@@ .'
>  Index: rpm/lib/depends.c
>  ============================================================================
>  $ cvs diff -u -r1.464 -r1.465 depends.c
>  --- rpm/lib/depends.c	29 Dec 2010 22:30:20 -0000	1.464
>  +++ rpm/lib/depends.c	8 Jan 2011 23:07:11 -0000	1.465
>  @@ -593,6 +593,18 @@
>   	    platform = rpmExpand(arch, "-unknown-", os, NULL);
> 
>   	rc = rpmPlatformScore(platform, platpat, nplatpat);
>  +#if defined(RPM_VENDOR_MANDRIVA)
>  +	/*
>  +	 * If no match on platform tag, we'll try again with arch tag
>  +	 * in case platform tag is inconsistent with it, which is the case
>  +	 * for older noarch sub-packages built (mdvbz#61746).
>  +	 */
>  +	if(xx && rc <= 0) {
>  +	    platform = _free(platform);
>  +	    platform = rpmExpand(arch, "-unknown-", os, NULL);
>  +	    rc = rpmPlatformScore(platform, platpat, nplatpat);
>  +	}
>  +#endif
>   	if (rc <= 0) {
>   	    rpmps ps = rpmtsProblems(ts);
>   	    he->tag = RPMTAG_NVRA;
>  @@ .
> ______________________________________________________________________
> RPM Package Manager                                    http://rpm5.org
> CVS Sources Repository                                rpm-cvs@rpm5.org
Received on Sun Jan 9 01:40:23 2011
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.