RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: rpm/ CHANGES rpm/lib/ librpm.vers rpmts.c rpmts.h rpm/pytho...

From: Jeff Johnson <jbj@rpm5.org>
Date: Tue 21 Aug 2007 - 05:41:52 CEST
Message-Id: <20070821034152.C27B834845B@rpm5.org>
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Jeff Johnson
  Root:   /v/rpm/cvs                       Email:  jbj@rpm5.org
  Module: rpm                              Date:   21-Aug-2007 05:41:52
  Branch: HEAD                             Handle: 2007082104415101

  Modified files:
    rpm                     CHANGES system.h
    rpm/lib                 librpm.vers rpmts.c rpmts.h
    rpm/python              rpmts-py.c

  Log:
    - start ripping availablePackages.
    - rpmtsDbmode() and rpmtsSetDbmode() added for rpmts-py.c opaqueness.

  Summary:
    Revision    Changes     Path
    1.1598      +2  -0      rpm/CHANGES
    1.10        +4  -0      rpm/lib/librpm.vers
    2.87        +15 -0      rpm/lib/rpmts.c
    2.69        +18 -1      rpm/lib/rpmts.h
    1.70        +5  -44     rpm/python/rpmts-py.c
    2.86        +0  -2      rpm/system.h
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.1597 -r1.1598 CHANGES
  --- rpm/CHANGES	21 Aug 2007 03:08:36 -0000	1.1597
  +++ rpm/CHANGES	21 Aug 2007 03:41:51 -0000	1.1598
  @@ -1,4 +1,6 @@
   4.5 -> 5.0:
  +    - jbj: start ripping availablePackages.
  +    - jbj: rpmtsDbmode() and rpmtsSetDbmode() added for rpmts-py.c opaqueness.
       - jbj: start marking availablePackages for destruction.
       - jbj: make a pass checking rpmts opaqueness.
       - jbj: rpmtsGoal() and rpmtsSetGoal() added.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/librpm.vers
  ============================================================================
  $ cvs diff -u -r1.9 -r1.10 librpm.vers
  --- rpm/lib/librpm.vers	19 Aug 2007 15:26:12 -0000	1.9
  +++ rpm/lib/librpm.vers	21 Aug 2007 03:41:52 -0000	1.10
  @@ -346,6 +346,7 @@
       rpmtsCreate;
       rpmtsCurrDir;
       _rpmts_debug;
  +    rpmtsDbmode;
       rpmtsDFlags;
       rpmtsDig;
       rpmtsDoARBGoal;
  @@ -359,6 +360,7 @@
       rpmtsGetRdb;
       rpmtsGetTid;
       rpmtsGetType;
  +    rpmtsGoal;
       rpmtsiNext;
       rpmtsInitDB;
       rpmtsInitDSI;
  @@ -383,8 +385,10 @@
       rpmtsSetChrootDone;
       rpmtsSetColor;
       rpmtsSetCurrDir;
  +    rpmtsSetDbmode;
       rpmtsSetDFlags;
       rpmtsSetFlags;
  +    rpmtsSetGoal;
       rpmtsSetNotifyCallback;
       rpmtsSetREContext;
       rpmtsSetRelocateElement;
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/rpmts.c
  ============================================================================
  $ cvs diff -u -r2.86 -r2.87 rpmts.c
  --- rpm/lib/rpmts.c	21 Aug 2007 03:08:36 -0000	2.86
  +++ rpm/lib/rpmts.c	21 Aug 2007 03:41:52 -0000	2.87
  @@ -1464,6 +1464,21 @@
       return ogoal;
   }
   
  +int rpmtsDbmode(rpmts ts)
  +{
  +    return (ts != NULL ? ts->dbmode : 0);
  +}
  +
  +int rpmtsSetDbmode(rpmts ts, int dbmode)
  +{
  +    int odbmode = 0;
  +    if (ts != NULL) {
  +	odbmode = ts->dbmode;
  +	ts->dbmode = dbmode;
  +    }
  +    return odbmode;
  +}
  +
   uint_32 rpmtsColor(rpmts ts)
   {
       return (ts != NULL ? ts->color : 0);
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/rpmts.h
  ============================================================================
  $ cvs diff -u -r2.68 -r2.69 rpmts.h
  --- rpm/lib/rpmts.h	21 Aug 2007 03:08:36 -0000	2.68
  +++ rpm/lib/rpmts.h	21 Aug 2007 03:41:52 -0000	2.69
  @@ -977,7 +977,7 @@
   /**
    * Retrieve goal of transaction set.
    * @param ts		transaction set
  - * @return		color bits
  + * @return		goal
    */
   tsmStage rpmtsGoal(rpmts ts)
   	/*@*/;
  @@ -992,6 +992,23 @@
   	/*@modifies ts @*/;
   
   /**
  + * Retrieve dbmode of transaction set.
  + * @param ts		transaction set
  + * @return		dbmode
  + */
  +int rpmtsDbmode(rpmts ts)
  +	/*@*/;
  +
  +/**
  + * Set dbmode of transaction set.
  + * @param ts		transaction set
  + * @param dbmode	new dbmode
  + * @return		previous dbmode
  + */
  +int rpmtsSetDbmode(rpmts ts, int dbmode)
  +	/*@modifies ts @*/;
  +
  +/**
    * Retrieve color bits of transaction set.
    * @param ts		transaction set
    * @return		color bits
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/python/rpmts-py.c
  ============================================================================
  $ cvs diff -u -r1.69 -r1.70 rpmts-py.c
  --- rpm/python/rpmts-py.c	21 Aug 2007 03:08:37 -0000	1.69
  +++ rpm/python/rpmts-py.c	21 Aug 2007 03:41:52 -0000	1.70
  @@ -20,9 +20,6 @@
   #include "rpmte-py.h"
   #include "spec-py.h"
   
  -#if defined(SUPPORT_AVAILABLE_PACKAGES)
  -#define	_RPMTS_INTERNAL	/* XXX for ts->availablePackage */
  -#endif
   #include "rpmts-py.h"
   
   #include "debug.h"
  @@ -304,34 +301,6 @@
       return NULL;
   }
   
  -#if defined(SUPPORT_AVAILABLE_PACKAGES)
  -/**
  - * Add package to universe of possible packages to install in transaction set.
  - * @param ts		transaction set
  - * @param h		header
  - * @param key		package private data
  - */
  -static void rpmtsAddAvailableElement(rpmts ts, Header h,
  -		/*@exposed@*/ /*@null@*/ fnpyKey key)
  -	/*@globals rpmGlobalMacroContext @*/
  -	/*@modifies h, ts, rpmGlobalMacroContext @*/
  -{
  -    int scareMem = 0;
  -    rpmds provides = rpmdsNew(h, RPMTAG_PROVIDENAME, scareMem);
  -    rpmfi fi = rpmfiNew(ts, h, RPMTAG_BASENAMES, scareMem);
  -
  -    /* XXX FIXME: return code RPMAL_NOMATCH is error */
  -    (void) rpmalAdd(&ts->availablePackages, RPMAL_NOMATCH, key,
  -		provides, fi, rpmtsColor(ts));
  -    fi = rpmfiFree(fi);
  -    provides = rpmdsFree(provides);
  -
  -if (_rpmts_debug < 0)
  -fprintf(stderr, "\tAddAvailable(%p) list %p\n", ts, ts->availablePackages);
  -
  -}
  -#endif
  -
   #if Py_TPFLAGS_HAVE_ITER
   /**
    */
  @@ -442,11 +411,6 @@
       } else if (how && !strcmp(how, "u"))
       	isUpgrade = 1;
   
  -#if defined(SUPPORT_AVAILABLE_PACKAGES)
  -    if (how && !strcmp(how, "a"))
  -	rpmtsAddAvailableElement(s->ts, hdrGetHeader(h), key);
  -    else
  -#endif
   	rpmtsAddInstallElement(s->ts, hdrGetHeader(h), key, isUpgrade, NULL);
   
       /* This should increment the usage count for me */
  @@ -557,9 +521,6 @@
       cbInfo.pythonError = 0;
       cbInfo._save = PyEval_SaveThread();
   
  -    /* XXX resurrect availablePackages one more time ... */
  -    rpmalMakeIndex(s->ts->availablePackages);
  -
       xx = rpmtsCheck(s->ts);
       ps = rpmtsProblems(s->ts);
   
  @@ -833,10 +794,10 @@
   if (_rpmts_debug)
   fprintf(stderr, "*** rpmts_OpenDB(%p) ts %p\n", s, s->ts);
   
  -    if (s->ts->dbmode == -1)
  -	s->ts->dbmode = O_RDONLY;
  +    if (rpmtsDbmode(s->ts) == -1)
  +	(void) rpmtsSetDbmode(s->ts, O_RDONLY);
   
  -    return Py_BuildValue("i", rpmtsOpenDB(s->ts, s->ts->dbmode));
  +    return Py_BuildValue("i", rpmtsOpenDB(s->ts, rpmtsDbmode(s->ts)));
   }
   
   /**
  @@ -852,7 +813,7 @@
   fprintf(stderr, "*** rpmts_CloseDB(%p) ts %p\n", s, s->ts);
   
       rc = rpmtsCloseDB(s->ts);
  -    s->ts->dbmode = -1;		/* XXX disable lazy opens */
  +    (void) rpmtsSetDbmode(s->ts, -1);		/* XXX disable lazy opens */
   
       return Py_BuildValue("i", rc);
   }
  @@ -1259,7 +1220,7 @@
       }
   
       /* Initialize security context patterns (if not already done). */
  -    if (!(s->ts->transFlags & RPMTRANS_FLAG_NOCONTEXTS)) {
  +    if (!(rpmtsFlags(s->ts) & RPMTRANS_FLAG_NOCONTEXTS)) {
   	    const char *fn = rpmGetPath("%{?_install_file_context_path}", NULL);
   	if (fn != NULL && *fn != '\0')
   	    rc = matchpathcon_init(fn);
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/system.h
  ============================================================================
  $ cvs diff -u -r2.85 -r2.86 system.h
  --- rpm/system.h	21 Aug 2007 03:08:36 -0000	2.85
  +++ rpm/system.h	21 Aug 2007 03:41:51 -0000	2.86
  @@ -723,8 +723,6 @@
   
   #define	SUPPORT_RPMLEAD		0	/* XXX default is add lead. */
   
  -#define	SUPPORT_AVAILABLE_PACKAGES	1
  -
   /**
    * Turn off pgp/pgp5 signing (hasn't been looked at seriously for years).
    */
  @@ .
Received on Tue Aug 21 05:41:52 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.