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);
{}
- 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);
{
str << (obj.isInstalled() ? "I" : "U");
- str << (obj.isEstablishedUneeded() ? "U" :
- ( obj.isEstablishedSatisfied() ? "S" :
- ( obj.isEstablishedIncomplete() ? "I" : "_") ) );
-
str << (obj.transacts () ? "T"
: (obj.isLocked() ? "L" : "_") );
/** 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
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;
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,
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 ); }
//------------------------------------------------------------------------
// *** 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;
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 ); }
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,
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);