SET(LIBZYPP_MINOR "10")
SET(LIBZYPP_PATCH "3")
#
-# LAST RELEASED: 6.10.2 (10)
+# LAST RELEASED: 6.10.3 (10)
# (The number in parenthesis is LIBZYPP_COMPATMINOR)
#=======
+-------------------------------------------------------------------
+Wed Jul 15 17:53:43 CEST 2009 - ma@suse.de
+
+- Don't write a solver testcase when solving for dist upgrade,
+ but when actually committing.
+- version 6.10.3 (10)
+
-------------------------------------------------------------------
Wed Jul 15 16:45:39 CEST 2009 - ma@suse.de
void Resolver::resetOnlyRequires() { _pimpl->setOnlyRequires( indeterminate ); }
bool Resolver::onlyRequires() { return _pimpl->onlyRequires(); }
+ bool Resolver::upgradeMode() const { return _pimpl->isUpgradeMode(); }
+
void Resolver::setAllowVendorChange( bool yesno_r ) { _pimpl->setAllowVendorChange( yesno_r ); }
void Resolver::setDefaultAllowVendorChange() { _pimpl->setAllowVendorChange( indeterminate ); }
bool Resolver::allowVendorChange() const { return _pimpl->allowVendorChange(); }
std::list<PoolItem> Resolver::problematicUpdateItems() const
{ return _pimpl->problematicUpdateItems(); }
- bool Resolver::createSolverTestcase( const std::string & dumpPath )
+ bool Resolver::createSolverTestcase( const std::string & dumpPath, bool runSolver )
{
solver::detail::Testcase testcase (dumpPath);
- return testcase.createTestcase(*_pimpl);
+ return testcase.createTestcase(*_pimpl, true, runSolver);
}
solver::detail::ItemCapKindList Resolver::isInstalledBy( const PoolItem & item )
void resetOnlyRequires(); // set back to default (described in zypp.conf)
bool onlyRequires();
+ /**
+ * Whether the \ref Resolver is in upgrade mode.
+ */
+ bool upgradeMode() const;
+
/**
* Setting whether the solver should allow or disallow vendor changes.
*
* \parame dumpPath destination directory of the created directory
* \return true if it was successful
*/
- bool createSolverTestcase( const std::string & dumpPath = "/var/log/YaST2/solverTestcase" );
+ bool createSolverTestcase( const std::string & dumpPath = "/var/log/YaST2/solverTestcase", bool runSolver = true );
/**
* Gives information about WHO has pused an installation of an given item.
{
ERR << "Huh, no target ?" << endl;
return false; // can't continue without target
- }
-
- // create a testcase for the updating system
- std::string now( Date::now().form( "-%Y-%m-%d-%H-%M-%S" ) );
- 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;
PathInfo path (dumpPath);
if ( !path.isExist() ) {
- if (zypp::filesystem::mkdir (dumpPath)!=0) {
+ if (zypp::filesystem::assert_dir (dumpPath)!=0) {
ERR << "Cannot create directory " << dumpPath << endl;
return false;
}
template<class T>
std::string helixXML( const T &obj ); //undefined
-template<>
+template<>
std::string helixXML( const Edition &edition );
-template<>
+template<>
std::string helixXML( const Arch &arch );
-template<>
+template<>
std::string helixXML( const Capability &cap );
-template<>
+template<>
std::string helixXML( const Capabilities &caps );
-template<>
+template<>
std::string helixXML( const CapabilitySet &caps );
-template<>
+template<>
std::string helixXML( const PoolItem &item );
private:
std::string dumpFile; // Path of the generated testcase
- ofgzstream *file;
+ ofgzstream *file;
public:
HelixResolvable (const std::string & path);
HelixControl (const std::string & controlPath,
const RepositoryTable & sourceTable,
const Arch & systemArchitecture,
- const LocaleSet &languages,
+ const LocaleSet &languages,
const std::string & systemPath = "solver-system.xml.gz",
const bool forceResolve = false,
const bool onlyRequires = false,
const bool ignorealreadyrecommended = false);
- HelixControl ();
+ HelixControl ();
~HelixControl ();
void installResolvable (const ResObject::constPtr &resObject,
void lockResolvable (const ResObject::constPtr &resObject,
const ResStatus &status);
void keepResolvable (const ResObject::constPtr &resObject,
- const ResStatus &status);
+ const ResStatus &status);
void deleteResolvable (const ResObject::constPtr &resObject,
const ResStatus &status);
void addDependencies (const CapabilitySet &capRequire, const CapabilitySet &capConflict);
-
+
void distupgrade ();
void verifySystem ();
void update ();
-
+
std::string filename () { return dumpFile; }
};
-
-
+
+
///////////////////////////////////////////////////////////////////
//
// CLASS NAME : Testcase
public:
Testcase (const std::string & path);
- Testcase ();
+ Testcase ();
~Testcase ();
bool createTestcase (Resolver & resolver, bool dumpPool = true, bool runSolver = true);
- bool createTestcasePool(const ResPool &pool);
+ bool createTestcasePool(const ResPool &pool);
};
#include "zypp/pool/GetResolvablesToInsDel.h"
#include "zypp/solver/detail/Helper.h"
+#include "zypp/solver/detail/Testcase.h"
#include "zypp/repo/DeltaCandidates.h"
#include "zypp/repo/PackageProvider.h"
using namespace std;
+
///////////////////////////////////////////////////////////////////
namespace zypp
{ /////////////////////////////////////////////////////////////////
namespace target
{ /////////////////////////////////////////////////////////////////
+ /** \internal Manage writing a new testcase when doing an upgrade. */
+ void writeOutUpgradeTestcase()
+ {
+ Target_Ptr target( getZYpp()->getTarget() );
+ if ( ! target )
+ {
+ WAR << "No Target no Testcase!" << endl;
+ return;
+ }
+
+ std::string stem( "updateTestcase" );
+ Pathname dir( target->assertRootPrefix("/var/log/") );
+ Pathname next( dir / Date::now().form( stem+"-%Y-%m-%d-%H-%M-%S" ) );
+
+ MIL << "Write new testcase " << next << endl;
+ getZYpp()->resolver()->createSolverTestcase( next.asString(), false/*no solving*/ );
+ }
+
///////////////////////////////////////////////////////////////////
namespace
{ /////////////////////////////////////////////////////////////////
MIL << "TargetImpl::commit(<pool>, " << policy_r << ")" << endl;
+ ///////////////////////////////////////////////////////////////////
+ // Write out a testcase if we're in dist upgrade mode.
+ ///////////////////////////////////////////////////////////////////
+ if ( getZYpp()->resolver()->upgradeMode() )
+ {
+ writeOutUpgradeTestcase();
+ }
+
///////////////////////////////////////////////////////////////////
// Store non-package data:
///////////////////////////////////////////////////////////////////