[zypp-commit] r11954 - in /trunk/libzypp: VERSION.cmake package/libzypp.changes zypp/target/TargetCallbackReceiver.cc zypp/target/TargetImpl.cc

Author: mlandres Date: Thu Dec 18 22:32:18 2008 New Revision: 11954 URL: http://svn.opensuse.org/viewcvs/zypp?rev=11954&view=rev Log: - Fixed lost user request to abort during commit. Modified: trunk/libzypp/VERSION.cmake trunk/libzypp/package/libzypp.changes trunk/libzypp/zypp/target/TargetCallbackReceiver.cc trunk/libzypp/zypp/target/TargetImpl.cc Modified: trunk/libzypp/VERSION.cmake URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/VERSION.cmake?rev=11954&r... ============================================================================== --- trunk/libzypp/VERSION.cmake (original) +++ trunk/libzypp/VERSION.cmake Thu Dec 18 22:32:18 2008 @@ -63,6 +63,6 @@ SET(LIBZYPP_MINOR "25") SET(LIBZYPP_PATCH "0") # -# LAST RELEASED: 5.24.7 (23) +# LAST RELEASED: 5.25.0 (23) # (The number in parenthesis is LIBZYPP_COMPATMINOR) #======= Modified: trunk/libzypp/package/libzypp.changes URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/package/libzypp.changes?r... ============================================================================== --- trunk/libzypp/package/libzypp.changes (original) +++ trunk/libzypp/package/libzypp.changes Thu Dec 18 22:32:18 2008 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Thu Dec 18 22:26:18 CET 2008 - ma@suse.de + +- Fixed lost user request to abort during commit. (bnc #388810, bnc #450273) +- revision 11954 +- version 5.25.0 (23) + +------------------------------------------------------------------- Thu Dec 18 13:02:27 CET 2008 - ma@suse.de - Add Package::filelist, faster and less memory consuming Modified: trunk/libzypp/zypp/target/TargetCallbackReceiver.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/target/TargetCallbac... ============================================================================== --- trunk/libzypp/zypp/target/TargetCallbackReceiver.cc (original) +++ trunk/libzypp/zypp/target/TargetCallbackReceiver.cc Thu Dec 18 22:32:18 2008 @@ -72,6 +72,7 @@ case rpm::InstallResolvableReport::RETRY: return rpm::RpmInstallReport::RETRY; case rpm::InstallResolvableReport::ABORT: + _abort = true; return rpm::RpmInstallReport::ABORT; case rpm::InstallResolvableReport::IGNORE: return rpm::RpmInstallReport::IGNORE; @@ -125,6 +126,7 @@ void RpmRemovePackageReceiver::start( const std::string & name ) { _report->start( _resolvable ); + _abort = false; } /** @@ -150,6 +152,7 @@ case rpm::RemoveResolvableReport::RETRY: return rpm::RpmRemoveReport::RETRY; case rpm::RemoveResolvableReport::ABORT: + _abort = true; return rpm::RpmRemoveReport::ABORT; case rpm::RemoveResolvableReport::IGNORE: return rpm::RpmRemoveReport::IGNORE; Modified: trunk/libzypp/zypp/target/TargetImpl.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/target/TargetImpl.cc... ============================================================================== --- trunk/libzypp/zypp/target/TargetImpl.cc (original) +++ trunk/libzypp/zypp/target/TargetImpl.cc Thu Dec 18 22:32:18 2008 @@ -616,6 +616,11 @@ MIL << "Target loaded: " << system.solvablesSize() << " resolvables" << endl; } + /////////////////////////////////////////////////////////////////// + // + // COMMIT + // + /////////////////////////////////////////////////////////////////// ZYppCommitResult TargetImpl::commit( ResPool pool_r, const ZYppCommitPolicy & policy_rX ) { // ----------------------------------------------------------------- // @@ -702,7 +707,7 @@ /////////////////////////////////////////////////////////////////// // Remove/install packages. /////////////////////////////////////////////////////////////////// - commit (to_uninstall, policy_r, pool_r ); + commit ( to_uninstall, policy_r, pool_r ); if (policy_r.restrictToMedia() == 0) { // commit all @@ -765,6 +770,11 @@ } + /////////////////////////////////////////////////////////////////// + // + // COMMIT internal + // + /////////////////////////////////////////////////////////////////// TargetImpl::PoolItemList TargetImpl::commit( const TargetImpl::PoolItemList & items_r, const ZYppCommitPolicy & policy_r, @@ -794,6 +804,12 @@ { localfile = packageCache.get( it ); } + catch ( const AbortRequestException &e ) + { + WAR << "commit aborted by the user" << endl; + abort = true; + break; + } catch ( const SkipRequestException &e ) { ZYPP_CAUGHT( e ); @@ -812,8 +828,9 @@ #warning Exception handling // create a installation progress report proxy RpmInstallPackageReceiver progress( it->resolvable() ); - progress.connect(); - bool success = true; + progress.connect(); // disconnected on destruction. + + bool success = false; rpm::RpmInstFlags flags; // Why force and nodeps? // @@ -839,27 +856,34 @@ if ( progress.aborted() ) { WAR << "commit aborted by the user" << endl; - progress.disconnect(); - success = false; abort = true; break; } + else + { + success = true; + } } - catch (Exception & excpt_r) + catch ( Exception & excpt_r ) { ZYPP_CAUGHT(excpt_r); if ( policy_r.dryRun() ) { WAR << "dry run failed" << endl; - progress.disconnect(); break; } // else - WAR << "Install failed" << endl; + if ( progress.aborted() ) + { + WAR << "commit aborted by the user" << endl; + abort = true; + } + else + { + WAR << "Install failed" << endl; + } remaining.push_back( *it ); - progress.disconnect(); - success = false; - break; + break; // stop } if ( success && !policy_r.dryRun() ) @@ -868,14 +892,13 @@ // Remember to check this package for presence of patch scripts. successfullyInstalledPackages.push_back( it->satSolvable() ); } - progress.disconnect(); } else { - bool success = true; - RpmRemovePackageReceiver progress( it->resolvable() ); - progress.connect(); + progress.connect(); // disconnected on destruction. + + bool success = false; rpm::RpmInstFlags flags( rpm::RPMINST_NODEPS ); if (policy_r.dryRun()) flags |= rpm::RPMINST_TEST; try @@ -886,24 +909,30 @@ if ( progress.aborted() ) { WAR << "commit aborted by the user" << endl; - progress.disconnect(); - success = false; abort = true; break; } + else + { + success = true; + } } catch (Exception & excpt_r) { - WAR << "removal of " << p << " failed"; - success = false; ZYPP_CAUGHT( excpt_r ); + if ( progress.aborted() ) + { + WAR << "commit aborted by the user" << endl; + abort = true; + break; + } + // else + WAR << "removal of " << p << " failed"; } - if (success - && !policy_r.dryRun()) + if ( success && !policy_r.dryRun() ) { it->status().resetTransact( ResStatus::USER ); } - progress.disconnect(); } } else if ( ! policy_r.dryRun() ) // other resolvables (non-Package) -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org
participants (1)
-
mlandres@svn.opensuse.org