- Moved poolItem.status().isSatisfied(),.... to poolItem.isSatisfied()
authorStefan Schubert <schubi@suse.de>
Wed, 2 Apr 2008 11:48:14 +0000 (11:48 +0000)
committerStefan Schubert <schubi@suse.de>
Wed, 2 Apr 2008 11:48:14 +0000 (11:48 +0000)
- Removed establish state in ResStatus

zypp/ResStatus.cc
zypp/ResStatus.h
zypp/sat/SATResolver.cc

index 5ae71b082a2ba9efb682f760b84316ab8d64c77b..f5aa357a6aad6de0d393b7a215adfa56d7565307 100644 (file)
@@ -20,19 +20,14 @@ using std::endl;
 namespace zypp
 { /////////////////////////////////////////////////////////////////
 
-  const ResStatus ResStatus::toBeInstalled              (UNINSTALLED, UNDETERMINED, TRANSACT);
-  const ResStatus ResStatus::toBeInstalledSoft          (UNINSTALLED, UNDETERMINED, TRANSACT, SOFT_INSTALL);
-  const ResStatus ResStatus::toBeUninstalled            (INSTALLED,   UNDETERMINED, TRANSACT);
-  const ResStatus ResStatus::toBeUninstalledSoft        (INSTALLED,   UNDETERMINED, TRANSACT, EXPLICIT_INSTALL, SOFT_REMOVE);
-  const ResStatus ResStatus::toBeUninstalledDueToObsolete(INSTALLED,   UNDETERMINED, TRANSACT, EXPLICIT_INSTALL, DUE_TO_OBSOLETE);
-  const ResStatus ResStatus::toBeUninstalledDueToUpgrade (INSTALLED,   UNDETERMINED, TRANSACT, EXPLICIT_INSTALL, DUE_TO_UPGRADE);
-  const ResStatus ResStatus::installed                  (INSTALLED,   UNDETERMINED);
-  const ResStatus ResStatus::uninstalled                (UNINSTALLED, UNDETERMINED);
-  const ResStatus ResStatus::incomplete                         (INSTALLED,   INCOMPLETE);
-  const ResStatus ResStatus::complete                   (INSTALLED,   SATISFIED);
-  const ResStatus ResStatus::satisfied                  (UNINSTALLED, SATISFIED);
-  const ResStatus ResStatus::unneeded                   (UNINSTALLED, UNNEEDED);
-  const ResStatus ResStatus::needed                     (UNINSTALLED, INCOMPLETE);
+  const ResStatus ResStatus::toBeInstalled              (UNINSTALLED, TRANSACT);
+  const ResStatus ResStatus::toBeInstalledSoft          (UNINSTALLED, TRANSACT, SOFT_INSTALL);
+  const ResStatus ResStatus::toBeUninstalled            (INSTALLED,   TRANSACT);
+  const ResStatus ResStatus::toBeUninstalledSoft        (INSTALLED,   TRANSACT, EXPLICIT_INSTALL, SOFT_REMOVE);
+  const ResStatus ResStatus::toBeUninstalledDueToObsolete(INSTALLED,   TRANSACT, EXPLICIT_INSTALL, DUE_TO_OBSOLETE);
+  const ResStatus ResStatus::toBeUninstalledDueToUpgrade (INSTALLED,   TRANSACT, EXPLICIT_INSTALL, DUE_TO_UPGRADE);
+  const ResStatus ResStatus::installed                  (INSTALLED);
+  const ResStatus ResStatus::uninstalled                (UNINSTALLED);
   const ResStatus ResStatus::recommended                (RECOMMENDED);
   const ResStatus ResStatus::suggested                  (SUGGESTED);        
 
@@ -62,10 +57,9 @@ namespace zypp
   {}
 
 
-  ResStatus::ResStatus (enum StateValue s, enum EstablishValue e, enum TransactValue t, enum InstallDetailValue i, enum RemoveDetailValue r, enum SolverStateValue ssv)
+  ResStatus::ResStatus (enum StateValue s, enum TransactValue t, enum InstallDetailValue i, enum RemoveDetailValue r, enum SolverStateValue ssv)
     : _bitfield (s)
   {
-    fieldValueAssign<EstablishField>(e);
     fieldValueAssign<TransactField>(t);
     if (t == TRANSACT) {
        if (s == INSTALLED) fieldValueAssign<TransactDetailField>(r);
@@ -86,10 +80,6 @@ namespace zypp
   {
     str << (obj.isInstalled() ? "I" : "U");
 
-    str << (obj.isEstablishedUneeded() ? "U" :
-       ( obj.isEstablishedSatisfied() ? "S" :
-       ( obj.isEstablishedIncomplete() ? "I" : "_") ) );
-
     str << (obj.transacts () ? "T"
                              : (obj.isLocked() ? "L" : "_") );
 
index 2dfb11dd453b17afe8a4feae1dde991700c4fd53..ba340daa272b5812247224c0fa79fcfa4787fc32 100644 (file)
@@ -27,12 +27,6 @@ namespace zypp
   /** Status bitfield.
    *
    * \li \c StateField Whether the resolvable is or uninstalled (available).
-   * \li \c EstablishField Established status computed by the solver as
-   *        unneeded (have freshens but none of them trigger)
-   *       satisfied (no freshen or at least one triggered freshen and
-   *       all requires fulfilled)
-   *       or incomplete (no freshen or at least one triggered freshen and
-   *       NOT all requires fulfilled)
    * \li \c TransactField Wheter to transact this resolvable
    *        (delete if installed install if uninstalled).
    *        In case the resolvable is locked, only USER may modify the
@@ -62,8 +56,7 @@ namespace zypp
     typedef bit::BitField<FieldType> BitFieldType;
     // Bit Ranges within FieldType defined by 1st bit and size:
     typedef bit::Range<FieldType,0,                          1> StateField;
-    typedef bit::Range<FieldType,StateField::end,            2> EstablishField;
-    typedef bit::Range<FieldType,EstablishField::end,        2> TransactField;
+    typedef bit::Range<FieldType,StateField::end,            2> TransactField;
     typedef bit::Range<FieldType,TransactField::end,         2> TransactByField;
     typedef bit::Range<FieldType,TransactByField::end,       2> TransactDetailField;
     typedef bit::Range<FieldType,TransactDetailField::end,   1> SolverStateField;
@@ -86,13 +79,6 @@ namespace zypp
         UNINSTALLED = bit::RangeValue<StateField,0>::value,
         INSTALLED   = bit::RangeValue<StateField,1>::value
       };
-    enum EstablishValue
-      {
-        UNDETERMINED = bit::RangeValue<EstablishField,0>::value,
-        UNNEEDED     = bit::RangeValue<EstablishField,1>::value, // has freshens, none trigger
-        SATISFIED    = bit::RangeValue<EstablishField,2>::value, // has none or triggered freshens, all requirements fulfilled
-        INCOMPLETE   = bit::RangeValue<EstablishField,3>::value         // installed: has none or triggered freshens, requirements unfulfilled
-      };
     enum TransactValue
       {
         KEEP_STATE = bit::RangeValue<TransactField,0>::value,
@@ -222,33 +208,6 @@ namespace zypp
     bool isToBeUninstalled() const
     { return isInstalled() && transacts(); }
 
-    bool isUndetermined() const
-    { return fieldValueIs<EstablishField>( UNDETERMINED ); }
-
-    bool isEstablishedUneeded() const
-    { return fieldValueIs<EstablishField>( UNNEEDED ); }
-
-    bool isEstablishedSatisfied() const
-    { return fieldValueIs<EstablishField>( SATISFIED ); }
-
-    bool isEstablishedIncomplete() const
-    { return fieldValueIs<EstablishField>( INCOMPLETE ); }
-
-    bool isUnneeded() const
-    { return isUninstalled() && fieldValueIs<EstablishField>( UNNEEDED ); }
-
-    bool isSatisfied() const
-    { return isUninstalled() && fieldValueIs<EstablishField>( SATISFIED ); }
-
-    bool isComplete () const
-    { return isInstalled() && fieldValueIs<EstablishField>( SATISFIED ); }
-
-    bool isIncomplete() const
-    { return isInstalled() && fieldValueIs<EstablishField>( INCOMPLETE ); }
-
-    bool isNeeded() const
-    { return isUninstalled() && fieldValueIs<EstablishField>( INCOMPLETE ); }
-
     bool isLocked() const
     { return fieldValueIs<TransactField>( LOCKED ); }
 
@@ -508,14 +467,6 @@ namespace zypp
     //------------------------------------------------------------------------
     // *** These are only for the Resolver ***
 
-    EstablishValue getEstablishValue() const
-    { return (EstablishValue)_bitfield.value<EstablishField>(); }
-      
-    bool setEstablishValue(const EstablishValue &establish) {
-       fieldValueAssign<EstablishField>(establish);
-       return true;
-    }
-
     bool setToBeUninstalledDueToObsolete ( )
     {
       if (!setToBeUninstalled (SOLVER)) return false;
@@ -576,30 +527,6 @@ namespace zypp
        return true;
     }
 
-    bool setUndetermined ()
-    {
-      fieldValueAssign<EstablishField>(UNDETERMINED);
-      return true;
-    }
-
-    bool setUnneeded ()
-    {
-      fieldValueAssign<EstablishField>(UNNEEDED);
-      return true;
-    }
-
-    bool setSatisfied ()
-    {
-      fieldValueAssign<EstablishField>(SATISFIED);
-      return true;
-    }
-
-    bool setIncomplete ()
-    {
-      fieldValueAssign<EstablishField>(INCOMPLETE);
-      return true;
-    }
-
     bool isSeen () const
     { return fieldValueIs<SolverStateField>( SEEN ); }
 
@@ -646,7 +573,6 @@ namespace zypp
   private:
     /** Ctor for intialization of builtin constants. */
     ResStatus( StateValue s,
-               EstablishValue e     = UNDETERMINED,
                TransactValue t      = KEEP_STATE,
                InstallDetailValue i = EXPLICIT_INSTALL,
                RemoveDetailValue r  = EXPLICIT_REMOVE,
index 14df483af5eedb29f53ebc669521ae3ecfcfbac4..a128c8bc76db6c449bb2000098ff55f8508481d0 100644 (file)
@@ -239,19 +239,6 @@ SATSolutionToPool (PoolItem item, const ResStatus & status, const ResStatus::Tra
        r = item.status().setToBeUninstalled (causer);
        _XDEBUG("SATSolutionToPool(" << item << ", " << status << ") remove !" << r);
     }
-    else if (status.isIncomplete()
-            || status.isNeeded()) {
-       r = item.status().setIncomplete();
-       _XDEBUG("SATSolutionToPool(" << item << ", " << status << ") incomplete !" << r);
-    }
-    else if (status.isUnneeded()) {
-       r = item.status().setUnneeded();
-       _XDEBUG("SATSolutionToPool(" << item << ", " << status << ") unneeded !" << r);
-    }
-    else if (status.isSatisfied()) {
-       r = item.status().setSatisfied();
-       _XDEBUG("SATSolutionToPool(" << item << ", " << status << ") satisfied !" << r);
-    }
     else if (status.isRecommended()) {
        item.status().setRecommended(true);
        _XDEBUG("SATSolutionToPool(" << item << ", " << status << ") recommended !" << r);