RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Per Øyvind Karlsen Root: /v/rpm/cvs Email: pkarl...@rpm5.org Module: rpm Date: 09-Jan-2011 00:12:15 Branch: rpm-5_3 Handle: 2011010823121400 Modified files: (Branch: rpm-5_3) 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.3296.2.146+2 -0 rpm/CHANGES 2.143.2.1 +13 -1 rpm/build/parseSpec.c 1.461.2.1 +12 -0 rpm/lib/depends.c ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/CHANGES ============================================================================ $ cvs diff -u -r1.3296.2.145 -r1.3296.2.146 CHANGES --- rpm/CHANGES 8 Jan 2011 20:24:45 -0000 1.3296.2.145 +++ rpm/CHANGES 8 Jan 2011 23:12:14 -0000 1.3296.2.146 @@ -1,4 +1,6 @@ 5.3.7 -> 5.3.8: + - proyvind: fix noarch sub-packages not having it's corresponding platform + tag (mdvbz#61746). - proyvind: lookup3: fix runtime valgrind check and make it local. - proyvind: lookup3: fix valgrind #ifdef and perform runtime check for valgrind in stead. @@ . patch -p0 <<'@@ .' Index: rpm/build/parseSpec.c ============================================================================ $ cvs diff -u -r2.143 -r2.143.2.1 parseSpec.c --- rpm/build/parseSpec.c 6 Mar 2010 03:31:19 -0000 2.143 +++ rpm/build/parseSpec.c 8 Jan 2011 23:12:14 -0000 2.143.2.1 @@ -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.461 -r1.461.2.1 depends.c --- rpm/lib/depends.c 6 Mar 2010 15:31:29 -0000 1.461 +++ rpm/lib/depends.c 8 Jan 2011 23:12:14 -0000 1.461.2.1 @@ -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