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

  Server: rpm5.org                         Name:   Jeff Johnson
  Root:   /v/rpm/cvs                       Email:  j...@rpm5.org
  Module: rpm                              Date:   10-Dec-2009 21:31:14
  Branch: HEAD                             Handle: 2009121020311301

  Modified files:
    rpm                     CHANGES
    rpm/rpmdb               db3.c

  Log:
    - rpmdb: use network order for all integer secondary keys.

  Summary:
    Revision    Changes     Path
    1.3192      +1  -0      rpm/CHANGES
    1.133       +10 -3      rpm/rpmdb/db3.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.3191 -r1.3192 CHANGES
  --- rpm/CHANGES       9 Dec 2009 20:32:44 -0000       1.3191
  +++ rpm/CHANGES       10 Dec 2009 20:31:13 -0000      1.3192
  @@ -1,5 +1,6 @@
   
   5.2b1 -> 5.3a1
  +    - jbj: rpmdb: use network order for all integer secondary keys.
       - jbj: rpmdb: fold rpmdbMireApply into dbiMireKeys.
       - jbj: rpmmi: optimize NVRA range queries using a *RE stem.
       - jbj: rpmdb: inline rpmdbOpenAll for inplace --rebuilddb. sadly
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmdb/db3.c
  ============================================================================
  $ cvs diff -u -r1.132 -r1.133 db3.c
  --- rpm/rpmdb/db3.c   10 Dec 2009 17:08:42 -0000      1.132
  +++ rpm/rpmdb/db3.c   10 Dec 2009 20:31:14 -0000      1.133
  @@ -1698,6 +1698,7 @@
   _ifill:
       {        uint32_t * _u = he->p.ui32p;
        size_t _ulen = sizeof(*_u);
  +     uint32_t _ube;                  /* XXX network order integer keys */
   
        /* Drop the transaction id usecs field (if present) when indexing. */
        switch (he->tag) {
  @@ -1709,8 +1710,9 @@
            /*...@innerbreak@*/ break;
        }
        if (he->c == 1) {
  +         _ube = _hton_ui(*_u);       /* XXX network order integer keys */
            /* XXX is it worth avoiding the realloc here? */
  -         (void) loadDBT(_r, he->tag, _u, _ulen);
  +         (void) loadDBT(_r, he->tag, &_ube, _ulen);
            break;
        }
        _r->flags = DB_DBT_MULTIPLE | DB_DBT_APPMALLOC;
  @@ -1722,7 +1724,8 @@
            /* Don't add identical (key,val) item to secondary. */
            if (i > 0 && _u[-1] == _u[0])
                continue;
  -         if (!loadDBT(A, he->tag, _u, _ulen))
  +         _ube = _hton_ui(*_u);       /* XXX network order integer keys */
  +         if (!loadDBT(A, he->tag, &_ube, _ulen))
                continue;
            A++;
            _r->size++;
  @@ -1731,7 +1734,10 @@
       case RPM_UINT64_TYPE:
       {   uint64_t * _u = he->p.ui64p;
        size_t _ulen = sizeof(*_u);
  +     uint64_t _ube;                  /* XXX network order integer keys */
  +
        if (he->c == 1) {
  +         _ube = _hton_ul(*_u);       /* XXX network order integer keys */
            /* XXX is it worth avoiding the realloc here? */
            (void) loadDBT(_r, he->tag, _u, _ulen);
            break;
  @@ -1745,7 +1751,8 @@
            /* Don't add identical (key,val) item to secondary. */
            if (i > 0 && _u[-1] == _u[0])
                continue;
  -         if (!loadDBT(A, he->tag, _u, _ulen))
  +         _ube = _hton_ul(*_u);       /* XXX network order integer keys */
  +         if (!loadDBT(A, he->tag, &_ube, _ulen))
                continue;
            A++;
            _r->size++;
  @@ .
______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
CVS Sources Repository                                rpm-cvs@rpm5.org

Reply via email to