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:   16-Mar-2011 16:24:07
  Branch: rpm-5_4                          Handle: 2011031615240600

  Modified files:           (Branch: rpm-5_4)
    rpm/build               reqprov.c

  Log:
    get %{NAME} in same call to headerSprintf()

  Summary:
    Revision    Changes     Path
    1.91.2.3    +6  -9      rpm/build/reqprov.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/build/reqprov.c
  ============================================================================
  $ cvs diff -u -r1.91.2.2 -r1.91.2.3 reqprov.c
  --- rpm/build/reqprov.c       16 Mar 2011 14:57:20 -0000      1.91.2.2
  +++ rpm/build/reqprov.c       16 Mar 2011 15:24:06 -0000      1.91.2.3
  @@ -59,18 +59,15 @@
   #if defined(RPM_VENDOR_MANDRIVA)
       /* Check that provide isn't duplicate of package */
       else if (nametag == RPMTAG_PROVIDENAME) {
  -     const char *pName,
  -           *pEVR;
  +     const char *NEVR;
  +     size_t len;
        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);
  +     len = strlen(N);
  +     NEVR = headerSprintf(h, 
"%{NAME}-%|EPOCH?{%{EPOCH}:}|%{VERSION}-%{RELEASE}", NULL, NULL, NULL);
  +     duplicate = !strncmp(NEVR, N, len) && !strcmp(NEVR+len+1, EVR);
   
  -     _free(pName);
  -     _free(pEVR);
  +     _free(NEVR);
   
        if (duplicate)
            return 0;
  @@ .
______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
CVS Sources Repository                                rpm-cvs@rpm5.org

Reply via email to