From 6526e1db9b8daaf7d439e4e12c06ea9c89fec84a Mon Sep 17 00:00:00 2001 From: Stefan Schubert Date: Mon, 18 Feb 2008 10:20:13 +0000 Subject: [PATCH] generating testcase only if ZYPP_FULLLOG is set --- zypp/sat/SATResolver.cc | 6 +++--- zypp/solver/detail/Resolver.cc | 15 ++++++++++----- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/zypp/sat/SATResolver.cc b/zypp/sat/SATResolver.cc index ed45b96..7dc36d7 100644 --- a/zypp/sat/SATResolver.cc +++ b/zypp/sat/SATResolver.cc @@ -34,7 +34,6 @@ #include "zypp/sat/SATResolver.h" #include "zypp/sat/Pool.h" #include "zypp/solver/detail/ProblemSolutionCombi.h" -#include "zypp/solver/detail/Testcase.h" extern "C" { #include "satsolver/repo_solv.h" @@ -360,6 +359,7 @@ SATResolver::resolvePool(const CapabilitySet & requires_caps, const CapabilitySet & conflict_caps) { SATCollectTransact info (*this); + MIL << "SATResolver::resolvePool()" << endl; if (_solv) { @@ -482,10 +482,10 @@ SATResolver::resolvePool(const CapabilitySet & requires_caps, } } - // clean up + // cleanup solver_free(_solv); _solv = NULL; - queue_free( &(_jobQueue) ); + queue_free( &(_jobQueue) ); MIL << "SATResolver::resolvePool() done" << endl; return true; diff --git a/zypp/solver/detail/Resolver.cc b/zypp/solver/detail/Resolver.cc index 7114d62..c785d5a 100644 --- a/zypp/solver/detail/Resolver.cc +++ b/zypp/solver/detail/Resolver.cc @@ -72,10 +72,8 @@ Resolver::Resolver (const ResPool & pool) , _verifying(false) { - Testcase testcase("/var/log/YaST2/autoTestcase"); sat::Pool satPool( sat::Pool::instance() ); _satResolver = new SATResolver(_pool, satPool.get()); - testcase.createTestcase (*this, true, false); // create pool, do not solver } @@ -250,10 +248,17 @@ Resolver::resolvePool() { // Solving with the satsolver + static bool poolDumped = false; MIL << "-------------- Calling SAT Solver -------------------" << endl; - Testcase testcase("/var/log/YaST2/autoTestcase"); - testcase.createTestcase (*this, false, false); // write control file only - + if ( getenv("ZYPP_FULLLOG") ) { + Testcase testcase("/var/log/YaST2/autoTestcase"); + if (!poolDumped) { + testcase.createTestcase (*this, true, false); // dump pool + poolDumped = true; + } else { + testcase.createTestcase (*this, false, false); // write control file only + } + } #if 0 MIL << "------SAT-Pool------" << endl; for (sat::Pool::SolvableIterator i = satPool.solvablesBegin(); -- 2.7.4