Mailinglist Archive: zypp-commit (606 mails)

< Previous Next >
[zypp-commit] r9528 - in /trunk/libzypp/zypp: ResStatus.cc ResStatus.h
  • From: schubi2@xxxxxxxxxxxxxxxx
  • Date: Fri, 11 Apr 2008 10:27:21 -0000
  • Message-id: <20080411102721.7EA2E26FC9@xxxxxxxxxxxxxxxx>
Author: schubi2
Date: Fri Apr 11 12:27:21 2008
New Revision: 9528

URL: http://svn.opensuse.org/viewcvs/zypp?rev=9528&view=rev
Log:
added new state VALIDATE in ResStatus

Modified:
trunk/libzypp/zypp/ResStatus.cc
trunk/libzypp/zypp/ResStatus.h

Modified: trunk/libzypp/zypp/ResStatus.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ResStatus.cc?rev=9528&r1=9527&r2=9528&view=diff
==============================================================================
--- trunk/libzypp/zypp/ResStatus.cc (original)
+++ trunk/libzypp/zypp/ResStatus.cc Fri Apr 11 12:27:21 2008
@@ -20,12 +20,12 @@
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);

@@ -55,9 +55,10 @@
{}


- 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);
@@ -78,6 +79,10 @@
{
str << (obj.isInstalled() ? "I" : "U");

+ str << (obj.isBroken() ? "B" :
+ ( obj.isSatisfied() ? "S" :
+ ( obj.isNonRelevant() ? "N" : "_") ) );
+
str << (obj.transacts () ? "T"
: (obj.isLocked() ? "L" : "_") );


Modified: trunk/libzypp/zypp/ResStatus.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ResStatus.h?rev=9528&r1=9527&r2=9528&view=diff
==============================================================================
--- trunk/libzypp/zypp/ResStatus.h (original)
+++ trunk/libzypp/zypp/ResStatus.h Fri Apr 11 12:27:21 2008
@@ -27,6 +27,10 @@
/** 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
@@ -56,7 +60,8 @@
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;
@@ -79,6 +84,13 @@
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,
@@ -181,6 +193,18 @@
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!

@@ -527,6 +551,30 @@
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 ); }

@@ -573,6 +621,7 @@
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,

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages