Mailinglist Archive: zypp-commit (268 mails)

< Previous Next >
[zypp-commit] r7935 - in /trunk/libzypp/zypp/sat: SATResolver.cc detail/PoolImpl.cc
  • From: mlandres@xxxxxxxxxxxxxxxx
  • Date: Tue, 27 Nov 2007 12:36:33 -0000
  • Message-id: <20071127123634.2009528072@xxxxxxxxxxxxxxxx>
Author: mlandres
Date: Tue Nov 27 13:36:33 2007
New Revision: 7935

URL: http://svn.opensuse.org/viewcvs/zypp?rev=7935&view=rev
Log:
move libsatsolvber debug output handling to sat::detail::PoolImpl

Modified:
trunk/libzypp/zypp/sat/SATResolver.cc
trunk/libzypp/zypp/sat/detail/PoolImpl.cc

Modified: trunk/libzypp/zypp/sat/SATResolver.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/SATResolver.cc?rev=7935&r1=7934&r2=7935&view=diff
==============================================================================
--- trunk/libzypp/zypp/sat/SATResolver.cc (original)
+++ trunk/libzypp/zypp/sat/SATResolver.cc Tue Nov 27 13:36:33 2007
@@ -38,7 +38,6 @@
#include "satsolver/poolarch.h"
#include "satsolver/evr.h"
#include "satsolver/poolvendor.h"
-#include "satsolver/sat_debug.h"
}

/////////////////////////////////////////////////////////////////////////
@@ -79,12 +78,6 @@
return os << "<resolver/>";
}

-void logSat (char *logString)
-{
- MIL << logString;
-}
-
-
//---------------------------------------------------------------------------

SATResolver::SATResolver (const ResPool & pool, Pool *SATPool)
@@ -99,10 +92,6 @@
, _architecture( zypp_detail::defaultArchitecture() )

{
- // initialialize logging
- sat_set_debug( getenv("ZYPP_FULLLOG") ? DEBUG_5 : ERROR,
- 1 ); // logging linenumer, function,....
- sat_set_debugCallback (logSat);
}


@@ -832,21 +821,21 @@
MIL << "Problem " << pcnt << ":" << endl;
MIL << "====================================" << endl;
string whatString = probleminfoString(solv, &jobQueue, problem);
- ResolverProblem_Ptr resolverProblem = new ResolverProblem
(whatString, "");
+ ResolverProblem_Ptr resolverProblem = new ResolverProblem
(whatString, "");
solution = 0;
while ((solution = solver_next_solution(solv, problem, solution))
!= 0) {
element = 0;
ProblemSolutionCombi *problemSolution = new
ProblemSolutionCombi(resolverProblem);
while ((element = solver_next_solutionelement(solv, problem,
solution, element, &p, &rp)) != 0) {
if (p == 0) {
- /* job, rp is index into job queue */
+ /* job, rp is index into job queue */
what = jobQueue.elements[rp];
switch (jobQueue.elements[rp-1])
{
case SOLVER_INSTALL_SOLVABLE: {
s = pool->solvables + what;
std::vector<std::string> nameVector;
- string kindName(id2str(_SATPool, s->name));

+ string kindName(id2str(_SATPool, s->name));

// expect "<kind>::<name>"
unsigned count = str::split( kindName,
std::back_inserter(nameVector), ":" );
@@ -878,12 +867,12 @@
case SOLVER_ERASE_SOLVABLE: {
s = pool->solvables + what;
std::vector<std::string> nameVector;
- string kindName(id2str(_SATPool, s->name));

+ string kindName(id2str(_SATPool, s->name));

// expect "<kind>::<name>"
unsigned count = str::split( kindName,
std::back_inserter(nameVector), ":" );
PoolItem_Ref poolItem;
-
+
if (count >= 2) {
poolItem = get_poolItem (_pool,
s->repo ?
string(repo_name(s->repo)) : "", //repo
@@ -918,21 +907,21 @@
break;
case SOLVER_INSTALL_SOLVABLE_PROVIDES:
MIL << "- do not install a solvable providing "
<< dep2str(pool, what) << endl;
- ERR << "No valid solution available" << endl;

+ ERR << "No valid solution available" << endl;
break;
case SOLVER_ERASE_SOLVABLE_PROVIDES:
MIL << "- do not deinstall all solvables
providing " << dep2str(pool, what) << endl;
- ERR << "No valid solution available" << endl;

+ ERR << "No valid solution available" << endl;
break;
case SOLVER_INSTALL_SOLVABLE_UPDATE:
s = pool->solvables + what;
MIL << "- do not install most recent version of
" << id2str(pool, s->name) << "-" << id2str(pool, s->evr)
- << "." << id2str(pool, s->arch) << endl;

- ERR << "No valid solution available" << endl;

+ << "." << id2str(pool, s->arch) << endl;
+ ERR << "No valid solution available" << endl;
break;
default:
MIL << "- do something different" << endl;
- ERR << "No valid solution available" << endl;

+ ERR << "No valid solution available" << endl;
break;
}
} else {
@@ -941,7 +930,7 @@
sd = rp ? pool->solvables + rp : 0;

std::vector<std::string> nameVector;
- string kindNameFrom(id2str(_SATPool, s->name));

+ string kindNameFrom(id2str(_SATPool, s->name));
// expect "<kind>::<name>"
unsigned count = str::split( kindNameFrom,
std::back_inserter(nameVector), ":" );
PoolItem_Ref itemFrom;
@@ -954,12 +943,12 @@
string(id2str(_SATPool,
s->evr)),
string(id2str(_SATPool,
s->arch)));
}
-
+
if (sd)
{
int gotone = 0;

- string kindNameTo(id2str(_SATPool, sd->name));

+ string kindNameTo(id2str(_SATPool, sd->name));
// expect "<kind>::<name>"
count = str::split( kindNameTo,
std::back_inserter(nameVector), ":" );
PoolItem_Ref itemTo;
@@ -973,8 +962,8 @@
}
if (itemFrom && itemTo) {
problemSolution->addSingleAction (itemTo,
INSTALL);
- problemSolution->addSingleAction (itemFrom,
REMOVE);
-
+ problemSolution->addSingleAction (itemFrom,
REMOVE);
+
if (evrcmp(pool, sd->evr, s->evr) < 0)
{
MIL << "- allow downgrade of " <<
id2str(pool, s->name) << "-" << id2str(pool, s->evr) << "." << id2str(pool,
s->arch)
@@ -1030,7 +1019,7 @@
Resolver dummyResolver(_pool);
if (!solution->apply (dummyResolver))
break;
- }
+ }
}



Modified: trunk/libzypp/zypp/sat/detail/PoolImpl.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/detail/PoolImpl.cc?rev=7935&r1=7934&r2=7935&view=diff
==============================================================================
--- trunk/libzypp/zypp/sat/detail/PoolImpl.cc (original)
+++ trunk/libzypp/zypp/sat/detail/PoolImpl.cc Tue Nov 27 13:36:33 2007
@@ -14,6 +14,7 @@
#include <satsolver/solvable.h>
#include <satsolver/repo.h>
#include <satsolver/pool.h>
+#include <satsolver/sat_debug.h>
}

#include <iostream>
@@ -25,7 +26,7 @@

using std::endl;

-///////////////////////////////////////////////////////////////////
+// ///////////////////////////////////////////////////////////////////
namespace zypp
{ /////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
@@ -35,6 +36,11 @@
namespace detail
{ /////////////////////////////////////////////////////////////////

+ void logSat( char *logString )
+ {
+ _MIL("satsolver") << logString;
+ }
+
///////////////////////////////////////////////////////////////////
//
// METHOD NAME : PoolMember::myPool
@@ -58,6 +64,10 @@
{
ZYPP_THROW( Exception( _("Can not create sat-pool.") ) );
}
+ // initialialize logging
+ bool verbose = ( getenv("ZYPP_FULLLOG") ||
getenv("ZYPP_LIBSAT_FULLLOG") );
+ ::sat_set_debug( verbose ? DEBUG_5 : ERROR, 1 ); // logging linenumer,
function,....
+ ::sat_set_debugCallback( logSat );
}

///////////////////////////////////////////////////////////////////

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

< Previous Next >
This Thread
  • No further messages