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:10:12
  Branch: rpm-5_4                          Handle: 2011010823101001

  Modified files:           (Branch: rpm-5_4)
    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.3501.2.46 +2  -0      rpm/CHANGES
    2.143.4.1   +13 -1      rpm/build/parseSpec.c
    1.461.4.4   +12 -0      rpm/lib/depends.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.3501.2.45 -r1.3501.2.46 CHANGES
  --- rpm/CHANGES       8 Jan 2011 20:23:42 -0000       1.3501.2.45
  +++ rpm/CHANGES       8 Jan 2011 23:10:11 -0000       1.3501.2.46
  @@ -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.
       - 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.4.1 parseSpec.c
  --- rpm/build/parseSpec.c     6 Mar 2010 03:31:19 -0000       2.143
  +++ rpm/build/parseSpec.c     8 Jan 2011 23:10:10 -0000       2.143.4.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.4.3 -r1.461.4.4 depends.c
  --- rpm/lib/depends.c 29 Dec 2010 22:30:51 -0000      1.461.4.3
  +++ rpm/lib/depends.c 8 Jan 2011 23:10:10 -0000       1.461.4.4
  @@ -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

Reply via email to