RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Jeff Johnson
  Root:   /v/rpm/cvs                       Email:  [email protected]
  Module: rpm                              Date:   01-Jan-2009 22:30:25
  Branch: HEAD                             Handle: 2009010121302500

  Modified files:
    rpm                     CHANGES
    rpm/rpmdb               rpmevr.c

  Log:
    - jbj: EVRtuple: wire up evr_tuple_match RE pattern match.

  Summary:
    Revision    Changes     Path
    1.2721      +1  -0      rpm/CHANGES
    1.22        +38 -0      rpm/rpmdb/rpmevr.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.2720 -r1.2721 CHANGES
  --- rpm/CHANGES       1 Jan 2009 19:29:36 -0000       1.2720
  +++ rpm/CHANGES       1 Jan 2009 21:30:25 -0000       1.2721
  @@ -1,5 +1,6 @@
   
   5.2a2 -> 5.2a3:
  +    - jbj: EVRtuple: wire up evr_tuple_match RE pattern match.
       - jbj: EVRtuple: wire up evr_tuple_order precedence permutation.
       - jbj: EVRtuple: use array for tuple storage.
       - rse: EVRtuple: macro configuration parameterization.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmdb/rpmevr.c
  ============================================================================
  $ cvs diff -u -r1.21 -r1.22 rpmevr.c
  --- rpm/rpmdb/rpmevr.c        1 Jan 2009 19:29:36 -0000       1.21
  +++ rpm/rpmdb/rpmevr.c        1 Jan 2009 21:30:25 -0000       1.22
  @@ -5,6 +5,7 @@
   
   #include <rpmiotypes.h>
   #include <rpmmacro.h>
  +#include <mire.h>
   
   #include <rpmtag.h>
   #define      _RPMEVR_INTERNAL
  @@ -107,6 +108,30 @@
       return rc;
   }
   
  +/*...@unchecked@*/ /*...@observer@*/ /*...@null@*/
  +static const char * _evr_tuple_match = 
"i^(?:([^:-]+):)?([^:-]+)(?:-([^:-]+))?(?::([^:-]+))?$";
  +/*...@unchecked@*/ /*...@null@*/
  +static const char * evr_tuple_match = NULL;
  +/*...@unchecked@*/ /*...@null@*/
  +static miRE evr_tuple_mire = NULL;
  +/*...@unchecked@*/
  +static int evr_tuple_nmire;
  +
  +static miRE rpmEVRmire(void)
  +     /*...@*/
  +{
  +    if (evr_tuple_mire == NULL) {
  +     int xx;
  +     evr_tuple_match = rpmExpand("%{?evr_tuple_match}", NULL);
  +     if (evr_tuple_match == NULL || evr_tuple_match[0] == '\0')
  +         evr_tuple_match = xstrdup(_evr_tuple_match);
  +     xx = mireAppend(RPMMIRE_REGEX, 0, evr_tuple_match, NULL,
  +             &evr_tuple_mire, &evr_tuple_nmire);
  +    }
  +assert(evr_tuple_match != NULL && evr_tuple_mire != NULL);
  +    return evr_tuple_mire;
  +}
  +
   int rpmEVRparse(const char * evrstr, EVR_t evr)
        /*...@modifies evrstr, evr @*/
   {
  @@ -154,6 +179,19 @@
       } else {
        evr->F[RPMEVR_R] = NULL;
       }
  +
  +    {        miRE mire = rpmEVRmire();
  +     int noffsets = 4 * 3;
  +     int offsets[4 * 3];
  +     int xx;
  +
  +     memset(offsets, 0, sizeof(offsets));
  +     xx = mireSetEOptions(mire, offsets, noffsets);
  +
  +     xx = mireRegexec(mire, evr->str, strlen(evr->str));
  +
  +     xx = mireSetEOptions(mire, NULL, 0);
  +    }
       return 0;
   }
   
  @@ .
______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
CVS Sources Repository                                [email protected]

Reply via email to