SET(LIBZYPP_MAJOR "6")
SET(LIBZYPP_COMPATMINOR "10")
SET(LIBZYPP_MINOR "10")
-SET(LIBZYPP_PATCH "3")
+SET(LIBZYPP_PATCH "4")
#
-# LAST RELEASED: 6.10.3 (10)
+# LAST RELEASED: 6.10.4 (10)
# (The number in parenthesis is LIBZYPP_COMPATMINOR)
#=======
+-------------------------------------------------------------------
+Thu Jul 16 16:25:24 CEST 2009 - ma@suse.de
+
+- New solver.upgradeTestcasesToKeep option in zypp.conf. It tells
+ how many dist upgrade solver testcases should be kept on the system.
+ Per default just the last two are kept.
+- version 6.10.4 (10)
+
-------------------------------------------------------------------
Wed Jul 15 17:53:43 CEST 2009 - ma@suse.de
##
# solver.checkSystemFile = /etc/zypp/systemCheck
+##
+## When committing a dist upgrade (e.g. 'zypper dup') a solver testcase
+## is written to /var/log/updateTestcase-<date>. It is needed in bugreports.
+## This optin returns the number of testcases to keep on the system. Old
+## cases will be deleted, as new ones are created.
+##
+## Use 0 to write no testcase at all, or -1 to keep all testcases.
+##
+## Valid values: Integer
+## Default value: 2
+##
+# solver.upgradeTestcasesToKeep = 2
+
##
## Packages which are parallel installable with
## diffent versions
{
solver_allowVendorChange.set( str::strToBool( value, solver_allowVendorChange.get() ) );
}
+ else if ( entry == "solver.upgradeTestcasesToKeep" )
+ {
+ solver_upgradeTestcasesToKeep.set( str::strtonum<unsigned>( value ) );
+ }
else if ( entry == "solver.checkSystemFile" )
{
solver_checkSystemFile = Pathname(value);
int download_max_download_speed;
int download_max_silent_tries;
- Option<bool,false> solver_onlyRequires;
- Option<bool,false> solver_allowVendorChange;
+ Option<bool,false> solver_onlyRequires;
+ Option<bool,false> solver_allowVendorChange;
+ Option<unsigned,2U> solver_upgradeTestcasesToKeep;
Pathname solver_checkSystemFile;
std::set<IdString> multiversion;
long ZConfig::download_max_silent_tries() const
{ return _pimpl->download_max_silent_tries; }
+
bool ZConfig::solver_onlyRequires() const
{ return _pimpl->solver_onlyRequires.get(); }
{ return ( _pimpl->solver_checkSystemFile.empty()
? (configPath()/"systemCheck") : _pimpl->solver_checkSystemFile ); }
+ unsigned ZConfig::solver_upgradeTestcasesToKeep() const
+ { return _pimpl->solver_upgradeTestcasesToKeep.get(); }
+
std::set<IdString> ZConfig::multiversion() const
{ return _pimpl->multiversion; }
*/
bool solver_allowVendorChange() const;
+ /**
+ * When committing a dist upgrade (e.g. <tt>zypper dup</tt>)
+ * a solver testcase is written. It is needed in bugreports,
+ * in case something went wrong. This returns the number of
+ * testcases to keep on the system. Old cases will be deleted,
+ * as new ones are created. Use \c 0 to write no testcase at all.
+ */
+ unsigned solver_upgradeTestcasesToKeep() const;
+
/**
* Packages which can be installed parallel with different versions
* Returning a set of package names (IdString)
{ /////////////////////////////////////////////////////////////////
/** \internal Manage writing a new testcase when doing an upgrade. */
- void writeOutUpgradeTestcase()
+ void writeUpgradeTestcase()
{
+ unsigned toKeep( ZConfig::instance().solver_upgradeTestcasesToKeep() );
+ MIL << "Testcases to keep: " << toKeep << endl;
+ if ( !toKeep )
+ return;
Target_Ptr target( getZYpp()->getTarget() );
if ( ! target )
{
Pathname dir( target->assertRootPrefix("/var/log/") );
Pathname next( dir / Date::now().form( stem+"-%Y-%m-%d-%H-%M-%S" ) );
+ {
+ std::list<std::string> content;
+ filesystem::readdir( content, dir, /*dots*/false );
+ std::set<std::string> cases;
+ for_( c, content.begin(), content.end() )
+ {
+ if ( str::startsWith( *c, stem ) )
+ cases.insert( *c );
+ }
+ if ( cases.size() >= toKeep )
+ {
+ unsigned toDel = cases.size() - toKeep + 1; // +1 for the new one
+ for_( c, cases.begin(), cases.end() )
+ {
+ filesystem::recursive_rmdir( dir/(*c) );
+ if ( ! --toDel )
+ break;
+ }
+ }
+ }
+
MIL << "Write new testcase " << next << endl;
getZYpp()->resolver()->createSolverTestcase( next.asString(), false/*no solving*/ );
}
///////////////////////////////////////////////////////////////////
if ( getZYpp()->resolver()->upgradeMode() )
{
- writeOutUpgradeTestcase();
+ writeUpgradeTestcase();
}
///////////////////////////////////////////////////////////////////