[zypp-devel] Re: [zypp-commit] r10319 - in /branches/SuSE-Linux-11_0-Branch/libzypp: devel/devel.ma/NewPool.cc package/libzypp.changes zypp/target/rpm/RpmDb.cc
mlandres@svn.opensuse.org wrote:
Author: mlandres Date: Mon Jun 2 18:00:31 2008 New Revision: 10319
URL: http://svn.opensuse.org/viewcvs/zypp?rev=10319&view=rev Log: Allow to skip/abort failed package removal
Modified: branches/SuSE-Linux-11_0-Branch/libzypp/devel/devel.ma/NewPool.cc branches/SuSE-Linux-11_0-Branch/libzypp/package/libzypp.changes branches/SuSE-Linux-11_0-Branch/libzypp/zypp/target/rpm/RpmDb.cc
Modified: branches/SuSE-Linux-11_0-Branch/libzypp/devel/devel.ma/NewPool.cc URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-11_0-Branch/libzypp/devel/devel.ma/NewPool.cc?rev=10319&r1=10318&r2=10319&view=diff ============================================================================== --- branches/SuSE-Linux-11_0-Branch/libzypp/devel/devel.ma/NewPool.cc (original) +++ branches/SuSE-Linux-11_0-Branch/libzypp/devel/devel.ma/NewPool.cc Mon Jun 2 18:00:31 2008 @@ -561,20 +561,16 @@
SEC << zypp::getZYpp()->diskUsage() << endl;
- for_( it, pool.begin(), pool.end() ) + for_( it, pool.byKindBegin<SrcPackage>(), pool.byKindEnd<SrcPackage>() ) { - //MIL << *it << endl; - //DBG << (*it)->diskusage() << endl; + MIL << *it << endl; }
- PoolItem pu ( getPi<Package>("amarok") ); - PoolItem pi ( getPi<Package>("amarok",Edition("1.4.7-37")) ); - - pi.status().setTransact( true, ResStatus::USER ); - SEC << zypp::getZYpp()->diskUsage() << endl; + for_( it, pool.byIdentBegin( ResKind::srcpackage, "zypper" ), pool.byIdentEnd( ResKind::srcpackage, "zypper" ) ) + { + WAR << *it << endl; + }
- pu.status().setTransact( true, ResStatus::USER ); - SEC << zypp::getZYpp()->diskUsage() << endl;
///////////////////////////////////////////////////////////////////
Modified: branches/SuSE-Linux-11_0-Branch/libzypp/package/libzypp.changes URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-11_0-Branch/libzypp/package/libzypp.changes?rev=10319&r1=10318&r2=10319&view=diff ============================================================================== --- branches/SuSE-Linux-11_0-Branch/libzypp/package/libzypp.changes (original) +++ branches/SuSE-Linux-11_0-Branch/libzypp/package/libzypp.changes Mon Jun 2 18:00:31 2008 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Mon Jun 2 17:57:22 CEST 2008 - ma@suse.de + +- Allow to skip/abort failed package removal. (bnc #226041) +- revision 10319 + +------------------------------------------------------------------- Mon Jun 2 17:37:02 CEST 2008 - dmacvicar@suse.de
- import newer keys if a trusted key is updated
Modified: branches/SuSE-Linux-11_0-Branch/libzypp/zypp/target/rpm/RpmDb.cc URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-11_0-Branch/libzypp/zypp/target/rpm/RpmDb.cc?rev=10319&r1=10318&r2=10319&view=diff ============================================================================== --- branches/SuSE-Linux-11_0-Branch/libzypp/zypp/target/rpm/RpmDb.cc (original) +++ branches/SuSE-Linux-11_0-Branch/libzypp/zypp/target/rpm/RpmDb.cc Mon Jun 2 18:00:31 2008 @@ -2110,17 +2110,28 @@
report->start( name_r );
- try - { - doRemovePackage(name_r, flags, report); - } - catch (RpmException & excpt_r) - { - report->problem(excpt_r); //! partial fix to bug #388810, \todo allow to abort/retry failed rpm removal - report->finish(excpt_r); - ZYPP_RETHROW(excpt_r); - } - report->finish(); + do + try + { + doRemovePackage(name_r, flags, report); + report->finish(); + break; + } + catch (RpmException & excpt_r) + { + RpmRemoveReport::Action user = report->problem( excpt_r ); + + if ( user == RpmRemoveReport::ABORT ) + { + report->finish( excpt_r ); + ZYPP_RETHROW(excpt_r); + } + else if ( user == RpmRemoveReport::IGNORE ) + { + break; + } + } + while (true); }
I think this doesn't work as expected, because this rethrowed exception is catched by this code in TargetImpl.cc:700 try { rpm().removePackage( p, flags ); } catch (Exception & excpt_r) { WAR << "removal of " << p << " failed"; success = false; ZYPP_CAUGHT( excpt_r ); } and for loop continue, so without setted abort variable and break this continue with removing or installing packages. I now work on it in trunk (more fixes like abort during progress and more) so I can backport some safe part to 11.0. Pepa -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On Tue, Jun 03, Josef Reidinger wrote:
mlandres@svn.opensuse.org wrote:
Author: mlandres Date: Mon Jun 2 18:00:31 2008 New Revision: 10319 URL: http://svn.opensuse.org/viewcvs/zypp?rev=10319&view=rev Log: Allow to skip/abort failed package removal Modified: branches/SuSE-Linux-11_0-Branch/libzypp/devel/devel.ma/NewPool.cc branches/SuSE-Linux-11_0-Branch/libzypp/package/libzypp.changes branches/SuSE-Linux-11_0-Branch/libzypp/zypp/target/rpm/RpmDb.cc Modified: branches/SuSE-Linux-11_0-Branch/libzypp/devel/devel.ma/NewPool.cc URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-11_0-Branch/libzypp/devel/devel.ma/NewPool.cc?rev=10319&r1=10318&r2=10319&view=diff ============================================================================== --- branches/SuSE-Linux-11_0-Branch/libzypp/devel/devel.ma/NewPool.cc (original) +++ branches/SuSE-Linux-11_0-Branch/libzypp/devel/devel.ma/NewPool.cc Mon Jun 2 18:00:31 2008 @@ -561,20 +561,16 @@ SEC << zypp::getZYpp()->diskUsage() << endl; - for_( it, pool.begin(), pool.end() ) + for_( it, pool.byKindBegin<SrcPackage>(), pool.byKindEnd<SrcPackage>() ) { - //MIL << *it << endl; - //DBG << (*it)->diskusage() << endl; + MIL << *it << endl; } - PoolItem pu ( getPi<Package>("amarok") ); - PoolItem pi ( getPi<Package>("amarok",Edition("1.4.7-37")) ); - - pi.status().setTransact( true, ResStatus::USER ); - SEC << zypp::getZYpp()->diskUsage() << endl; + for_( it, pool.byIdentBegin( ResKind::srcpackage, "zypper" ), pool.byIdentEnd( ResKind::srcpackage, "zypper" ) ) + { + WAR << *it << endl; + } - pu.status().setTransact( true, ResStatus::USER ); - SEC << zypp::getZYpp()->diskUsage() << endl; /////////////////////////////////////////////////////////////////// Modified: branches/SuSE-Linux-11_0-Branch/libzypp/package/libzypp.changes URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-11_0-Branch/libzypp/package/libzypp.changes?rev=10319&r1=10318&r2=10319&view=diff ============================================================================== --- branches/SuSE-Linux-11_0-Branch/libzypp/package/libzypp.changes (original) +++ branches/SuSE-Linux-11_0-Branch/libzypp/package/libzypp.changes Mon Jun 2 18:00:31 2008 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Mon Jun 2 17:57:22 CEST 2008 - ma@suse.de + +- Allow to skip/abort failed package removal. (bnc #226041) +- revision 10319 + +------------------------------------------------------------------- Mon Jun 2 17:37:02 CEST 2008 - dmacvicar@suse.de - import newer keys if a trusted key is updated Modified: branches/SuSE-Linux-11_0-Branch/libzypp/zypp/target/rpm/RpmDb.cc URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-11_0-Branch/libzypp/zypp/target/rpm/RpmDb.cc?rev=10319&r1=10318&r2=10319&view=diff ============================================================================== --- branches/SuSE-Linux-11_0-Branch/libzypp/zypp/target/rpm/RpmDb.cc (original) +++ branches/SuSE-Linux-11_0-Branch/libzypp/zypp/target/rpm/RpmDb.cc Mon Jun 2 18:00:31 2008 @@ -2110,17 +2110,28 @@ report->start( name_r ); - try - { - doRemovePackage(name_r, flags, report); - } - catch (RpmException & excpt_r) - { - report->problem(excpt_r); //! partial fix to bug #388810, \todo allow to abort/retry failed rpm removal - report->finish(excpt_r); - ZYPP_RETHROW(excpt_r); - } - report->finish(); + do + try + { + doRemovePackage(name_r, flags, report); + report->finish(); + break; + } + catch (RpmException & excpt_r) + { + RpmRemoveReport::Action user = report->problem( excpt_r ); + + if ( user == RpmRemoveReport::ABORT ) + { + report->finish( excpt_r ); + ZYPP_RETHROW(excpt_r); + } + else if ( user == RpmRemoveReport::IGNORE ) + { + break; + } + } + while (true); }
I think this doesn't work as expected, because this rethrowed exception is catched by this code in TargetImpl.cc:700
I know. But the above is now consistent with install. Next it will have to throw AbortRequestException, and the UserRequestExceptions will have to be handled in commit.
continue with removing or installing packages. I now work on it in trunk (more fixes like abort during progress and more) so I can backport some safe part to 11.0.
I need to fix it now in 11.0. We need a well defined behaviour, otherwise we can't handle the patch scripts properly. -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres YaST Development ma@novell.com SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+ -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Michael Andres wrote:
On Tue, Jun 03, Josef Reidinger wrote:
mlandres@svn.opensuse.org wrote:
Author: mlandres Date: Mon Jun 2 18:00:31 2008 New Revision: 10319 URL: http://svn.opensuse.org/viewcvs/zypp?rev=10319&view=rev Log: Allow to skip/abort failed package removal Modified: branches/SuSE-Linux-11_0-Branch/libzypp/devel/devel.ma/NewPool.cc branches/SuSE-Linux-11_0-Branch/libzypp/package/libzypp.changes branches/SuSE-Linux-11_0-Branch/libzypp/zypp/target/rpm/RpmDb.cc Modified: branches/SuSE-Linux-11_0-Branch/libzypp/devel/devel.ma/NewPool.cc URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-11_0-Branch/libzypp/devel/devel.ma/NewPool.cc?rev=10319&r1=10318&r2=10319&view=diff ============================================================================== --- branches/SuSE-Linux-11_0-Branch/libzypp/devel/devel.ma/NewPool.cc (original) +++ branches/SuSE-Linux-11_0-Branch/libzypp/devel/devel.ma/NewPool.cc Mon Jun 2 18:00:31 2008 @@ -561,20 +561,16 @@ SEC << zypp::getZYpp()->diskUsage() << endl; - for_( it, pool.begin(), pool.end() ) + for_( it, pool.byKindBegin<SrcPackage>(), pool.byKindEnd<SrcPackage>() ) { - //MIL << *it << endl; - //DBG << (*it)->diskusage() << endl; + MIL << *it << endl; } - PoolItem pu ( getPi<Package>("amarok") ); - PoolItem pi ( getPi<Package>("amarok",Edition("1.4.7-37")) ); - - pi.status().setTransact( true, ResStatus::USER ); - SEC << zypp::getZYpp()->diskUsage() << endl; + for_( it, pool.byIdentBegin( ResKind::srcpackage, "zypper" ), pool.byIdentEnd( ResKind::srcpackage, "zypper" ) ) + { + WAR << *it << endl; + } - pu.status().setTransact( true, ResStatus::USER ); - SEC << zypp::getZYpp()->diskUsage() << endl; /////////////////////////////////////////////////////////////////// Modified: branches/SuSE-Linux-11_0-Branch/libzypp/package/libzypp.changes URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-11_0-Branch/libzypp/package/libzypp.changes?rev=10319&r1=10318&r2=10319&view=diff ============================================================================== --- branches/SuSE-Linux-11_0-Branch/libzypp/package/libzypp.changes (original) +++ branches/SuSE-Linux-11_0-Branch/libzypp/package/libzypp.changes Mon Jun 2 18:00:31 2008 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Mon Jun 2 17:57:22 CEST 2008 - ma@suse.de + +- Allow to skip/abort failed package removal. (bnc #226041) +- revision 10319 + +------------------------------------------------------------------- Mon Jun 2 17:37:02 CEST 2008 - dmacvicar@suse.de - import newer keys if a trusted key is updated Modified: branches/SuSE-Linux-11_0-Branch/libzypp/zypp/target/rpm/RpmDb.cc URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-11_0-Branch/libzypp/zypp/target/rpm/RpmDb.cc?rev=10319&r1=10318&r2=10319&view=diff ============================================================================== --- branches/SuSE-Linux-11_0-Branch/libzypp/zypp/target/rpm/RpmDb.cc (original) +++ branches/SuSE-Linux-11_0-Branch/libzypp/zypp/target/rpm/RpmDb.cc Mon Jun 2 18:00:31 2008 @@ -2110,17 +2110,28 @@ report->start( name_r ); - try - { - doRemovePackage(name_r, flags, report); - } - catch (RpmException & excpt_r) - { - report->problem(excpt_r); //! partial fix to bug #388810, \todo allow to abort/retry failed rpm removal - report->finish(excpt_r); - ZYPP_RETHROW(excpt_r); - } - report->finish(); + do + try + { + doRemovePackage(name_r, flags, report); + report->finish(); + break; + } + catch (RpmException & excpt_r) + { + RpmRemoveReport::Action user = report->problem( excpt_r ); + + if ( user == RpmRemoveReport::ABORT ) + { + report->finish( excpt_r ); + ZYPP_RETHROW(excpt_r); + } + else if ( user == RpmRemoveReport::IGNORE ) + { + break; + } + } + while (true); }
I think this doesn't work as expected, because this rethrowed exception is catched by this code in TargetImpl.cc:700
I know. But the above is now consistent with install. Next it will have to throw AbortRequestException, and the UserRequestExceptions will have to be handled in commit.
continue with removing or installing packages. I now work on it in trunk (more fixes like abort during progress and more) so I can backport some safe part to 11.0.
I need to fix it now in 11.0. We need a well defined behaviour, otherwise we can't handle the patch scripts properly.
No you are not right, installation break after fail (TargetImpl.cc:681), but remove continue, because doesn't have any break in catch block. Pepa -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On Tue, Jun 03, Josef Reidinger wrote:
I need to fix it now in 11.0. We need a well defined behaviour, otherwise we can't handle the patch scripts properly.
No you are not right, installation break after fail (TargetImpl.cc:681), but remove continue, because doesn't have any break in catch block.
Yes, I still have to fix TargetImpl. -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres YaST Development ma@novell.com SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+ -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
participants (2)
-
Josef Reidinger
-
Michael Andres