Author: dmacvicar
Date: Tue Feb 19 12:02:05 2008
New Revision: 8798
URL: http://svn.opensuse.org/viewcvs/zypp?rev=8798&view=rev
Log:
- avoid upgrading locked packages
(bnc #298022)
- 7.1.1.0_2.13
Modified:
branches/SuSE-SLE-10-SP2-Branch/backend/VERSION
branches/SuSE-SLE-10-SP2-Branch/backend/package/libzypp-zmd-backend.changes
branches/SuSE-SLE-10-SP2-Branch/backend/src/locks.cc
branches/SuSE-SLE-10-SP2-Branch/backend/src/resolve-dependencies.cc
branches/SuSE-SLE-10-SP2-Branch/backend/src/transactions.cc
Modified: branches/SuSE-SLE-10-SP2-Branch/backend/VERSION
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-SLE-10-SP2-Branch/backend/VERSION?rev=8798&r1=8797&r2=8798&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP2-Branch/backend/VERSION (original)
+++ branches/SuSE-SLE-10-SP2-Branch/backend/VERSION Tue Feb 19 12:02:05 2008
@@ -1 +1 @@
-m4_define([BACKEND_VERSION], [7.1.1.0_2.12])
+m4_define([BACKEND_VERSION], [7.1.1.0_2.13])
Modified: branches/SuSE-SLE-10-SP2-Branch/backend/package/libzypp-zmd-backend.changes
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-SLE-10-SP2-Branch/backend/package/libzypp-zmd-backend.changes?rev=8798&r1=8797&r2=8798&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP2-Branch/backend/package/libzypp-zmd-backend.changes (original)
+++ branches/SuSE-SLE-10-SP2-Branch/backend/package/libzypp-zmd-backend.changes Tue Feb 19 12:02:05 2008
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Tue Feb 19 11:34:33 CET 2008 - dmacvicar@suse.de
+
+- avoid upgrading locked packages
+ (bnc #298022)
+- 7.1.1.0_2.13
+
+-------------------------------------------------------------------
Wed Dec 5 11:09:02 CET 2007 - dmacvicar@suse.de
- Close db before commit and reopen after
Modified: branches/SuSE-SLE-10-SP2-Branch/backend/src/locks.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-SLE-10-SP2-Branch/backend/src/locks.cc?rev=8798&r1=8797&r2=8798&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP2-Branch/backend/src/locks.cc (original)
+++ branches/SuSE-SLE-10-SP2-Branch/backend/src/locks.cc Tue Feb 19 12:02:05 2008
@@ -99,11 +99,8 @@
bool operator()( const CapAndItem &cai_r )
{
PoolItem_Ref item(cai_r.item);
- if ( item.status().isInstalled() )
- {
- MIL << "Locking installed " << cai_r.item << "(matched by " << _lock_str << ")" << endl;
- item.status().setLock( true, ResStatus::USER);
- }
+ item.status().setLock( true, ResStatus::USER);
+ MIL << "Locking " << cai_r.item << "(matched by " << _lock_str << ")" << endl;
return true;
}
Modified: branches/SuSE-SLE-10-SP2-Branch/backend/src/resolve-dependencies.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-SLE-10-SP2-Branch/backend/src/resolve-dependencies.cc?rev=8798&r1=8797&r2=8798&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP2-Branch/backend/src/resolve-dependencies.cc (original)
+++ branches/SuSE-SLE-10-SP2-Branch/backend/src/resolve-dependencies.cc Tue Feb 19 12:02:05 2008
@@ -121,6 +121,7 @@
MIL << "Processing " << count << " transactions" << endl;
God->resolver()->setForceResolve( true );
+ MIL << "setForceResolve (true)" << endl;
bool success = true;
if (argc == 3) {
@@ -132,15 +133,21 @@
success = God->resolver()->resolvePool( have_best_package );
}
+ for (typeof (God->pool().byNameBegin("fake-test-a")) it = God->pool().byNameBegin("fake-test-a");
+ it != God->pool().byNameEnd("fake-test-a"); it++)
+ {
+ MIL << *it << endl;
+ }
+
if (count > 0) { // if we really did something
MIL << "Solver " << (success?"was":"NOT") << " successful" << endl;
solver::detail::ResolverContext_Ptr context = God->resolver()->context();
- if (context == NULL) {
- MIL << "Nothing to transact" << endl;
- }
- else if (success) {
+ //if (context == NULL) {
+ // MIL << "Nothing to transact" << endl;
+ // }
+ /*else*/ if (success) {
success = write_transactions( God->pool(), db.db(), context );
}
else {
Modified: branches/SuSE-SLE-10-SP2-Branch/backend/src/transactions.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-SLE-10-SP2-Branch/backend/src/transactions.cc?rev=8798&r1=8797&r2=8798&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP2-Branch/backend/src/transactions.cc (original)
+++ branches/SuSE-SLE-10-SP2-Branch/backend/src/transactions.cc Tue Feb 19 12:02:05 2008
@@ -91,7 +91,7 @@
// complain about locked pool item
static bool
-is_locked( PoolItem_Ref item, PackageOpType action )
+complain_if_locked( PoolItem_Ref item, PackageOpType action )
{
char *action_s = "";
switch ( action )
@@ -109,8 +109,8 @@
return true; // don't honor locks on undefined actions
}
- cerr << "1|" << item_to_string( item ) << " is locked and cannot be " << action_s << endl;
- ERR << item << " is locked and cannot be " << action_s << endl;
+ //cerr << "1|" << item_to_string( item ) << " is locked and cannot be " << action_s << endl;
+ ERR << item << " is locked and cannot be " << action_s << " (ignoring in transaction)" << endl;
return false;
}
@@ -120,14 +120,12 @@
ResObject::constPtr _obj;
PackageOpType _action;
PoolItem_Ref affected;
- bool locked;
// additional requires
ResPool::AdditionalCapSet _aCapSet;
CopyTransaction( ResObject::constPtr obj, PackageOpType action, ResPool::AdditionalCapSet aCapSet )
: _obj( obj )
, _action( action )
- , locked( false )
, _aCapSet(aCapSet)
{ }
@@ -140,29 +138,32 @@
case PACKAGE_OP_REMOVE:
if (check_lock( item ))
{
- locked = true;
- return is_locked( item, _action );
+ return complain_if_locked( item, _action );
}
- item.status().setToBeUninstalled( ResStatus::USER );
+ else
+ item.status().setToBeUninstalled( ResStatus::APPL_HIGH );
break;
case PACKAGE_OP_INSTALL:
if (check_lock( item ))
{
- locked = true;
- return is_locked( item, _action );
+ return complain_if_locked( item, _action );
}
- item.status().setToBeInstalled( ResStatus::USER );
+ else
+ item.status().setToBeInstalled( ResStatus::APPL_HIGH );
break;
case PACKAGE_OP_UPGRADE:
if (check_lock( item ))
{
- locked = true;
- return is_locked( item, _action );
+ return complain_if_locked( item, _action );
}
- item.status().setToBeInstalled( ResStatus::USER );
+ else
+ {
+ item.status().setToBeInstalled( ResStatus::APPL_HIGH );
+ }
break;
case PACKAGE_OP_INSTALL_BEST:
pool_install_best( item.resolvable()->kind(), item.resolvable()->name() );
+ return true;
break;
default:
ERR << "Ignoring unknown action " << _action << endl;
@@ -178,7 +179,7 @@
pool_install_best( const Resolvable::Kind &kind, const std::string &name )
{
// The user is setting this capablility
- _aCapSet[ResStatus::USER].insert (CapFactory().parse( kind, name));
+ _aCapSet[ResStatus::APPL_HIGH].insert (CapFactory().parse( kind, name));
}
};
@@ -244,10 +245,12 @@
functor::functorRef