namespace zypp
{ /////////////////////////////////////////////////////////////////
- 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::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);
const ResStatus ResStatus::uninstalled (UNINSTALLED);
{}
- ResStatus::ResStatus (enum StateValue s, enum TransactValue t, enum InstallDetailValue i, enum RemoveDetailValue r, enum SolverStateValue ssv)
+ ResStatus::ResStatus (enum StateValue s, enum ValidateValue v, enum TransactValue t, enum InstallDetailValue i, enum RemoveDetailValue r, enum SolverStateValue ssv)
: _bitfield (s)
{
+ fieldValueAssign<ValidateField>(v);
fieldValueAssign<TransactField>(t);
if (t == TRANSACT) {
if (s == INSTALLED) fieldValueAssign<TransactDetailField>(r);
{
str << (obj.isInstalled() ? "I" : "U");
+ str << (obj.isBroken() ? "B" :
+ ( obj.isSatisfied() ? "S" :
+ ( obj.isNonRelevant() ? "N" : "_") ) );
+
str << (obj.transacts () ? "T"
: (obj.isLocked() ? "L" : "_") );
/** Status bitfield.
*
* \li \c StateField Whether the resolvable is or uninstalled (available).
+ * \li \c ValidateField Validate status computed by the solver as
+ * nonrelevant: it is unimportant for the user
+ * satisfied: it important nothing has to be done
+ * broken: it is incomplete. So e.g. an update is needed
* \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> TransactField;
+ typedef bit::Range<FieldType,StateField::end, 2> ValidateField;
+ typedef bit::Range<FieldType,ValidateField::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 ValidateValue
+ {
+ UNDETERMINED = bit::RangeValue<ValidateField,0>::value,
+ BROKEN = bit::RangeValue<ValidateField,1>::value,
+ SATISFIED = bit::RangeValue<ValidateField,2>::value,
+ NONRELEVANT = bit::RangeValue<ValidateField,3>::value
+ };
enum TransactValue
{
KEEP_STATE = bit::RangeValue<TransactField,0>::value,
fieldValueAssign<WeakField>( toVal_r ? SUGGESTED : NO_WEAK );
}
+ bool isUndetermined() const
+ { return fieldValueIs<ValidateField>( UNDETERMINED ); }
+
+ bool isSatisfied() const
+ { return fieldValueIs<ValidateField>( SATISFIED ); }
+
+ bool isBroken() const
+ { return fieldValueIs<ValidateField>( BROKEN ); }
+
+ bool isNonRelevant() const
+ { return fieldValueIs<ValidateField>( NONRELEVANT ); }
+
public:
// These two are IMMUTABLE!
return true;
}
+ bool setUndetermined ()
+ {
+ fieldValueAssign<ValidateField>(UNDETERMINED);
+ return true;
+ }
+
+ bool setSatisfied ()
+ {
+ fieldValueAssign<ValidateField>(SATISFIED);
+ return true;
+ }
+
+ bool setBroken ()
+ {
+ fieldValueAssign<ValidateField>(BROKEN);
+ return true;
+ }
+
+ bool setNonRelevant ()
+ {
+ fieldValueAssign<ValidateField>(NONRELEVANT);
+ return true;
+ }
+
bool isSeen () const
{ return fieldValueIs<SolverStateField>( SEEN ); }
private:
/** Ctor for intialization of builtin constants. */
ResStatus( StateValue s,
+ ValidateValue v = UNDETERMINED,
TransactValue t = KEEP_STATE,
InstallDetailValue i = EXPLICIT_INSTALL,
RemoveDetailValue r = EXPLICIT_REMOVE,