ref: refs/heads/ma-misc
commit 132681f751c5a929cc40d4e0078e9510958817cb
Author: Michael Andres
Date: Sun Jul 19 22:45:12 2009 +0200
backup
---
devel/devel.ma/Main.cc | 14 ++++++++++++--
zypp/target/TargetImpl.cc | 45 +++++++++++++++++++++++++++++----------------
2 files changed, 41 insertions(+), 18 deletions(-)
diff --git a/devel/devel.ma/Main.cc b/devel/devel.ma/Main.cc
index 5742dd1..ef9e7dd 100644
--- a/devel/devel.ma/Main.cc
+++ b/devel/devel.ma/Main.cc
@@ -63,6 +63,7 @@ try {
INT << "===[START]==========================================" << endl;
ZConfig::instance();
TestSetup::LoadSystemAt( sysRoot );
+ getZYpp()->initializeTarget( sysRoot );
///////////////////////////////////////////////////////////////////
ResPool pool( ResPool::instance() );
sat::Pool satpool( sat::Pool::instance() );
@@ -71,13 +72,22 @@ try {
USR << "pool: " << pool << endl;
///////////////////////////////////////////////////////////////////
- if ( 1 /*upgrade()*/ )
+ if ( 1 )
{
getZYpp()->resolver()->addRequire( Capability("emacs") );
solve();
vdumpPoolStats( USR << "Transacting:"<< endl,
make_filter_beginresfilter::ByTransact(pool),
- make_filter_endresfilter::ByTransact(pool) ) << endl;
+ make_filter_endresfilter::ByTransact(pool) ) << endl;
+ }
+
+
+ {
+ ZYppCommitPolicy policy;
+ policy.dryRun( true );
+ USR << policy << endl;
+ ZYppCommitResult result( getZYpp()->commit( policy ) );
+ USR << result << endl;
}
diff --git a/zypp/target/TargetImpl.cc b/zypp/target/TargetImpl.cc
index f691981..af8aa50 100644
--- a/zypp/target/TargetImpl.cc
+++ b/zypp/target/TargetImpl.cc
@@ -722,34 +722,47 @@ namespace zypp
///////////////////////////////////////////////////////////////////
if ( getZYpp()->resolver()->upgradeMode() )
{
- writeUpgradeTestcase();
+ if ( ! policy_r.dryRun() )
+ {
+ writeUpgradeTestcase();
+ }
+ else
+ {
+ DBG << "dryRun: Not writing upgrade testcase." << endl;
+ }
}
-
///////////////////////////////////////////////////////////////////
// Store non-package data:
///////////////////////////////////////////////////////////////////
- filesystem::assert_dir( home() );
- // requested locales
- _requestedLocalesFile.setLocales( pool_r.getRequestedLocales() );
- // weak locks
+ if ( ! policy_r.dryRun() )
{
- SoftLocksFile::Data newdata;
- pool_r.getActiveSoftLocks( newdata );
- _softLocksFile.setData( newdata );
+ filesystem::assert_dir( home() );
+ // requested locales
+ _requestedLocalesFile.setLocales( pool_r.getRequestedLocales() );
+ // weak locks
+ {
+ SoftLocksFile::Data newdata;
+ pool_r.getActiveSoftLocks( newdata );
+ _softLocksFile.setData( newdata );
+ }
+ // hard locks
+ if ( ZConfig::instance().apply_locks_file() )
+ {
+ HardLocksFile::Data newdata;
+ pool_r.getHardLockQueries( newdata );
+ _hardLocksFile.setData( newdata );
+ }
}
- // hard locks
- if ( ZConfig::instance().apply_locks_file() )
+ else
{
- HardLocksFile::Data newdata;
- pool_r.getHardLockQueries( newdata );
- _hardLocksFile.setData( newdata );
+ DBG << "dryRun: Not stroring non-package data." << endl;
}
-
///////////////////////////////////////////////////////////////////
// Process packages:
///////////////////////////////////////////////////////////////////
DBG << "commit log file is set to: " << HistoryLog::fname() << endl;
+ return ZYppCommitResult();
ZYppCommitResult result;
@@ -799,7 +812,7 @@ namespace zypp
///////////////////////////////////////////////////////////////////
// Remove/install packages.
///////////////////////////////////////////////////////////////////
- commit ( to_uninstall, policy_r, pool_r );
+ commit ( to_uninstall, policy_r, pool_r );
if (policy_r.restrictToMedia() == 0)
{ // commit all
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org