Mailinglist Archive: zypp-commit (606 mails)

< Previous Next >
[zypp-commit] r9886 - in /trunk/libzypp: ./ zypp/ zypp/solver/detail/
  • From: schubi2@xxxxxxxxxxxxxxxx
  • Date: Tue, 29 Apr 2008 14:37:10 -0000
  • Message-id: <20080429143710.3C4E9260CC@xxxxxxxxxxxxxxxx>
Author: schubi2
Date: Tue Apr 29 16:37:09 2008
New Revision: 9886

URL: http://svn.opensuse.org/viewcvs/zypp?rev=9886&view=rev
Log:
cleanup in return values of doUpgrade and doUpdate

Modified:
trunk/libzypp/VERSION.cmake
trunk/libzypp/zypp/Resolver.cc
trunk/libzypp/zypp/Resolver.h
trunk/libzypp/zypp/solver/detail/Resolver.cc
trunk/libzypp/zypp/solver/detail/Resolver.h
trunk/libzypp/zypp/solver/detail/ResolverUpgrade.cc
trunk/libzypp/zypp/solver/detail/SATResolver.cc
trunk/libzypp/zypp/solver/detail/SATResolver.h

Modified: trunk/libzypp/VERSION.cmake
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/VERSION.cmake?rev=9886&r1=9885&r2=9886&view=diff
==============================================================================
--- trunk/libzypp/VERSION.cmake (original)
+++ trunk/libzypp/VERSION.cmake Tue Apr 29 16:37:09 2008
@@ -45,6 +45,6 @@
#

SET(LIBZYPP_MAJOR "4")
-SET(LIBZYPP_MINOR "16")
-SET(LIBZYPP_COMPATMINOR "14")
+SET(LIBZYPP_MINOR "17")
+SET(LIBZYPP_COMPATMINOR "17")
SET(LIBZYPP_PATCH "0")

Modified: trunk/libzypp/zypp/Resolver.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/Resolver.cc?rev=9886&r1=9885&r2=9886&view=diff
==============================================================================
--- trunk/libzypp/zypp/Resolver.cc (original)
+++ trunk/libzypp/zypp/Resolver.cc Tue Apr 29 16:37:09 2008
@@ -72,8 +72,8 @@
{ return _pimpl->problems (); }
void Resolver::applySolutions( const ProblemSolutionList & solutions )
{ _pimpl->applySolutions (solutions); }
- void Resolver::doUpgrade( UpgradeStatistics & opt_stats_r )
- { _pimpl->doUpgrade(opt_stats_r); }
+ bool Resolver::doUpgrade( UpgradeStatistics & opt_stats_r )
+ { return _pimpl->doUpgrade(opt_stats_r); }
void Resolver::doUpdate()
{ _pimpl->doUpdate(); }
void Resolver::setForceResolve( const bool force )

Modified: trunk/libzypp/zypp/Resolver.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/Resolver.h?rev=9886&r1=9885&r2=9886&view=diff
==============================================================================
--- trunk/libzypp/zypp/Resolver.h (original)
+++ trunk/libzypp/zypp/Resolver.h Tue Apr 29 16:37:09 2008
@@ -111,7 +111,7 @@
* Quite helpful to get back to a 'sane state'. Quite disastrous
* since you'll loose all non-distribution packages
**/
- void doUpgrade( UpgradeStatistics & opt_stats_r );
+ bool doUpgrade( UpgradeStatistics & opt_stats_r );

/**
* Update to newest package

Modified: trunk/libzypp/zypp/solver/detail/Resolver.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/solver/detail/Resolver.cc?rev=9886&r1=9885&r2=9886&view=diff
==============================================================================
--- trunk/libzypp/zypp/solver/detail/Resolver.cc (original)
+++ trunk/libzypp/zypp/solver/detail/Resolver.cc Tue Apr 29 16:37:09 2008
@@ -103,15 +103,10 @@
}
}

-bool
+void
Resolver::doUpdate()
{
- if (_satResolver) {
- return _satResolver->doUpdate();
- } else {
- ERR << "SAT solver has not been initialized." << endl;
- return false;
- }
+ return _satResolver->doUpdate();
}

void
@@ -281,12 +276,14 @@
// DESCRIPTION : Unmaintained packages which does not fit to
// the updated system (broken dependencies) will be
// deleted.
+// returns true if solving was successful
//
-void Resolver::checkUnmaintainedItems () {
+bool Resolver::checkUnmaintainedItems () {
int solverRuns = 1;
+ bool solverRet = resolvePool();
MIL << "Checking unmaintained items....." << endl;

- while (!resolvePool() && solverRuns++ < MAXSOLVERRUNS) {
+ while (!solverRet && solverRuns++ < MAXSOLVERRUNS) {
ResolverProblemList problemList = problems();
ProblemSolutionList solutionList;
PoolItemList problemItemList;
@@ -344,6 +341,8 @@
// break cause there is no other solution available by the next run
solverRuns = MAXSOLVERRUNS;
}
+ // next try
+ solverRet = resolvePool();
}
}


Modified: trunk/libzypp/zypp/solver/detail/Resolver.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/solver/detail/Resolver.h?rev=9886&r1=9885&r2=9886&view=diff
==============================================================================
--- trunk/libzypp/zypp/solver/detail/Resolver.h (original)
+++ trunk/libzypp/zypp/solver/detail/Resolver.h Tue Apr 29 16:37:09 2008
@@ -97,7 +97,8 @@

// Unmaintained packages which does not fit to the updated system
// (broken dependencies) will be deleted.
- void checkUnmaintainedItems ();
+ // returns true if solving was successful
+ bool checkUnmaintainedItems ();

void solverInit();

@@ -137,9 +138,9 @@
bool verifySystem ();
bool resolvePool();
bool resolveQueue(solver::detail::SolverQueueItemList & queue);
- bool doUpdate();
+ void doUpdate();

- void doUpgrade( zypp::UpgradeStatistics & opt_stats_r );
+ bool doUpgrade( zypp::UpgradeStatistics & opt_stats_r );
PoolItemList problematicUpdateItems( void ) const { return _problem_items;
}

ResolverProblemList problems () const;

Modified: trunk/libzypp/zypp/solver/detail/ResolverUpgrade.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/solver/detail/ResolverUpgrade.cc?rev=9886&r1=9885&r2=9886&view=diff
==============================================================================
--- trunk/libzypp/zypp/solver/detail/ResolverUpgrade.cc (original)
+++ trunk/libzypp/zypp/solver/detail/ResolverUpgrade.cc Tue Apr 29 16:37:09 2008
@@ -200,12 +200,12 @@
//
//
// METHOD NAME : Resolver::doUpgrade
-// METHOD TYPE : int
+// METHOD TYPE : bool
//
// DESCRIPTION : go through all installed (but not yet touched by user)
// packages and look for update candidates
//
-void
+bool
Resolver::doUpgrade( UpgradeStatistics & opt_stats_r )
{
typedef map<PoolItem,PoolItem> CandidateMap;
@@ -223,7 +223,7 @@
catch( const Exception & excpt_r) {
ERR << "Huh, no target ?";
ZYPP_CAUGHT(excpt_r);
- if (!_testing) return; // can't continue without target
+ if (!_testing) return false; // can't continue without target
MIL << "Running in test mode, continuing without target" << endl;
}
MIL << "target at " << target << endl;
@@ -643,7 +643,8 @@

// Unmaintained packages which does not fit to the updated system
// (broken dependencies) will be deleted.
- checkUnmaintainedItems ();
+ // Make a solverrun and return it to the calling function
+ return checkUnmaintainedItems ();

}


Modified: trunk/libzypp/zypp/solver/detail/SATResolver.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/solver/detail/SATResolver.cc?rev=9886&r1=9885&r2=9886&view=diff
==============================================================================
--- trunk/libzypp/zypp/solver/detail/SATResolver.cc (original)
+++ trunk/libzypp/zypp/solver/detail/SATResolver.cc Tue Apr 29 16:37:09 2008
@@ -741,7 +741,7 @@
}


-bool SATResolver::doUpdate()
+void SATResolver::doUpdate()
{
MIL << "SATResolver::doUpdate()" << endl;

@@ -812,7 +812,6 @@
solverEnd();

MIL << "SATResolver::doUpdate() done" << endl;
- return true;
}



Modified: trunk/libzypp/zypp/solver/detail/SATResolver.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/solver/detail/SATResolver.h?rev=9886&r1=9885&r2=9886&view=diff
==============================================================================
--- trunk/libzypp/zypp/solver/detail/SATResolver.h (original)
+++ trunk/libzypp/zypp/solver/detail/SATResolver.h Tue Apr 29 16:37:09 2008
@@ -116,7 +116,7 @@
bool resolveQueue(const SolverQueueItemList &requestQueue,
const PoolItemList & weakItems);
// searching for new packages
- bool doUpdate();
+ void doUpdate();

ResolverProblemList problems ();
void applySolutions (const ProblemSolutionList &solutions);

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

< Previous Next >
This Thread
  • No further messages