Under #ifdef RPM_VENDOR_MANDRIVA please.

The problem you are trying to solve is with aliasing
for a package identifier, which sometimes has
Distepoch: and sometimes does not?

If so the patch is mostly in the right place, but a "real"
solution will be to decide on convention(s) for
        RPMTAG_NAME             this is used solely for identification
        RPMTAG_PROVIDENAME      this is used solely for assertions
What is confusing is that those two usage cases have exactly the same string
values, and adding Distepoch: has confused matters a bit (not in an important 
way).

The convention(s) (that need to be finalized) are implemented
when RPMTAG_PROVIDENAME is added to a header, not here, where
you are essentially substituting one alias for the other
where the real need (imho) is to split "identification" <-> "assertion"
name spaces cleanly.

Gud enuf for now, and until there's clarity on Distepoch: conventions.

73 de Jeff

On Mar 6, 2011, at 9:09 AM, 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:  pkarl...@rpm5.org
>  Module: rpm                              Date:   06-Mar-2011 15:09:30
>  Branch: HEAD                             Handle: 2011030614092900
> 
>  Modified files:
>    rpm                     CHANGES
>    rpm/build               reqprov.c
> 
>  Log:
>    check whether provides are duplicate of package first
> 
>  Summary:
>    Revision    Changes     Path
>    1.3567      +2  -0      rpm/CHANGES
>    1.92        +18 -0      rpm/build/reqprov.c
>  ____________________________________________________________________________
> 
>  patch -p0 <<'@@ .'
>  Index: rpm/CHANGES
>  ============================================================================
>  $ cvs diff -u -r1.3566 -r1.3567 CHANGES
>  --- rpm/CHANGES      5 Mar 2011 17:30:51 -0000       1.3566
>  +++ rpm/CHANGES      6 Mar 2011 14:09:29 -0000       1.3567
>  @@ -1,4 +1,6 @@
>   5.4.0 -> 5.4.1:
>  +    - proyvind: check whether provides are duplicate of package first 
> (without
>  +    distepoch), also ensures that package is always at end of 
> %provideversion.
>       - jbj: add "| cpio -dim" to the rpm2cpio.8 examples.
>       - jbj: i18n: update fi.po files (Translation Project).
>       - proyvind: use expanded %{___NVRA} for 'rpm --last'.
>  @@ .
>  patch -p0 <<'@@ .'
>  Index: rpm/build/reqprov.c
>  ============================================================================
>  $ cvs diff -u -r1.91 -r1.92 reqprov.c
>  --- rpm/build/reqprov.c      18 Oct 2010 07:03:46 -0000      1.91
>  +++ rpm/build/reqprov.c      6 Mar 2011 14:09:29 -0000       1.92
>  @@ -56,6 +56,24 @@
> 
>       if (EVR == NULL)
>       EVR = "";
>  +    /* Check that provide isn't duplicate of package */
>  +    else if (nametag == RPMTAG_PROVIDENAME) {
>  +    const char *pName,
>  +          *pEVR;
>  +    int duplicate;
>  +
>  +    he->tag = RPMTAG_NAME;
>  +    xx = headerGet(h, he, 0);
>  +    pName = he->p.str;
>  +    pEVR = headerSprintf(h, "%|EPOCH?{%{EPOCH}:}|%{VERSION}-%{RELEASE}", 
> NULL, NULL, NULL);
>  +    duplicate = !strcmp(pName, N) && !strcmp(pEVR, EVR);
>  +
>  +    _free(pName);
>  +    _free(pEVR);
>  +
>  +    if (duplicate)
>  +        return 0;
>  +    }
> 
>       /* Check for duplicate dependencies. */
>       he->tag = nametag;
>  @@ .
> ______________________________________________________________________
> RPM Package Manager                                    http://rpm5.org
> CVS Sources Repository                                rpm-...@rpm5.org

______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
Developer Communication List                        rpm-devel@rpm5.org

Reply via email to