ref: refs/heads/master
commit f01ad3b30ec3230b74daa1612068a30250a5b0d4
Author: Michael Andres
Date: Wed Jul 8 14:12:40 2009 +0200
Deprecate and cleanup use of obsolete UpgradeStatistics as arg to Resolver::doUpgrade
---
zypp/Resolver.cc | 5 ++---
zypp/Resolver.h | 19 ++++++++-----------
zypp/UpgradeStatistics.h | 9 +++++++--
zypp/solver/detail/Resolver.h | 5 +----
zypp/solver/detail/ResolverUpgrade.cc | 30 ++++++------------------------
5 files changed, 24 insertions(+), 44 deletions(-)
diff --git a/zypp/Resolver.cc b/zypp/Resolver.cc
index 055dcc1..2cdb175 100644
--- a/zypp/Resolver.cc
+++ b/zypp/Resolver.cc
@@ -14,7 +14,6 @@
#include "zypp/Resolver.h"
#include "zypp/ZConfig.h"
#include "zypp/TriBool.h"
-#include "zypp/UpgradeStatistics.h"
#include "zypp/solver/detail/Resolver.h"
#include "zypp/solver/detail/Testcase.h"
@@ -69,8 +68,8 @@ namespace zypp
void Resolver::applySolutions( const ProblemSolutionList & solutions )
{ _pimpl->applySolutions (solutions); }
- bool Resolver::doUpgrade( UpgradeStatistics & opt_stats_r )
- { return _pimpl->doUpgrade(opt_stats_r); }
+ bool Resolver::doUpgrade()
+ { return _pimpl->doUpgrade(); }
void Resolver::doUpdate()
{ _pimpl->doUpdate(); }
diff --git a/zypp/Resolver.h b/zypp/Resolver.h
index 4b422ed..24ca3cd 100644
--- a/zypp/Resolver.h
+++ b/zypp/Resolver.h
@@ -112,18 +112,15 @@ namespace zypp
/**
* Do an distribution upgrade
*
- * This will run a full upgrade on the pool, taking all upgrade
- * dependencies (provide/obsolete for package renames, split-
- * provides, etc.) into account and actually removing installed
- * packages if no upgrade exists AND the package dependency is
- * broken
- *
- * To be run with great caution. It basically brings your
- * system 'back to start'.
- * Quite helpful to get back to a 'sane state'. Quite disastrous
- * since you'll loose all non-distribution packages
+ * Perform a distribution upgrade. This performs an update of
+ * all packages with a special resolver algorithm which takes
+ * care of package splits, pattern and product updates,
+ * etc.
**/
- bool doUpgrade( UpgradeStatistics & opt_stats_r );
+ bool doUpgrade();
+ /** \deprecated The UpgradeStatistics argument is a meanwhile useless relict of pre-satsolver days. */
+ ZYPP_DEPRECATED bool doUpgrade( UpgradeStatistics & )
+ { return doUpgrade(); }
/**
* Update to newest package
diff --git a/zypp/UpgradeStatistics.h b/zypp/UpgradeStatistics.h
index 0d21d23..9996c3f 100644
--- a/zypp/UpgradeStatistics.h
+++ b/zypp/UpgradeStatistics.h
@@ -27,11 +27,14 @@
#ifndef ZYPP_UPGRADESTATISTICS_H
#define ZYPP_UPGRADESTATISTICS_H
+#warning This include and the classes declared inside are depreceated.
#include <iosfwd>
#include <list>
#include <string>
+#include "zypp/base/Deprecated.h"
+
/////////////////////////////////////////////////////////////////////////
namespace zypp
{ ///////////////////////////////////////////////////////////////////////
@@ -42,7 +45,7 @@ namespace zypp
/**
* @short Struct for update options
**/
-class UpgradeOptions {
+class ZYPP_DEPRECATED UpgradeOptions {
public:
@@ -73,8 +76,10 @@ class UpgradeOptions {
// CLASS NAME : UpgradeStatistics
/**
* @short Struct for update options, statistics, and result lists.
+ *
+ * \deprecated
**/
-class UpgradeStatistics : public UpgradeOptions {
+class ZYPP_DEPRECATED UpgradeStatistics : public UpgradeOptions {
virtual std::ostream & dumpOn( std::ostream & str ) const;
friend std::ostream & operator<<( std::ostream & str, const UpgradeStatistics & obj )
diff --git a/zypp/solver/detail/Resolver.h b/zypp/solver/detail/Resolver.h
index 0b8836a..bbc8395 100644
--- a/zypp/solver/detail/Resolver.h
+++ b/zypp/solver/detail/Resolver.h
@@ -40,7 +40,6 @@
#include "zypp/ProblemTypes.h"
#include "zypp/ResolverProblem.h"
#include "zypp/ProblemSolution.h"
-#include "zypp/UpgradeStatistics.h"
#include "zypp/Capabilities.h"
#include "zypp/Capability.h"
@@ -57,7 +56,6 @@ namespace zypp
class SATResolver;
-
///////////////////////////////////////////////////////////////////
//
// CLASS NAME : ItemCapKind
@@ -94,7 +92,6 @@ class Resolver : public base::ReferenceCounted, private base::NonCopyable {
ResPool _pool;
SATResolver *_satResolver;
SerialNumberWatcher _poolchanged;
- bool _testing;
CapabilitySet _extra_requires;
CapabilitySet _extra_conflicts;
@@ -174,7 +171,7 @@ class Resolver : public base::ReferenceCounted, private base::NonCopyable {
bool resolveQueue( SolverQueueItemList & queue );
void doUpdate();
- bool doUpgrade( zypp::UpgradeStatistics & opt_stats_r );
+ bool doUpgrade();
PoolItemList problematicUpdateItems() const;
/** \name Solver flags */
diff --git a/zypp/solver/detail/ResolverUpgrade.cc b/zypp/solver/detail/ResolverUpgrade.cc
index e0b9ffc..db0f251 100644
--- a/zypp/solver/detail/ResolverUpgrade.cc
+++ b/zypp/solver/detail/ResolverUpgrade.cc
@@ -62,38 +62,20 @@ using namespace zypp;
// and set the SAT solver in update mode
//
bool
-Resolver::doUpgrade( UpgradeStatistics & opt_stats_r )
+Resolver::doUpgrade()
{
Target_Ptr target( getZYpp()->getTarget() );
if ( ! target )
{
ERR << "Huh, no target ?" << endl;
- if (!_testing)
- return false; // can't continue without target
- MIL << "Running in test mode, continuing without target" << endl;
- }
- MIL << "target at " << target << endl;
-
- MIL << "doUpgrade start... "
- << "(silent_downgrades:" << (opt_stats_r.silent_downgrades?"yes":"no") << ")"
- << endl;
+ return false; // can't continue without target
+ }
// create a testcase for the updating system
- PathInfo path ("/mnt/var/log"); // checking if update has been started from instsys
std::string now( Date::now().form( "-%Y-%m-%d-%H-%M-%S" ) );
- if ( !path.isExist() ) {
- Testcase testcase("/var/log/updateTestcase"+now);
- testcase.createTestcase (*this, true, false); // create pool, do not solve
- } else {
- Testcase testcase("/mnt/var/log/updateTestcase"+now);
- testcase.createTestcase (*this, true, false); // create pool, do not solve
- }
-
- {
- UpgradeOptions opts( opt_stats_r );
- opt_stats_r = UpgradeStatistics();
- (UpgradeOptions&)opt_stats_r = opts;
- }
+ Pathname path ( target->assertRootPrefix("/var/log/updateTestcase"+now) );
+ Testcase testcase( path.asString() );
+ testcase.createTestcase (*this, true, false); // create pool, do not solve
// Setting Resolver to upgrade mode. SAT solver will do the update
_upgradeMode = true;
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org