RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: rpm/ CHANGES rpm/lib/ query.c rpmgi.c rpminstall.c rpmrollb...

From: Jeff Johnson <jbj@rpm5.org>
Date: Tue 21 Aug 2007 - 05:08:37 CEST
Message-Id: <20070821030837.8DD9134845B@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:08:37
  Branch: HEAD                             Handle: 2007082104083601

  Modified files:
    rpm                     CHANGES system.h
    rpm/lib                 query.c rpmgi.c rpminstall.c rpmrollback.c rpmts.c
                            rpmts.h
    rpm/python              rpmts-py.c

  Log:
    - start marking availablePackages for destruction.
    - make a pass checking rpmts opaqueness.
    - rpmtsGoal() and rpmtsSetGoal() added.

  Summary:
    Revision    Changes     Path
    1.1597      +3  -0      rpm/CHANGES
    2.178       +0  -2      rpm/lib/query.c
    2.33        +8  -8      rpm/lib/rpmgi.c
    1.164       +4  -4      rpm/lib/rpminstall.c
    1.11        +1  -2      rpm/lib/rpmrollback.c
    2.86        +15 -0      rpm/lib/rpmts.c
    2.68        +28 -11     rpm/lib/rpmts.h
    1.69        +13 -7      rpm/python/rpmts-py.c
    2.85        +2  -0      rpm/system.h
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.1596 -r1.1597 CHANGES
  --- rpm/CHANGES	21 Aug 2007 02:14:44 -0000	1.1596
  +++ rpm/CHANGES	21 Aug 2007 03:08:36 -0000	1.1597
  @@ -1,4 +1,7 @@
   4.5 -> 5.0:
  +    - jbj: start marking availablePackages for destruction.
  +    - jbj: make a pass checking rpmts opaqueness.
  +    - jbj: rpmtsGoal() and rpmtsSetGoal() added.
       - jbj: add rpmgiGetFlags() for opaque rpmgi queries.
       - jbj: permit --ftswalk on sign/verify paths. not yet install ...
       - jbj: use ftsOpts from CLI where rpmgi is used.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/query.c
  ============================================================================
  $ cvs diff -u -r2.177 -r2.178 query.c
  --- rpm/lib/query.c	21 Aug 2007 02:14:44 -0000	2.177
  +++ rpm/lib/query.c	21 Aug 2007 03:08:36 -0000	2.178
  @@ -25,8 +25,6 @@
   
   #include "debug.h"
   
  -/*@access rpmgi @*/
  -
   /**
    */
   static void printFileInfo(char * te, const char * name,
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/rpmgi.c
  ============================================================================
  $ cvs diff -u -r2.32 -r2.33 rpmgi.c
  --- rpm/lib/rpmgi.c	21 Aug 2007 02:14:44 -0000	2.32
  +++ rpm/lib/rpmgi.c	21 Aug 2007 03:08:36 -0000	2.33
  @@ -745,21 +745,21 @@
   
   	/* Block access to indices used for depsolving. */
   	if (!(gi->flags & RPMGI_ERASING)) {
  -	    ts->goal = TSM_INSTALL;
  -	    xx = rpmdbBlockDBI(ts->rdb, -RPMDBI_DEPENDS);
  -	    xx = rpmdbBlockDBI(ts->rdb, -RPMTAG_BASENAMES);
  -	    xx = rpmdbBlockDBI(ts->rdb, -RPMTAG_PROVIDENAME);
  +	    rpmtsSetGoal(ts, TSM_INSTALL);
  +	    xx = rpmdbBlockDBI(rpmtsGetRdb(ts), -RPMDBI_DEPENDS);
  +	    xx = rpmdbBlockDBI(rpmtsGetRdb(ts), -RPMTAG_BASENAMES);
  +	    xx = rpmdbBlockDBI(rpmtsGetRdb(ts), -RPMTAG_PROVIDENAME);
   	} else {
  -	    ts->goal = TSM_ERASE;
  +	    rpmtsSetGoal(ts, TSM_ERASE);
   	}
   
   	xx = rpmtsCheck(ts);
   
   	/* Permit access to indices used for depsolving. */
   	if (!(gi->flags & RPMGI_ERASING)) {
  -	    xx = rpmdbBlockDBI(ts->rdb, +RPMTAG_PROVIDENAME);
  -	    xx = rpmdbBlockDBI(ts->rdb, +RPMTAG_BASENAMES);
  -	    xx = rpmdbBlockDBI(ts->rdb, +RPMDBI_DEPENDS);
  +	    xx = rpmdbBlockDBI(rpmtsGetRdb(ts), +RPMTAG_PROVIDENAME);
  +	    xx = rpmdbBlockDBI(rpmtsGetRdb(ts), +RPMTAG_BASENAMES);
  +	    xx = rpmdbBlockDBI(rpmtsGetRdb(ts), +RPMDBI_DEPENDS);
   	}
   
   	/* XXX query/verify will need the glop added to a buffer instead. */
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/rpminstall.c
  ============================================================================
  $ cvs diff -u -r1.163 -r1.164 rpminstall.c
  --- rpm/lib/rpminstall.c	19 Aug 2007 22:07:21 -0000	1.163
  +++ rpm/lib/rpminstall.c	21 Aug 2007 03:08:36 -0000	1.164
  @@ -13,7 +13,7 @@
   #endif
   
   #include "rpmte.h"		/* XXX rpmtsPrint() */
  -#define	_RPMTS_INTERNAL		/* XXX ts->goal, ts->suggests */
  +#define	_RPMTS_INTERNAL		/* XXX ts->suggests */
   #include "rpmts.h"
   
   #include "manifest.h"
  @@ -21,7 +21,7 @@
   #include "rpmgi.h"
   #include "debug.h"
   
  -/*@access rpmts @*/	/* XXX ts->goal */
  +/*@access rpmts @*/	/* XXX ts->suggests */
   
   /*@unchecked@*/
   int rpmcliPackagesTotal = 0;
  @@ -317,7 +317,7 @@
   
       if (argv == NULL) goto exit;
   
  -    ts->goal = TSM_INSTALL;
  +    (void) rpmtsSetGoal(ts, TSM_INSTALL);
       rpmcliPackagesTotal = 0;
   
       if (rpmExpandNumeric("%{?_repackage_all_erasures}"))
  @@ -553,7 +553,7 @@
       }
   #endif
   
  -    ts->goal = TSM_ERASE;
  +    rpmtsSetGoal(ts, TSM_ERASE);
   
       for (arg = argv; *arg; arg++) {
   	rpmdbMatchIterator mi;
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/rpmrollback.c
  ============================================================================
  $ cvs diff -u -r1.10 -r1.11 rpmrollback.c
  --- rpm/lib/rpmrollback.c	19 Aug 2007 15:26:12 -0000	1.10
  +++ rpm/lib/rpmrollback.c	21 Aug 2007 03:08:36 -0000	1.11
  @@ -12,7 +12,7 @@
   
   #define	_RPMTE_INTERNAL		/* XXX findErases needs rpmte internals. */
   #include "rpmte.h"		/* XXX: rpmteChain */
  -#define	_RPMTS_INTERNAL		/* ts->goal, ts->dbmode, ts->suggests */
  +#define	_RPMTS_INTERNAL		/* XXX ts->teErase, ts->probs */
   #include "rpmts.h"
   
   #include "manifest.h"
  @@ -20,7 +20,6 @@
   #include "rpmgi.h"		/* XXX rpmgiEscapeSpaces */
   #include "debug.h"
   
  -/*@access rpmts @*/	/* XXX ts->goal, ts->dbmode */
   /*@access rpmte @*/	/* XXX p->hdrid, p->pkgid, p->NEVRA */
   /*@access IDTX @*/
   /*@access IDT @*/
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/rpmts.c
  ============================================================================
  $ cvs diff -u -r2.85 -r2.86 rpmts.c
  --- rpm/lib/rpmts.c	19 Aug 2007 21:12:23 -0000	2.85
  +++ rpm/lib/rpmts.c	21 Aug 2007 03:08:36 -0000	2.86
  @@ -1449,6 +1449,21 @@
       return orelocateElement;
   }
   
  +tsmStage rpmtsGoal(rpmts ts)
  +{
  +    return (ts != NULL ? ts->goal : TSM_UNKNOWN);
  +}
  +
  +tsmStage rpmtsSetGoal(rpmts ts, tsmStage goal)
  +{
  +    tsmStage ogoal = TSM_UNKNOWN;
  +    if (ts != NULL) {
  +	ogoal = ts->goal;
  +	ts->goal = goal;
  +    }
  +    return ogoal;
  +}
  +
   uint_32 rpmtsColor(rpmts ts)
   {
       return (ts != NULL ? ts->color : 0);
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/rpmts.h
  ============================================================================
  $ cvs diff -u -r2.67 -r2.68 rpmts.h
  --- rpm/lib/rpmts.h	19 Aug 2007 19:45:46 -0000	2.67
  +++ rpm/lib/rpmts.h	21 Aug 2007 03:08:36 -0000	2.68
  @@ -19,7 +19,7 @@
   extern int _fps_debug;
   /*@=exportlocal@*/
   
  -/**
  +/** \ingroup rpmts
    * Bit(s) to control digest and signature verification.
    */
   typedef enum rpmVSFlags_e {
  @@ -39,7 +39,7 @@
       /* bit(s) 20-31 unused */
   } rpmVSFlags;
   
  -/**
  +/** \ingroup rpmts
    * Transaction Types
    */
   typedef enum rpmTSType_e {
  @@ -72,7 +72,7 @@
       RPMVSF_NODSA |		\
       RPMVSF_NORSA )
   
  -/**
  +/** \ingroup rpmts
    * Indices for timestamps.
    */
   typedef	enum rpmtsOpX_e {
  @@ -100,6 +100,14 @@
       RPMTS_OP_MAX		= 20
   } rpmtsOpX;
   
  +/** \ingroup rpmts
  + */
  +typedef enum tsStage_e {
  +    TSM_UNKNOWN		=  0,
  +    TSM_INSTALL		=  7,
  +    TSM_ERASE		=  8,
  +} tsmStage;
  +
   #if defined(_RPMTS_INTERNAL)
   
   #include "rpmhash.h"	/* XXX hashTable */
  @@ -143,14 +151,6 @@
   #define BLOCK_ROUND(size, block) (((size) + (block) - 1) / (block))
   
   /** \ingroup rpmts
  - */
  -typedef enum tsStage_e {
  -    TSM_UNKNOWN		=  0,
  -    TSM_INSTALL		=  7,
  -    TSM_ERASE		=  8,
  -} tsmStage;
  -
  -/** \ingroup rpmts
    * The set of packages to be installed/removed atomically.
    */
   struct rpmts_s {
  @@ -975,6 +975,23 @@
   	/*@modifies ts @*/;
   
   /**
  + * Retrieve goal of transaction set.
  + * @param ts		transaction set
  + * @return		color bits
  + */
  +tsmStage rpmtsGoal(rpmts ts)
  +	/*@*/;
  +
  +/**
  + * Set goal of transaction set.
  + * @param ts		transaction set
  + * @param goal		new goal
  + * @return		previous goal
  + */
  +tsmStage rpmtsSetGoal(rpmts ts, tsmStage goal)
  +	/*@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.68 -r1.69 rpmts-py.c
  --- rpm/python/rpmts-py.c	19 Aug 2007 17:43:04 -0000	1.68
  +++ rpm/python/rpmts-py.c	21 Aug 2007 03:08:37 -0000	1.69
  @@ -20,7 +20,9 @@
   #include "rpmte-py.h"
   #include "spec-py.h"
   
  -#define	_RPMTS_INTERNAL	/* XXX for ts->rdb, ts->availablePackage */
  +#if defined(SUPPORT_AVAILABLE_PACKAGES)
  +#define	_RPMTS_INTERNAL	/* XXX for ts->availablePackage */
  +#endif
   #include "rpmts-py.h"
   
   #include "debug.h"
  @@ -302,6 +304,7 @@
       return NULL;
   }
   
  +#if defined(SUPPORT_AVAILABLE_PACKAGES)
   /**
    * Add package to universe of possible packages to install in transaction set.
    * @param ts		transaction set
  @@ -327,6 +330,7 @@
   fprintf(stderr, "\tAddAvailable(%p) list %p\n", ts, ts->availablePackages);
   
   }
  +#endif
   
   #if Py_TPFLAGS_HAVE_ITER
   /**
  @@ -438,9 +442,11 @@
       } 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 */
  @@ -1402,9 +1408,9 @@
   
       /* XXX If not already opened, open the database O_RDONLY now. */
       /* XXX FIXME: lazy default rdonly open also done by rpmtsInitIterator(). */
  -    if (s->ts->rdb == NULL) {
  +    if (rpmtsGetRdb(s->ts) == NULL) {
   	int rc = rpmtsOpenDB(s->ts, O_RDONLY);
  -	if (rc || s->ts->rdb == NULL) {
  +	if (rc || rpmtsGetRdb(s->ts) == NULL) {
   	    PyErr_SetString(PyExc_TypeError, "rpmdb open failed");
   	    return NULL;
   	}
  @@ -1521,7 +1527,7 @@
   {
   
   if (_rpmts_debug)
  -fprintf(stderr, "%p -- ts %p db %p\n", s, s->ts, s->ts->rdb);
  +fprintf(stderr, "%p -- ts %p db %p\n", s, s->ts, rpmtsGetRdb(s->ts));
       s->ts = rpmtsFree(s->ts);
   
       if (s->scriptFd) Fclose(s->scriptFd);
  @@ -1600,7 +1606,7 @@
   	/*@modifies s @*/
   {
   if (_rpmts_debug)
  -fprintf(stderr, "%p -- ts %p db %p\n", s, s->ts, s->ts->rdb);
  +fprintf(stderr, "%p -- ts %p db %p\n", s, s->ts, rpmtsGetRdb(s->ts));
       s->ts = rpmtsFree(s->ts);
   
       if (s->scriptFd)
  @@ -1640,7 +1646,7 @@
       }
   
   if (_rpmts_debug)
  -fprintf(stderr, "%p ++ ts %p db %p\n", s, s->ts, s->ts->rdb);
  +fprintf(stderr, "%p ++ ts %p db %p\n", s, s->ts, rpmtsGetRdb(s->ts));
   
       return (PyObject *)s;
   }
  @@ -1731,6 +1737,6 @@
       o->tsiFilter = 0;
   
   if (_rpmts_debug)
  -fprintf(stderr, "%p ++ ts %p db %p\n", o, o->ts, o->ts->rdb);
  +fprintf(stderr, "%p ++ ts %p db %p\n", o, o->ts, rpmtsGetRdb(o->ts));
       return o;
   }
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/system.h
  ============================================================================
  $ cvs diff -u -r2.84 -r2.85 system.h
  --- rpm/system.h	17 Aug 2007 18:50:19 -0000	2.84
  +++ rpm/system.h	21 Aug 2007 03:08:36 -0000	2.85
  @@ -723,6 +723,8 @@
   
   #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:08:37 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.