Kill ts->goal, instead set NOSUGGEST flag on erase
authorPanu Matilainen <pmatilai@redhat.com>
Wed, 31 Oct 2007 08:15:05 +0000 (10:15 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Wed, 31 Oct 2007 08:15:05 +0000 (10:15 +0200)
- it aint quite the same thing but will suffice for now...

lib/rpminstall.c
lib/rpmts.c
lib/rpmts.h

index e2461c0..f1d8719 100644 (file)
@@ -261,7 +261,6 @@ const char * fileURL = NULL;
 
     if (fileArgv == NULL) goto exit;
 
-    ts->goal = TSM_INSTALL;
     rpmcliPackagesTotal = 0;
 
     if (rpmExpandNumeric("%{?_repackage_all_erasures}"))
@@ -715,6 +714,9 @@ int rpmErase(rpmts ts, struct rpmInstallArguments_s * ia,
     if (rpmExpandNumeric("%{?_repackage_all_erasures}"))
        ia->transFlags |= RPMTRANS_FLAG_REPACKAGE;
 
+    /* XXX suggest mechanism only meaningful when installing */
+    ia->transFlags |= RPMTRANS_FLAG_NOSUGGEST;
+
     (void) rpmtsSetFlags(ts, ia->transFlags);
 
 #ifdef NOTYET  /* XXX no callbacks on erase yet */
@@ -725,8 +727,6 @@ int rpmErase(rpmts ts, struct rpmInstallArguments_s * ia,
     }
 #endif
 
-    ts->goal = TSM_ERASE;
-
     for (arg = argv; *arg; arg++) {
        rpmdbMatchIterator mi;
 
index 8e5eba7..67c1c15 100644 (file)
@@ -664,10 +664,6 @@ int rpmtsSolve(rpmts ts, rpmds ds, const void * data)
     int rc = 1;        /* assume not found */
     int xx;
 
-    /* Make suggestions only for install Requires: */
-    if (ts->goal != TSM_INSTALL)
-       return rc;
-
     if (rpmdsTagN(ds) != RPMTAG_REQUIRENAME)
        return rc;
 
@@ -1575,7 +1571,6 @@ rpmts rpmtsCreate(void)
     memset(&ts->ops, 0, sizeof(ts->ops));
     (void) rpmswEnter(rpmtsOp(ts, RPMTS_OP_TOTAL), -1);
     ts->type = RPMTRANS_TYPE_NORMAL;
-    ts->goal = TSM_UNKNOWN;
     ts->filesystemCount = 0;
     ts->filesystems = NULL;
     ts->dsi = NULL;
index 4a4108c..2244e51 100644 (file)
@@ -128,19 +128,10 @@ struct diskspaceInfo_s {
 #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 {
     rpmtransFlags transFlags;  /*!< Bit(s) to control operation. */
-    tsmStage goal;             /*!< Transaction goal (i.e. mode) */
     rpmtsType type;             /*!< default, rollback, autorollback */
 
     rpmdb sdb;                 /*!< Solve database handle. */