Zypp Commits
Threads by month
- ----- 2024 -----
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
June 2009
- 5 participants
- 171 discussions
[zypp-commit] <libzypp> SuSE-SLE-10-SP3-Branch : Don't reject modalias dependencies with "op edition" part. (bnc #505627)
by Michael Andres 05 Jun '09
by Michael Andres 05 Jun '09
05 Jun '09
ref: refs/heads/SuSE-SLE-10-SP3-Branch
commit afde8b3df7c345197c1b415eb5240d148e9f4e4a
Author: Michael Andres <ma(a)suse.de>
Date: Fri Jun 5 16:21:45 2009 +0200
Don't reject modalias dependencies with "op edition" part. (bnc #505627)
---
zypp/CapFactory.cc | 7 +------
1 files changed, 1 insertions(+), 6 deletions(-)
diff --git a/zypp/CapFactory.cc b/zypp/CapFactory.cc
index 614243b..f3a6eb2 100644
--- a/zypp/CapFactory.cc
+++ b/zypp/CapFactory.cc
@@ -344,11 +344,6 @@ namespace zypp
Rel op_r = Rel::ANY,
const std::string & value_r = std::string() )
{
- if ( op_r != Rel::ANY )
- {
- ZYPP_THROW( Exception("Unsupported kind of Modalias Capability '" + op_r.asString() + "'") );
- }
-
//split: modalias(name) [op string]
static const str::regex rx( "modalias\\(([^)]*)\\)" );
str::smatch what;
@@ -357,7 +352,7 @@ namespace zypp
// Modalias always refers to 'System' kind of Resolvable.
return usetInsert
( new capability::ModaliasCap( ResTraits<SystemResObject>::kind,
- what[1].str() ) );
+ what[1].str(), op_r, value_r ) );
}
// otherwise
ZYPP_THROW( Exception("Unsupported kind of Modalias Capability'" + name_r + "'") );
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
[zypp-commit] <libzypp> master : Satsolver includes are system includes.
by Michael Andres 05 Jun '09
by Michael Andres 05 Jun '09
05 Jun '09
ref: refs/heads/master
commit 68a3f822faa9e8376c881e6dd2d7fb3a435d7f08
Author: Michael Andres <ma(a)suse.de>
Date: Fri Jun 5 14:21:20 2009 +0200
Satsolver includes are system includes.
---
zypp/sat/AttrMatcher.cc | 2 +-
zypp/solver/detail/SATResolver.cc | 21 +++++++++--------
zypp/solver/detail/SATResolver.h | 10 +++++---
zypp/solver/detail/SolverQueueItem.cc | 11 ++++++---
zypp/solver/detail/SolverQueueItemDelete.cc | 13 ++++++----
zypp/solver/detail/SolverQueueItemInstall.cc | 15 +++++++-----
zypp/solver/detail/SolverQueueItemInstallOneOf.cc | 25 +++++++++++---------
zypp/solver/detail/SolverQueueItemLock.cc | 21 ++++++++++-------
zypp/solver/detail/SolverQueueItemUpdate.cc | 9 +++++--
9 files changed, 74 insertions(+), 53 deletions(-)
diff --git a/zypp/sat/AttrMatcher.cc b/zypp/sat/AttrMatcher.cc
index 026f2ba..146cd5e 100644
--- a/zypp/sat/AttrMatcher.cc
+++ b/zypp/sat/AttrMatcher.cc
@@ -11,7 +11,7 @@
*/
extern "C"
{
-#include "satsolver/repo.h"
+#include <satsolver/repo.h>
}
#include <iostream>
diff --git a/zypp/solver/detail/SATResolver.cc b/zypp/solver/detail/SATResolver.cc
index 7524b4a..e8c3df7 100644
--- a/zypp/solver/detail/SATResolver.cc
+++ b/zypp/solver/detail/SATResolver.cc
@@ -18,6 +18,17 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307, USA.
*/
+extern "C"
+{
+#include <satsolver/repo_solv.h>
+#include <satsolver/poolarch.h>
+#include <satsolver/evr.h>
+#include <satsolver/poolvendor.h>
+#include <satsolver/policy.h>
+#include <satsolver/bitmap.h>
+#include <satsolver/queue.h>
+}
+
#include <sstream>
#include "zypp/solver/detail/Helper.h"
#include "zypp/base/String.h"
@@ -41,16 +52,6 @@
#include "zypp/solver/detail/SolverQueueItemDelete.h"
#include "zypp/solver/detail/SystemCheck.h"
-extern "C" {
-#include "satsolver/repo_solv.h"
-#include "satsolver/poolarch.h"
-#include "satsolver/evr.h"
-#include "satsolver/poolvendor.h"
-#include "satsolver/policy.h"
-#include "satsolver/bitmap.h"
-#include "satsolver/queue.h"
-}
-
/////////////////////////////////////////////////////////////////////////
namespace zypp
{ ///////////////////////////////////////////////////////////////////////
diff --git a/zypp/solver/detail/SATResolver.h b/zypp/solver/detail/SATResolver.h
index 5cb5aba..750731d 100644
--- a/zypp/solver/detail/SATResolver.h
+++ b/zypp/solver/detail/SATResolver.h
@@ -22,6 +22,12 @@
#ifndef ZYPP_SOLVER_DETAIL_SAT_RESOLVER_H
#define ZYPP_SOLVER_DETAIL_SAT_RESOLVER_H
+extern "C"
+{
+#include <satsolver/solver.h>
+#include <satsolver/pool.h>
+}
+
#include <iosfwd>
#include <list>
#include <map>
@@ -36,10 +42,6 @@
#include "zypp/ProblemSolution.h"
#include "zypp/Capability.h"
#include "zypp/solver/detail/SolverQueueItem.h"
-extern "C" {
-#include "satsolver/solver.h"
-#include "satsolver/pool.h"
-}
/////////////////////////////////////////////////////////////////////////
diff --git a/zypp/solver/detail/SolverQueueItem.cc b/zypp/solver/detail/SolverQueueItem.cc
index 21eb527..e7ca81d 100644
--- a/zypp/solver/detail/SolverQueueItem.cc
+++ b/zypp/solver/detail/SolverQueueItem.cc
@@ -17,13 +17,16 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307, USA.
*/
+extern "C"
+{
+#include <satsolver/solver.h>
+}
#include "zypp/base/Logger.h"
#include "zypp/solver/detail/SolverQueueItem.h"
-#include "satsolver/solver.h"
/////////////////////////////////////////////////////////////////////////
-namespace zypp
+namespace zypp
{ ///////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////
namespace solver
@@ -44,10 +47,10 @@ SolverQueueItem::dumpOn( std::ostream & os ) const
switch (_type) {
case QUEUE_ITEM_TYPE_UNKNOWN : os << "unknown"; break;
case QUEUE_ITEM_TYPE_UPDATE : os << "update"; break;
- case QUEUE_ITEM_TYPE_LOCK : os << "lock"; break;
+ case QUEUE_ITEM_TYPE_LOCK : os << "lock"; break;
case QUEUE_ITEM_TYPE_INSTALL : os << "install"; break;
case QUEUE_ITEM_TYPE_DELETE : os << "delete"; break;
- case QUEUE_ITEM_TYPE_INSTALL_ONE_OF: os << "install one of"; break;
+ case QUEUE_ITEM_TYPE_INSTALL_ONE_OF: os << "install one of"; break;
default: os << "?solverqueueitem?"; break;
}
return os;
diff --git a/zypp/solver/detail/SolverQueueItemDelete.cc b/zypp/solver/detail/SolverQueueItemDelete.cc
index 68dfb3d..70c2b28 100644
--- a/zypp/solver/detail/SolverQueueItemDelete.cc
+++ b/zypp/solver/detail/SolverQueueItemDelete.cc
@@ -17,14 +17,17 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307, USA.
*/
+extern "C"
+{
+#include <satsolver/solver.h>
+}
#include "zypp/base/Logger.h"
#include "zypp/IdString.h"
#include "zypp/solver/detail/SolverQueueItemDelete.h"
-#include "satsolver/solver.h"
/////////////////////////////////////////////////////////////////////////
-namespace zypp
+namespace zypp
{ ///////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////
namespace solver
@@ -67,15 +70,15 @@ SolverQueueItemDelete::~SolverQueueItemDelete()
bool SolverQueueItemDelete::addRule (_Queue & q)
{
::Id id = IdString(_name).id();
- if (_soft) {
+ if (_soft) {
queue_push( &(q), SOLVER_ERASE_SOLVABLE_NAME | SOLVER_WEAK);
} else {
- queue_push( &(q), SOLVER_ERASE_SOLVABLE_NAME );
+ queue_push( &(q), SOLVER_ERASE_SOLVABLE_NAME );
}
queue_push( &(q), id);
MIL << "Delete " << _name << (_soft ? "(soft)" : "")
- << " with SAT-Pool: " << id << endl;
+ << " with SAT-Pool: " << id << endl;
return true;
}
diff --git a/zypp/solver/detail/SolverQueueItemInstall.cc b/zypp/solver/detail/SolverQueueItemInstall.cc
index 71923c1..8f8d495 100644
--- a/zypp/solver/detail/SolverQueueItemInstall.cc
+++ b/zypp/solver/detail/SolverQueueItemInstall.cc
@@ -17,15 +17,18 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307, USA.
*/
+extern "C"
+{
+#include <satsolver/solver.h>
+}
#include "zypp/base/Logger.h"
#include "zypp/IdString.h"
#include "zypp/IdStringType.h"
#include "zypp/solver/detail/SolverQueueItemInstall.h"
-#include "satsolver/solver.h"
/////////////////////////////////////////////////////////////////////////
-namespace zypp
+namespace zypp
{ ///////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////
namespace solver
@@ -46,7 +49,7 @@ SolverQueueItemInstall::dumpOn( std::ostream & os ) const
os << "[" << (_soft?"Soft":"") << "Install: "
<< _name
<< "]";
-
+
return os;
}
@@ -69,7 +72,7 @@ SolverQueueItemInstall::~SolverQueueItemInstall()
bool SolverQueueItemInstall::addRule (_Queue & q)
{
::Id id = IdString(_name).id();
- if (_soft) {
+ if (_soft) {
queue_push( &(q), SOLVER_INSTALL_SOLVABLE_NAME | SOLVER_WEAK );
} else {
queue_push( &(q), SOLVER_INSTALL_SOLVABLE_NAME );
@@ -77,7 +80,7 @@ bool SolverQueueItemInstall::addRule (_Queue & q)
queue_push( &(q), id);
MIL << "Install " << _name << (_soft ? "(soft)" : "")
- << " with SAT-PoolID: " << id << endl;
+ << " with SAT-PoolID: " << id << endl;
return true;
}
@@ -100,7 +103,7 @@ SolverQueueItemInstall::cmp (SolverQueueItem_constPtr item) const
SolverQueueItemInstall_constPtr ins = dynamic_pointer_cast<const SolverQueueItemInstall>(item);
if (_name != ins->_name) {
return _name.compare(ins->_name);
- }
+ }
return 0;
}
diff --git a/zypp/solver/detail/SolverQueueItemInstallOneOf.cc b/zypp/solver/detail/SolverQueueItemInstallOneOf.cc
index 191db39..f89149c 100644
--- a/zypp/solver/detail/SolverQueueItemInstallOneOf.cc
+++ b/zypp/solver/detail/SolverQueueItemInstallOneOf.cc
@@ -17,14 +17,17 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307, USA.
*/
+extern "C"
+{
+#include <satsolver/solver.h>
+}
#include "zypp/base/Logger.h"
#include "zypp/solver/detail/SolverQueueItemInstallOneOf.h"
-#include "satsolver/solver.h"
#include "zypp/sat/Pool.h"
/////////////////////////////////////////////////////////////////////////
-namespace zypp
+namespace zypp
{ ///////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////
namespace solver
@@ -48,7 +51,7 @@ SolverQueueItemInstallOneOf::dumpOn( std::ostream & os ) const
iter++)
os << *iter;
os << "]";
-
+
return os;
}
@@ -58,7 +61,7 @@ SolverQueueItemInstallOneOf::SolverQueueItemInstallOneOf (const ResPool & pool,
bool soft)
: SolverQueueItem (QUEUE_ITEM_TYPE_INSTALL_ONE_OF, pool)
, _oneOfList (itemList)
- , _soft (soft)
+ , _soft (soft)
{
}
@@ -74,14 +77,14 @@ bool SolverQueueItemInstallOneOf::addRule (_Queue & q)
bool ret = true;
MIL << "Install one of " << (_soft ? "(soft):" : ":")<< endl;
Queue qs;
-
- if (_soft) {
+
+ if (_soft) {
queue_push( &(q), SOLVER_INSTALL_SOLVABLE_ONE_OF | SOLVER_WEAK);
} else {
queue_push( &(q), SOLVER_INSTALL_SOLVABLE_ONE_OF );
}
- queue_init(&qs);
+ queue_init(&qs);
for (PoolItemList::const_iterator iter = _oneOfList.begin(); iter != _oneOfList.end(); iter++) {
Id id = (*iter)->satSolvable().id();
if (id == ID_NULL) {
@@ -89,13 +92,13 @@ bool SolverQueueItemInstallOneOf::addRule (_Queue & q)
ret = false;
} else {
MIL << " candidate:" << *iter << " with the SAT-Pool ID: " << id << endl;
- queue_push( &(qs), id );
+ queue_push( &(qs), id );
}
}
- sat::Pool satPool( sat::Pool::instance() );
+ sat::Pool satPool( sat::Pool::instance() );
queue_push( &(q), pool_queuetowhatprovides(satPool.get(), &qs));
queue_free(&qs);
-
+
return ret;
}
@@ -105,7 +108,7 @@ SolverQueueItemInstallOneOf::copy (void) const
SolverQueueItemInstallOneOf_Ptr new_installOneOf = new SolverQueueItemInstallOneOf (pool(), _oneOfList);
new_installOneOf->SolverQueueItem::copy(this);
new_installOneOf->_soft = _soft;
-
+
return new_installOneOf;
}
diff --git a/zypp/solver/detail/SolverQueueItemLock.cc b/zypp/solver/detail/SolverQueueItemLock.cc
index 5f9cec3..346aca8 100644
--- a/zypp/solver/detail/SolverQueueItemLock.cc
+++ b/zypp/solver/detail/SolverQueueItemLock.cc
@@ -17,13 +17,16 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307, USA.
*/
+extern "C"
+{
+#include <satsolver/solver.h>
+}
#include "zypp/base/Logger.h"
#include "zypp/solver/detail/SolverQueueItemLock.h"
-#include "satsolver/solver.h"
/////////////////////////////////////////////////////////////////////////
-namespace zypp
+namespace zypp
{ ///////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////
namespace solver
@@ -72,20 +75,20 @@ bool SolverQueueItemLock::addRule (_Queue & q)
return false;
}
MIL << "Lock " << _item << " with the SAT-Pool ID: " << id << endl;
- if (_item.status().isInstalled()) {
- if (_soft) {
+ if (_item.status().isInstalled()) {
+ if (_soft) {
queue_push( &(q), SOLVER_INSTALL_SOLVABLE | SOLVER_WEAK );
} else {
- queue_push( &(q), SOLVER_INSTALL_SOLVABLE );
+ queue_push( &(q), SOLVER_INSTALL_SOLVABLE );
}
} else {
- if (_soft) {
+ if (_soft) {
queue_push( &(q), SOLVER_ERASE_SOLVABLE | SOLVER_WEAK );
} else {
- queue_push( &(q), SOLVER_ERASE_SOLVABLE );
- }
+ queue_push( &(q), SOLVER_ERASE_SOLVABLE );
+ }
}
- queue_push( &(q), id );
+ queue_push( &(q), id );
return true;
}
diff --git a/zypp/solver/detail/SolverQueueItemUpdate.cc b/zypp/solver/detail/SolverQueueItemUpdate.cc
index 695f768..820a61a 100644
--- a/zypp/solver/detail/SolverQueueItemUpdate.cc
+++ b/zypp/solver/detail/SolverQueueItemUpdate.cc
@@ -17,13 +17,16 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307, USA.
*/
+extern "C"
+{
+#include <satsolver/solver.h>
+}
#include "zypp/base/Logger.h"
#include "zypp/solver/detail/SolverQueueItemUpdate.h"
-#include "satsolver/solver.h"
/////////////////////////////////////////////////////////////////////////
-namespace zypp
+namespace zypp
{ ///////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////
namespace solver
@@ -73,7 +76,7 @@ bool SolverQueueItemUpdate::addRule (_Queue & q)
}
MIL << "Update explicit " << _item << " with the SAT-Pool ID: " << id << endl;
queue_push( &(q), SOLVER_INSTALL_SOLVABLE_UPDATE );
- queue_push( &(q), id );
+ queue_push( &(q), id );
return true;
}
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
05 Jun '09
ref: refs/heads/master
commit 5a37ecbb13adcb886e83bda1ce5dfa033ada07ac
Author: Michael Andres <ma(a)suse.de>
Date: Fri Jun 5 13:55:22 2009 +0200
Adapt to libzypp-6.8.0 api changes.
---
package/zypper.changes | 15 ++++++++++-----
src/utils/misc.cc | 2 +-
zypper.spec.cmake | 8 ++++----
3 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/package/zypper.changes b/package/zypper.changes
index e101849..3074f64 100644
--- a/package/zypper.changes
+++ b/package/zypper.changes
@@ -1,4 +1,9 @@
-------------------------------------------------------------------
+Thu Jun 4 16:14:17 CEST 2009 - ma(a)suse.de
+
+- Adapt to libzypp-6.8.0 api changes.
+
+-------------------------------------------------------------------
Fri May 22 12:39:03 CEST 2009 - jkupec(a)suse.cz
- Fixed some help issues (bnc #505938)
@@ -91,7 +96,7 @@ Tue Feb 24 16:38:16 CET 2009 - ma(a)suse.de
- Let 'zypper clean' keep the raw metadata cache of CD/DVD based
repositories. We'd need the CD/DVD again to recreate the data.
- If this is actually desired, explicitly remove an recreate the
+ If this is actually desired, explicitly remove an recreate the
CD/DVD based repository. (bnc #476429).
-------------------------------------------------------------------
@@ -195,7 +200,7 @@ Mon Nov 24 20:44:40 CET 2008 - jkupec(a)suse.cz
Mon Nov 24 16:21:02 CET 2008 - jkupec(a)suse.cz
- fixed generation of solver testcases for verify and dist-upgrade
-- r11789
+- r11789
-------------------------------------------------------------------
Wed Nov 19 15:57:27 CET 2008 - jkupec(a)suse.cz
@@ -476,7 +481,7 @@ Sun Sep 14 00:05:59 CEST 2008 - jkupec(a)suse.cz
- modifyservice --{ar,rr,cl}-to-{enable,disable} options added
(fate #304915)
-- modifyservice can now modify also non-service repos
+- modifyservice can now modify also non-service repos
- r11061
-------------------------------------------------------------------
@@ -544,8 +549,8 @@ Mon Sep 8 19:36:42 CEST 2008 - jkupec(a)suse.cz
-------------------------------------------------------------------
Tue Aug 19 16:39:32 CEST 2008 - dmacvicar(a)suse.de
-- confirm unsupported packages in SLE
- (fate#305057)
+- confirm unsupported packages in SLE
+ (fate#305057)
-------------------------------------------------------------------
Mon Aug 18 17:50:02 CEST 2008 - dmacvicar(a)suse.de
diff --git a/src/utils/misc.cc b/src/utils/misc.cc
index 83d0d04..6c44e8a 100644
--- a/src/utils/misc.cc
+++ b/src/utils/misc.cc
@@ -259,7 +259,7 @@ Pathname cache_rpm(const string & rpm_uri_str, const string & cache_dir)
{
media::MediaManager mm;
media::MediaAccessId mid = mm.open(rpmurl);
- mm.attachDesiredMedia(mid);
+ mm.attach(mid);
mm.provideFile(mid, rpmpath.basename());
Pathname localrpmpath = mm.localPath(mid, rpmpath.basename());
diff --git a/zypper.spec.cmake b/zypper.spec.cmake
index b491ccb..333390f 100644
--- a/zypper.spec.cmake
+++ b/zypper.spec.cmake
@@ -11,11 +11,11 @@
# norootforbuild
Name: @PACKAGE@
-BuildRequires: libzypp-devel >= 6.1.0 boost-devel >= 1.33.1 gettext-devel >= 0.15
+BuildRequires: libzypp-devel >= 6.8.0 boost-devel >= 1.33.1 gettext-devel >= 0.15
BuildRequires: readline-devel >= 5.1 augeas-devel >= 0.5.0
BuildRequires: gcc-c++ >= 4.1 cmake >= 2.4.6
Requires: procps
-Recommends: logrotate cron
+Recommends: logrotate cron
License: GPL v2 or later
Group: System/Packages
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -27,8 +27,8 @@ Release: 0
Source: @PACKAGE@-@VERSION@.tar.bz2
Prefix: /usr
URL: http://en.opensuse.org/Zypper
-Provides: y2pmsh
-Obsoletes: y2pmsh
+Provides: y2pmsh
+Obsoletes: y2pmsh
%description
Command line package management tool using libzypp.
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
04 Jun '09
ref: refs/heads/master
commit 3afc12d3eb27458a64e8957477fa252d450e3da7
Author: Michael Schroeder <mls(a)suse.de>
Date: Thu Jun 4 18:53:43 2009 +0200
- fix bugs in problem handling
---
src/problems.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/problems.c b/src/problems.c
index f76a761..bed7303 100644
--- a/src/problems.c
+++ b/src/problems.c
@@ -392,7 +392,7 @@ convertsolution(Solver *solv, Id why, Queue *solutionq)
break;
}
if (!p)
- p = -solv->rules[why].p; /* XXX: what to do here? */
+ return; /* false alarm */
queue_push(solutionq, SOLVER_SOLUTION_INFARCH);
queue_push(solutionq, p);
return;
@@ -413,7 +413,7 @@ convertsolution(Solver *solv, Id why, Queue *solutionq)
break;
}
if (!p)
- p = -solv->rules[why].p; /* XXX: what to do here? */
+ return; /* false alarm */
queue_push(solutionq, SOLVER_SOLUTION_DISTUPGRADE);
queue_push(solutionq, p);
return;
@@ -565,7 +565,7 @@ create_solutions(Solver *solv, int probnr, int solidx)
if (solv->solutions.count == solstart + 1)
{
solv->solutions.count--;
- if (!essentialok && i + 1 == problem.count)
+ if (!essentialok && i + 1 == problem.count && !nsol)
{
/* nothing found, start over */
essentialok = 1;
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
[zypp-commit] <libzypp> master : Add Solvable::asString "name-version-release.arch"
by Michael Andres 04 Jun '09
by Michael Andres 04 Jun '09
04 Jun '09
ref: refs/heads/master
commit ae0597a9ad43f04b21254f773b5752146fb57972
Author: Michael Andres <ma(a)suse.de>
Date: Thu Jun 4 18:13:55 2009 +0200
Add Solvable::asString "name-version-release.arch"
---
tests/sat/Solvable_test.cc | 18 +++++++++++++++++-
zypp/sat/Solvable.cc | 10 ++++++++++
zypp/sat/Solvable.h | 9 +++++++++
3 files changed, 36 insertions(+), 1 deletions(-)
diff --git a/tests/sat/Solvable_test.cc b/tests/sat/Solvable_test.cc
index cea20dc..0ec48cc 100644
--- a/tests/sat/Solvable_test.cc
+++ b/tests/sat/Solvable_test.cc
@@ -22,6 +22,7 @@ BOOST_AUTO_TEST_CASE(test_init)
{
TestSetup test( Arch_x86_64 );
test.loadRepo( TESTS_SRC_DIR "/data/openSUSE-11.1", "opensuse" );
+ test.loadRepo( TESTS_SRC_DIR "/data/11.0-update", "update" );
}
@@ -84,6 +85,21 @@ BOOST_AUTO_TEST_CASE(attributes)
// check that we actually found all testeable
// resolvables
BOOST_CHECK_EQUAL(c, 2);
+}
-
+BOOST_AUTO_TEST_CASE(asString)
+{
+ BOOST_CHECK_EQUAL( sat::Solvable(0).asString(), "noSolvable" );
+ BOOST_CHECK_EQUAL( sat::Solvable(1).asString(), "systemSolvable" );
+ BOOST_CHECK_EQUAL( sat::Solvable(2).asString(), "product:openSUSE-11.1.x86_64" );
+ BOOST_CHECK_EQUAL( sat::Solvable(3693).asString(), "autoyast2-2.16.19-0.1.src" );
+ BOOST_CHECK_EQUAL( sat::Solvable(19222).asString(), "noSolvable" );
+#if 0
+ Repository r = sat::Pool::instance().reposFind("update");
+ for_( it, r.solvablesBegin(), r.solvablesEnd() )
+ {
+ BOOST_CHECK_EQUAL( (*it).asString(), str::numstring((*it).id()) );
+ }
+#endif
}
+
diff --git a/zypp/sat/Solvable.cc b/zypp/sat/Solvable.cc
index dae6d9f..4757488 100644
--- a/zypp/sat/Solvable.cc
+++ b/zypp/sat/Solvable.cc
@@ -423,6 +423,16 @@ namespace zypp
: Capabilities();
}
+ std::string Solvable::asString() const
+ {
+ NO_SOLVABLE_RETURN( (_id == detail::systemSolvableId ? "systemSolvable" : "noSolvable") );
+ return str::form( "%s-%s.%s",
+ IdString( _solvable->name ).c_str(),
+ IdString( _solvable->evr ).c_str(),
+ IdString( _solvable->arch ).c_str() );
+ }
+
+
///////////////////////////////////////////////////////////////////
namespace
{ /////////////////////////////////////////////////////////////////
diff --git a/zypp/sat/Solvable.h b/zypp/sat/Solvable.h
index 68fbf59..a880630 100644
--- a/zypp/sat/Solvable.h
+++ b/zypp/sat/Solvable.h
@@ -171,6 +171,15 @@ namespace zypp
bool installOnly() const;
+ /** String representation <tt>"ident-edition.arch"</tt> or \c "noSolvable"
+ * \code
+ * product:openSUSE-11.1.x86_64
+ * autoyast2-2.16.19-0.1.src
+ * noSolvable
+ * \endcode
+ */
+ std::string asString() const;
+
public:
/** \name Access to the \ref Solvable dependencies.
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
ref: refs/heads/master
commit 2c4028bbf01df460038eb4cdf438d469f55399e3
Author: Michael Andres <ma(a)suse.de>
Date: Thu Jun 4 15:43:58 2009 +0200
changes 6.8.0
---
VERSION.cmake | 6 +++---
package/libzypp.changes | 6 ++++++
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/VERSION.cmake b/VERSION.cmake
index 9adc136..3d26667 100644
--- a/VERSION.cmake
+++ b/VERSION.cmake
@@ -59,10 +59,10 @@
# changes file. See './mkChangelog -h' for help.
#
SET(LIBZYPP_MAJOR "6")
-SET(LIBZYPP_COMPATMINOR "6")
-SET(LIBZYPP_MINOR "7")
+SET(LIBZYPP_COMPATMINOR "8")
+SET(LIBZYPP_MINOR "8")
SET(LIBZYPP_PATCH "0")
#
-# LAST RELEASED: 6.7.0 (6)
+# LAST RELEASED: 6.8.0 (8)
# (The number in parenthesis is LIBZYPP_COMPATMINOR)
#=======
diff --git a/package/libzypp.changes b/package/libzypp.changes
index 535f176..6e7525e 100644
--- a/package/libzypp.changes
+++ b/package/libzypp.changes
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Thu Jun 4 14:22:58 CEST 2009 - ma(a)suse.de
+
+- Cleanup and remove deprecated interface methods.
+- version 6.8.0 (8)
+
+-------------------------------------------------------------------
Fri May 29 20:12:55 CEST 2009 - ma(a)suse.de
- Improve PoolQuery to allow queries on dependencies. (bnc #475682)
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
[zypp-commit] <libzypp> master : Add doc/autoinclude/Notes.doc. may be used to leave revision specific notes
by Michael Andres 04 Jun '09
by Michael Andres 04 Jun '09
04 Jun '09
ref: refs/heads/master
commit 599aaafeda4313222d51a48052f81074e5670f52
Author: Michael Andres <ma(a)suse.de>
Date: Thu Jun 4 15:43:37 2009 +0200
Add doc/autoinclude/Notes.doc. may be used to leave revision specific notes
---
doc/autoinclude/Notes.doc | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/doc/autoinclude/Notes.doc b/doc/autoinclude/Notes.doc
new file mode 100644
index 0000000..42fbe40
--- /dev/null
+++ b/doc/autoinclude/Notes.doc
@@ -0,0 +1,23 @@
+namespace zypp
+{
+/** \page Notes Notes on revisions
+
+\section V_6_8_0 6.8.0 - Deprecated methods deleted
+\li \c AuthData::setUserName renamed to AuthData::setUsername
+\li \c ResObject::installsize renamed to ResObject::installSize
+\li \c ResObject::size renamed to ResObject::installSize
+\li \c ZConfig::productsPath unused/unneeded/deleted
+\li \c PoolQuery::setMatchFiles unused/unneeded/deleted
+\li \c PoolQuery::matchFiles unused/unneeded/deleted
+\li \c PoolQuery::matchType instead use PoolQuery::matchMode().mode() (returns an enum now, no longer int)
+\li \c Patch::reboot_needed renamed to Patch::rebootSuggested
+\li \c Patch::affects_pkg_manager renamed to Patch::restartSuggested
+\li \c Patch::id unused/unneeded/deleted
+\li \c MediaSetAccess::provideOptionalFile unused/unneeded/deleted
+\li \c Target::reset unused/unneeded/deleted
+\li \c Target::release renamed to Target::targetDistribution
+\li \c MediaManager::attachDesiredMedia renamed to MediaManager::attach
+<HR>
+
+*/
+}
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
[zypp-commit] <libzypp> master : Cleanup and remove deprecated interface methods
by Michael Andres 04 Jun '09
by Michael Andres 04 Jun '09
04 Jun '09
ref: refs/heads/master
commit de3cb28aef5a415033bcdd504a964bc838ac3ad8
Author: Michael Andres <ma(a)suse.de>
Date: Thu Jun 4 15:42:11 2009 +0200
Cleanup and remove deprecated interface methods
---
tests/zypp/MediaSetAccess_test.cc | 25 +++---------------
zypp/CMakeLists.txt | 2 -
zypp/MediaProducts.h | 18 ++++++------
zypp/MediaSetAccess.cc | 51 ++++++-----------------------------
zypp/MediaSetAccess.h | 17 ------------
zypp/Patch.h | 19 -------------
zypp/PoolQuery.h | 13 ---------
zypp/Product.h | 2 +-
zypp/RepoManager.cc | 4 +-
zypp/ResObject.h | 4 ---
zypp/Target.cc | 5 +---
zypp/Target.h | 20 +++-----------
zypp/ZConfig.cc | 12 --------
zypp/ZConfig.h | 7 -----
zypp/base/Regex.h | 12 ++++++++-
zypp/media/CredentialFileReader.cc | 6 ++--
zypp/media/MediaISO.cc | 2 +-
zypp/media/MediaManager.cc | 15 +----------
zypp/media/MediaManager.h | 38 ++++++++++++--------------
zypp/media/MediaNFS.cc | 25 ++++-------------
zypp/media/MediaNFS.h | 4 +--
zypp/media/MediaSMB.cc | 6 ----
zypp/media/MediaSMB.h | 2 -
zypp/media/MediaUserAuth.h | 14 ++++-----
zypp/sat/AttrMatcher.h | 2 -
zypp/target/TargetImpl.cc | 15 ----------
26 files changed, 77 insertions(+), 263 deletions(-)
diff --git a/tests/zypp/MediaSetAccess_test.cc b/tests/zypp/MediaSetAccess_test.cc
index c9efc6e..fc4dd14 100644
--- a/tests/zypp/MediaSetAccess_test.cc
+++ b/tests/zypp/MediaSetAccess_test.cc
@@ -215,7 +215,7 @@ BOOST_AUTO_TEST_CASE(msa_provide_dir)
*/
BOOST_AUTO_TEST_CASE(msa_provide_dirtree)
{
- Url url = (DATADIR + "/src1/cd1").asUrl();
+ Url url = (DATADIR + "/src1/cd1").asUrl();
MediaSetAccess setaccess(url);
Pathname dir = setaccess.provideDir("/dir", true, 1);
@@ -231,28 +231,11 @@ BOOST_AUTO_TEST_CASE(msa_provide_dirtree)
}
/*
- * Provide optional file
- */
-BOOST_AUTO_TEST_CASE(msa_provide_optional_file)
-{
- Url url = (DATADIR + "/src1/cd1").asUrl();
- MediaSetAccess setaccess(url);
-
- // must not throw
- BOOST_CHECK(setaccess.provideOptionalFile("/foo", 1).empty() == true);
-
- Pathname file = setaccess.provideOptionalFile("/test.txt", 1);
- BOOST_CHECK(check_file_exists(file) == true);
-
- //! \todo test provideOptionalFile with not desired media
-}
-
-/*
* file exists local
*/
BOOST_AUTO_TEST_CASE(msa_file_exist_local)
{
- Url url = (DATADIR + "/src1/cd1").asUrl();
+ Url url = (DATADIR + "/src1/cd1").asUrl();
MediaSetAccess setaccess(url);
BOOST_CHECK(setaccess.doesFileExist("/test.txt"));
@@ -272,9 +255,9 @@ BOOST_AUTO_TEST_CASE(msa_remote_tests)
BOOST_CHECK(setaccess.doesFileExist("/test.txt"));
// check providing a file via http works
- Pathname local = setaccess.provideFile("/test.txt");
+ Pathname local = setaccess.provideFile("/test.txt");
BOOST_CHECK(CheckSum::sha1(sha1sum(local)) == CheckSum::sha1("2616e23301d7fcf7ac3324142f8c748cd0b6692b"));
-
+
// providing a file which does not exist should throw
BOOST_CHECK_THROW(setaccess.provideFile("/testBADNAME.txt"), media::MediaFileNotFoundException);
web.stop();
diff --git a/zypp/CMakeLists.txt b/zypp/CMakeLists.txt
index addd92d..2344cec 100644
--- a/zypp/CMakeLists.txt
+++ b/zypp/CMakeLists.txt
@@ -19,7 +19,6 @@ SET( zypp_SRCS
Digest.cc
DiskUsage.cc
DiskUsageCounter.cc
- dummy.cc
Edition.cc
ExternalProgram.cc
Fetcher.cc
@@ -697,7 +696,6 @@ INSTALL( FILES
)
SET( zypp_repo_SRCS
- repo/dummy.cc
repo/RepoException.cc
repo/RepoType.cc
repo/ServiceType.cc
diff --git a/zypp/MediaProducts.h b/zypp/MediaProducts.h
index 909be27..2a6bd9b 100644
--- a/zypp/MediaProducts.h
+++ b/zypp/MediaProducts.h
@@ -31,7 +31,7 @@ namespace zypp
{
Pathname _dir;
std::string _name;
-
+
/**
* \short Ctor
*/
@@ -39,13 +39,13 @@ namespace zypp
: _dir(dir_r), _name(name_r)
{
}
-
+
bool operator<( const MediaProductEntry &rhs ) const
{
return ( _name < rhs._name );
}
};
-
+
/**
* A set of available products in media
*/
@@ -59,7 +59,7 @@ namespace zypp
{
std::ifstream pfile( file_r.asString().c_str() );
while ( pfile.good() ) {
-
+
std::string value = str::getline( pfile, str::TRIM );
if ( pfile.bad() ) {
ERR << "Error parsing " << file_r << std::endl;
@@ -69,13 +69,13 @@ namespace zypp
break; // no data on last line
}
std::string tag = str::stripFirstWord( value, true );
-
+
if ( tag.size() ) {
*result = MediaProductEntry( tag, value );
}
}
}
-
+
/**
* \short Available products in a url location
*
@@ -90,9 +90,9 @@ namespace zypp
media::MediaManager media_mgr;
// open the media
media::MediaId id = media_mgr.open(url_r);
- media_mgr.attachDesiredMedia(id);
+ media_mgr.attach(id);
Pathname products_file = Pathname("media.1/products");
-
+
try {
media_mgr.provideFile (id, products_file);
products_file = media_mgr.localPath (id, products_file);
@@ -104,7 +104,7 @@ namespace zypp
}
media_mgr.release(id, "");
}
-
+
/**
* \short Available products in a url location
*
diff --git a/zypp/MediaSetAccess.cc b/zypp/MediaSetAccess.cc
index 0689cb7..38a2a5e 100644
--- a/zypp/MediaSetAccess.cc
+++ b/zypp/MediaSetAccess.cc
@@ -62,8 +62,6 @@ IMPL_PTR_TYPE(MediaSetAccess);
media_mgr.addVerifier( id, verifier );
// remove any saved verifier for this media
_verifiers.erase(media_nr);
- //if (! noattach && ! media_mgr.isAttached(id))
- //media_mgr.attach(id);
}
else
{
@@ -73,16 +71,6 @@ IMPL_PTR_TYPE(MediaSetAccess);
}
}
-// callback::SendReport<source::DownloadFileReport> report;
-// DownloadProgressFileReceiver download_report( report );
-// SourceFactory source_factory;
-// Url file_url( url().asString() + file_r.asString() );
-// report->start( source_factory.createFrom(this), file_url );
-// callback::TempConnect<media::DownloadProgressReport> tmp_download( download_report );
-// Pathname file = provideJustFile( file_r, media_nr, cached, checkonly );
-// report->finish( file_url, source::DownloadFileReport::NO_ERROR, "" );
-// return file;
-
void MediaSetAccess::releaseFile( const OnMediaLocation & on_media_file )
{
releaseFile( on_media_file.filename(), on_media_file.medianr() );
@@ -112,7 +100,7 @@ IMPL_PTR_TYPE(MediaSetAccess);
// try to attach the media
if ( ! media_mgr.isAttached(media) )
- media_mgr.attachDesiredMedia(media);
+ media_mgr.attach(media);
media_mgr.dirInfo(media, retlist, dirname, dots);
}
@@ -127,7 +115,7 @@ IMPL_PTR_TYPE(MediaSetAccess);
result = media_mgr.localPath(media, file);
}
};
-
+
struct ProvideDirTreeOperation
{
Pathname result;
@@ -153,15 +141,15 @@ IMPL_PTR_TYPE(MediaSetAccess);
struct ProvideFileExistenceOperation
{
bool result;
- ProvideFileExistenceOperation()
- : result(false)
+ ProvideFileExistenceOperation()
+ : result(false)
{}
-
+
void operator()( media::MediaAccessId media, const Pathname &file )
{
media::MediaManager media_mgr;
result = media_mgr.doesFileExist(media, file);
- }
+ }
};
@@ -182,22 +170,6 @@ IMPL_PTR_TYPE(MediaSetAccess);
return op.result;
}
- Pathname MediaSetAccess::provideOptionalFile(const Pathname & file, unsigned media_nr )
- {
- OnMediaLocation resource;
- ProvideFileOperation op;
- resource.setLocation(file, media_nr);
- try {
- provide(boost::ref(op), resource, PROVIDE_NON_INTERACTIVE);
- }
- catch ( const Exception &e )
- {
- ZYPP_CAUGHT(e);
- }
- return op.result;
- }
-
-
bool MediaSetAccess::doesFileExist(const Pathname & file, unsigned media_nr )
{
ProvideFileExistenceOperation op;
@@ -213,7 +185,7 @@ IMPL_PTR_TYPE(MediaSetAccess);
{
Pathname file(resource.filename());
unsigned media_nr(resource.medianr());
-
+
callback::SendReport<media::MediaChangeReport> report;
media::MediaManager media_mgr;
@@ -230,7 +202,7 @@ IMPL_PTR_TYPE(MediaSetAccess);
<< " from media number " << media_nr << endl;
// try to attach the media
if ( ! media_mgr.isAttached(media) )
- media_mgr.attachDesiredMedia(media);
+ media_mgr.attach(media);
op(media, file);
break;
}
@@ -362,7 +334,7 @@ IMPL_PTR_TYPE(MediaSetAccess);
}
ProvideDirOperation op;
provide( boost::ref(op), resource, options);
- return op.result;
+ return op.result;
}
media::MediaAccessId MediaSetAccess::getMediaAccessId (media::MediaNr medianr)
@@ -372,8 +344,6 @@ IMPL_PTR_TYPE(MediaSetAccess);
if (_medias.find(medianr) != _medias.end())
{
media::MediaAccessId id = _medias[medianr];
- //if (! noattach && ! media_mgr.isAttached(id))
- //media_mgr.attach(id);
return id;
}
Url url;
@@ -463,9 +433,6 @@ IMPL_PTR_TYPE(MediaSetAccess);
return str;
}
-// media::MediaVerifierRef MediaSetAccess::verifier(unsigned media_nr)
-// { return media::MediaVerifierRef(new media::NoVerifier()); }
-
/////////////////////////////////////////////////////////////////
} // namespace zypp
///////////////////////////////////////////////////////////////////
diff --git a/zypp/MediaSetAccess.h b/zypp/MediaSetAccess.h
index 24d5b5d..7ec1ff4 100644
--- a/zypp/MediaSetAccess.h
+++ b/zypp/MediaSetAccess.h
@@ -167,23 +167,6 @@ namespace zypp
Pathname provideFile(const Pathname & file, unsigned media_nr = 1, ProvideFileOptions options = PROVIDE_DEFAULT );
/**
- * \deprecated
- * The same as provideFile(Pathname,unsigned) but this method does not
- * call the user callbacks, except of the case of
- * wrong media in the drive, and it won't throw an exception in any case.
- *
- * \return Path to the provided file on success, an empty Pathname() otherwise.
- * This method is obsolete.
- *
- * To avoid interaction with the user,
- * use \ref provideFile with \ref ProvideFileOptions::NON_INTERACTIVE
- * as an option. However you need to handle the exceptions yourself
- * in case of error. If you need ignore functionality, try
- * \ref Fetcher and set \ref OnMediaLocation::setOptional
- */
- ZYPP_DEPRECATED Pathname provideOptionalFile( const Pathname & file, unsigned media_nr = 1 );
-
- /**
* Release file from media.
* This signal that file is not needed anymore.
*
diff --git a/zypp/Patch.h b/zypp/Patch.h
index cd1bc05..867e506 100644
--- a/zypp/Patch.h
+++ b/zypp/Patch.h
@@ -93,18 +93,6 @@ namespace zypp
std::string message( const Locale & lang_r = Locale() ) const;
/**
- * Use \ref rebootSuggested()
- */
- ZYPP_DEPRECATED bool reboot_needed() const
- { return rebootSuggested(); }
-
- /**
- * Use \ref restartSuggested()
- */
- ZYPP_DEPRECATED bool affects_pkg_manager() const
- { return restartSuggested(); }
-
- /**
* Is the patch installation interactive? (does it need user input?)
*/
bool interactive() const;
@@ -130,13 +118,6 @@ namespace zypp
*/
ReferenceIterator referencesEnd() const;
- public:
- /** Patch ID
- * \deprecated Seems to be unsused autobuild interal data?
- */
- ZYPP_DEPRECATED std::string id() const
- { return std::string(); }
-
protected:
friend Ptr make<Self>( const sat::Solvable & solvable_r );
/** Ctor */
diff --git a/zypp/PoolQuery.h b/zypp/PoolQuery.h
index cd80ffc..032650c 100644
--- a/zypp/PoolQuery.h
+++ b/zypp/PoolQuery.h
@@ -454,19 +454,6 @@ namespace zypp
public:
class Impl;
-
- /** \deprecated unused, buggy and useless. */
- ZYPP_DEPRECATED void setMatchFiles() {}
- /** \deprecated unused, buggy and useless. */
- ZYPP_DEPRECATED bool matchFiles() const { return false; }
- /** \deprecated There should be no need for this internal value. To
- * switch across all match mode types, use the enum values returned
- * by \ref matchMode(). \see \ref Match::Mode.
- *
- */
- ZYPP_DEPRECATED int matchType() const { return flags().modeval(); }
-
-
private:
/** Pointer to implementation */
RW_pointer<Impl> _pimpl;
diff --git a/zypp/Product.h b/zypp/Product.h
index 1e1a9d7..f25ecc3 100644
--- a/zypp/Product.h
+++ b/zypp/Product.h
@@ -67,7 +67,7 @@ namespace zypp
/** The product flavor (LiveCD Demo, FTP edition,...). */
std::string flavor() const;
- /** Get the product type (base, add-on)
+ /** Get the product type
* Well, in an ideal world there is only one base product.
* It's the installed product denoted by a symlink in
* \c /etc/products.d.
diff --git a/zypp/RepoManager.cc b/zypp/RepoManager.cc
index 9ab4b3d..59969d8 100644
--- a/zypp/RepoManager.cc
+++ b/zypp/RepoManager.cc
@@ -72,7 +72,7 @@ namespace zypp
{
media::MediaManager mediamanager;
_mid = mediamanager.open( url_r );
- mediamanager.attachDesiredMedia( _mid );
+ mediamanager.attach( _mid );
}
/** Ctor releases the media. */
@@ -1791,7 +1791,7 @@ namespace zypp
// download the repo index file
media::MediaManager mediamanager;
media::MediaAccessId mid = mediamanager.open( service.url() );
- mediamanager.attachDesiredMedia( mid );
+ mediamanager.attach( mid );
mediamanager.provideFile( mid, "repo/repoindex.xml" );
Pathname path = mediamanager.localPath(mid, "repo/repoindex.xml" );
diff --git a/zypp/ResObject.h b/zypp/ResObject.h
index 514ee15..d508dfe 100644
--- a/zypp/ResObject.h
+++ b/zypp/ResObject.h
@@ -153,10 +153,6 @@ namespace zypp
/** Installed size. */
ByteCount installSize() const;
- /** \deprecated Use installSize which is more precise.*/
- ZYPP_DEPRECATED ByteCount installsize() const { return installSize(); }
- /** \deprecated Use installSize which is more precise. */
- ZYPP_DEPRECATED ByteCount size() const { return installSize(); }
/** Size of the rpm package. */
ByteCount downloadSize() const;
diff --git a/zypp/Target.cc b/zypp/Target.cc
index c50bbf4..fc219f4 100644
--- a/zypp/Target.cc
+++ b/zypp/Target.cc
@@ -94,9 +94,6 @@ namespace zypp
Date Target::timestamp() const
{ return _pimpl->timestamp(); }
- std::string Target::release() const
- { return _pimpl->release(); }
-
std::string Target::distributionFlavor() const
{ return _pimpl->distributionFlavor(); }
@@ -114,7 +111,7 @@ namespace zypp
Product::constPtr Target::baseProduct() const
{ return _pimpl->baseProduct(); }
-
+
/////////////////////////////////////////////////////////////////
} // namespace zypp
diff --git a/zypp/Target.h b/zypp/Target.h
index 2dd9d3c..a463e14 100644
--- a/zypp/Target.h
+++ b/zypp/Target.h
@@ -76,10 +76,6 @@ namespace zypp
*/
void unload();
- /** \deprecated NOOP
- */
- ZYPP_DEPRECATED void reset() {}
-
/** Null implementation */
static Target_Ptr nullimpl();
@@ -118,21 +114,13 @@ namespace zypp
* if you require some base product attributes when the
* target is not loaded into the pool, see
* \ref targetDistribution , \ref targetDistributionRelease
- * and \ref distributionVersion that obtain the data
+ * and \ref distributionVersion that obtain the data
* on demand from the installed product information.
*/
Product::constPtr baseProduct() const;
/** \name Base product and registration. */
//@{
- /** The targets distribution release string (/etc/SuSE-release)
- * \code
- * openSUSE 10.3 (i586)
- * \endcode
- * \deprecated \ref targetDistribution might be a better choice as it does not depend on /etc/SuSE-release.
- */
- std::string release() const ZYPP_DEPRECATED;
-
/** This is \c register.target attribute of the installed base product.
* Used for registration and \ref Service refresh.
*/
@@ -150,7 +138,7 @@ namespace zypp
*/
std::string distributionVersion() const;
//@}
-
+
/**
* This is \flavor attribute of the installed base product
@@ -159,8 +147,8 @@ namespace zypp
* been loaded, as the value is not present in the system
* but computer from a package provides
*/
- std::string distributionFlavor() const;
-
+ std::string distributionFlavor() const;
+
/**
* anonymous unique id
*
diff --git a/zypp/ZConfig.cc b/zypp/ZConfig.cc
index 7e17ad0..3b83db4 100644
--- a/zypp/ZConfig.cc
+++ b/zypp/ZConfig.cc
@@ -321,11 +321,6 @@ namespace zypp
{
cfg_vendor_path = Pathname(value);
}
- else if ( entry == "productsdir" )
- {
- WAR << "Deprecated entry 'productsdir=': This locations is no longer used or supported." << endl;
- cfg_products_path = Pathname(value);
- }
else if ( entry == "solver.onlyRequires" )
{
solver_onlyRequires.set( str::strToBool( value, solver_onlyRequires.get() ) );
@@ -425,7 +420,6 @@ namespace zypp
Pathname cfg_known_repos_path;
Pathname cfg_known_services_path;
Pathname cfg_vendor_path;
- Pathname cfg_products_path;
Pathname locks_file;
Pathname update_data_path;
@@ -598,12 +592,6 @@ namespace zypp
? (configPath()/"vendors.d") : _pimpl->cfg_vendor_path );
}
- Pathname ZConfig::productsPath() const
- {
- return ( _pimpl->cfg_products_path.empty()
- ? (configPath()/"products.d") : _pimpl->cfg_products_path );
- }
-
Pathname ZConfig::locksFile() const
{
return ( _pimpl->locks_file.empty()
diff --git a/zypp/ZConfig.h b/zypp/ZConfig.h
index 6d66838..02d3726 100644
--- a/zypp/ZConfig.h
+++ b/zypp/ZConfig.h
@@ -211,13 +211,6 @@ namespace zypp
Pathname vendorPath() const;
/**
- * Directory for additional product information (configPath()/products.d)
- * \ingroup g_ZC_CONFIGFILES
- * \deprecated This locations is no longer used or supported.
- */
- Pathname productsPath() const ZYPP_DEPRECATED;
-
- /**
* Solver regards required packages,patterns,... only
*/
bool solver_onlyRequires() const;
diff --git a/zypp/base/Regex.h b/zypp/base/Regex.h
index a6fe0f6..77424e6 100644
--- a/zypp/base/Regex.h
+++ b/zypp/base/Regex.h
@@ -31,7 +31,9 @@ namespace zypp
/** \defgroup ZYPP_STR_REGEX Regular expressions
*
* Namespace zypp::str regular expressions \b using the glibc regex library.
- *
+ *
+ * \see \ref sat::AttrMatcher string matcher supporing regex, globing, etc.
+ *
* regex
* regex_match
* smatch
@@ -50,6 +52,10 @@ namespace zypp
inline bool regex_match(const std::string& s, const regex& regex)
{ return regex_match( s.c_str(), regex ); }
+ /**
+ * \see \ref sat::AttrMatcher string matcher supporing regex, globing, etc.
+ * \ingroup ZYPP_STR_REGEX
+ */
class regex {
public:
@@ -96,6 +102,10 @@ namespace zypp
bool m_valid;
};
+ /**
+ * \ingroup ZYPP_STR_REGEX
+ * \see regex
+ */
class smatch {
public:
smatch();
diff --git a/zypp/dummy.cc b/zypp/dummy.cc
deleted file mode 100644
index e69de29..0000000
diff --git a/zypp/media/CredentialFileReader.cc b/zypp/media/CredentialFileReader.cc
index 13f9a50..853a587 100644
--- a/zypp/media/CredentialFileReader.cc
+++ b/zypp/media/CredentialFileReader.cc
@@ -33,7 +33,7 @@ namespace zypp
//////////////////////////////////////////////////////////////////////
//
- // CLASS NAME : CredentialFileReader
+ // CLASS NAME : CredentialFileReader
//
//////////////////////////////////////////////////////////////////////
@@ -61,7 +61,7 @@ namespace zypp
AuthData_Ptr credentials;
credentials.reset(new AuthData());
-
+
// set url
if (storedUrl.isValid())
credentials->setUrl(storedUrl);
@@ -71,7 +71,7 @@ namespace zypp
++it)
{
if (it->first == "username")
- credentials->setUserName(it->second);
+ credentials->setUsername(it->second);
else if (it->first == "password")
credentials->setPassword(it->second);
else
diff --git a/zypp/media/MediaISO.cc b/zypp/media/MediaISO.cc
index dc7ea99..3fee74f 100644
--- a/zypp/media/MediaISO.cc
+++ b/zypp/media/MediaISO.cc
@@ -182,7 +182,7 @@ namespace zypp
ZYPP_THROW(MediaNotSupportedException(_url));
MediaManager manager;
- manager.attach(_parentId, false);
+ manager.attach(_parentId);
try
{
diff --git a/zypp/media/MediaManager.cc b/zypp/media/MediaManager.cc
index d4956d4..535110b 100644
--- a/zypp/media/MediaManager.cc
+++ b/zypp/media/MediaManager.cc
@@ -561,20 +561,7 @@ namespace zypp
}
// ---------------------------------------------------------------
- void
- MediaManager::attach(MediaAccessId accessId, bool next)
- {
- MutexLock glock(g_Mutex);
-
- ManagedMedia &ref( m_impl->findMM(accessId));
-
- DBG << "attach(id=" << accessId << ")" << std::endl;
-
- return ref.handler->attach(next);
- }
-
- // ---------------------------------------------------------------
- void MediaManager::attachDesiredMedia(MediaAccessId accessId)
+ void MediaManager::attach(MediaAccessId accessId)
{
MutexLock glock(g_Mutex);
diff --git a/zypp/media/MediaManager.h b/zypp/media/MediaManager.h
index 84fc725..65c3d01 100644
--- a/zypp/media/MediaManager.h
+++ b/zypp/media/MediaManager.h
@@ -216,7 +216,7 @@ namespace zypp
* Mandatory parameter specifying the name of the block device of
* the partition to mount.
* - <tt>filesystem</tt>:
- * The name of the filesystem. Defaults to "auto".
+ * The name of the filesystem. Defaults to "auto".
* - Authority:
* A non-empty authority URL component is not allowed.
* - Path name:
@@ -234,7 +234,7 @@ namespace zypp
* "file:/directory/name"
* \endcode
* - Query parameters:
- * none
+ * none
* - Authority:
* A non-empty authority URL component (e.g. containing
* a host name) is not allowed.
@@ -253,7 +253,7 @@ namespace zypp
*
* "iso:/?iso=CD1.iso&url=nfs://server/path/to/media"
* "iso:/?iso=CD1.iso&url=hd:/?device=/dev/hda"
- *
+ *
* "iso:/subdir?iso=DVD1.iso&url=nfs://nfs-server/directory&mnt=/nfs/attach/point&filesystem=udf"
* \endcode
* - Query parameters:
@@ -271,7 +271,7 @@ namespace zypp
* source media url.
* - <tt>filesystem</tt>:
* Optional name of the filesystem used in the iso file. Defaults
- * to "auto".
+ * to "auto".
* - Authority:
* A non-empty authority URL component is not allowed.
* - Path name:
@@ -334,7 +334,7 @@ namespace zypp
* Mandatory URL component, that specifies the share name with
* optional subdirectory, where the desired files are located.
*
- * \subsection MediaCurl_Url MediaCurl - FTP/HTTP directory tree (ftp, http, https)
+ * \subsection MediaCurl_Url MediaCurl - FTP/HTTP directory tree (ftp, http, https)
* The access handler to media directory tree on a ftp/http server.
* - Scheme:
* - <b>ftp</b>
@@ -390,11 +390,11 @@ namespace zypp
* enables ssl verify, this is the default
* and is equivalent to 'host,peer'.
* - 'host': The server is considered the intended one, when the
- * 'Common Name' field or a 'Subject Alternate Name' field in
+ * 'Common Name' field or a 'Subject Alternate Name' field in
* the certificate matches the host name in the URL.
* - 'peer': Verifies whether the certificate provided by the
* server is authentic against the chain of digital signatures
- * found in <tt>ssl_capath</tt>.
+ * found in <tt>ssl_capath</tt>.
* - <tt>timeout</tt>:
* Transfer timeout in seconds between 0 and 3600, 0 disables
* the timeout, default timeout is 180 seconds.
@@ -402,7 +402,7 @@ namespace zypp
* method names to use: 'basic', 'digest', 'ntlm', 'negotiate',
* 'spnego', 'gssnego'.
* Note, that this list depends on the list of methods supported
- * by the curl library.
+ * by the curl library.
* - Authority:
* The authority component has to provide a hostname. Optionally
* also a username and password. In case of the 'ftp' scheme,
@@ -567,22 +567,20 @@ namespace zypp
setAttachPrefix(const Pathname &attach_prefix);
/**
- * Attach the media using the concrete handler.
+ * Attach the media using the concrete handler (checks all devices).
*
* Remember to release() or close() each id you've attached
* and not need any more. Attach is like an open of a file!
*
* \param accessId A media access id.
- * \param next Whether to try the next drive if avaliable.
* \throws MediaNotOpenException for invalid access id.
- * \deprecated in favor of attachDesiredMedia(MediaAccessId) which looks
- * for a desirable media on all available devices.
*/
void
- attach(MediaAccessId accessId, bool next = false) ZYPP_DEPRECATED;
+ attach(MediaAccessId accessId);
- void
- attachDesiredMedia(MediaAccessId accessId);
+ /** \deprecated Simply use \ref attach. */
+ ZYPP_DEPRECATED void attachDesiredMedia(MediaAccessId accessId)
+ { attach( accessId ); }
/**
* Release the attached media and optionally eject.
@@ -590,7 +588,7 @@ namespace zypp
* If the \p ejectDev parameter is not empty all other access
* id's are released and the specified drive (CD/DVD drive) is
* ejected.
- *
+ *
* \param accessId A media access id.
* \param ejectDev Device to eject. None if empty.
* \throws MediaNotOpenException for invalid access id.
@@ -672,8 +670,8 @@ namespace zypp
* Simple check, based on media's URL scheme, telling whether the
* it is possible to physically change the media inside its drive, like
* CDs or DVDs. Useful to decide whether to request media change from
- * user or not.
- *
+ * user or not.
+ *
* \param accessId The media access id.
* \return <tt>false</tt> if the media is not changeable,
* <tt>true</tt> otherwise.
@@ -798,7 +796,7 @@ namespace zypp
* Fill in a vector of detected ejectable devices and the index of the
* currently attached device within the vector. The contents of the vector
* are the device names (/dev/cdrom and such).
- *
+ *
* \param accessId Medium id.
* \param devices vector to load with the device names
* \param index index of the currently used device in the devices vector
@@ -835,7 +833,7 @@ namespace zypp
bool
isUseableAttachPoint(const Pathname &path,
bool mtab=true) const;
-
+
private:
friend class MediaHandler;
diff --git a/zypp/media/MediaNFS.cc b/zypp/media/MediaNFS.cc
index 1ed1269..ec34874 100644
--- a/zypp/media/MediaNFS.cc
+++ b/zypp/media/MediaNFS.cc
@@ -30,7 +30,7 @@ namespace zypp {
// CLASS NAME : MediaNFS
//
///////////////////////////////////////////////////////////////////
-
+
///////////////////////////////////////////////////////////////////
//
//
@@ -187,19 +187,6 @@ namespace zypp {
///////////////////////////////////////////////////////////////////
//
//
- // METHOD NAME : MediaNFS::releaseFrom
- // METHOD TYPE : PMError
- //
- // DESCRIPTION : Asserted that media is attached.
- //
- void MediaNFS::releaseFrom( bool eject )
- {
- releaseFrom( "" );
- }
-
- ///////////////////////////////////////////////////////////////////
- //
- //
// METHOD NAME : MediaNFS::releaseFrom
// METHOD TYPE : void
//
@@ -222,7 +209,7 @@ namespace zypp {
{
MediaHandler::getFile( filename );;
}
-
+
///////////////////////////////////////////////////////////////////
//
// METHOD NAME : MediaNFS::getDir
@@ -234,7 +221,7 @@ namespace zypp {
{
MediaHandler::getDir( dirname, recurse_r );
}
-
+
///////////////////////////////////////////////////////////////////
//
//
@@ -248,7 +235,7 @@ namespace zypp {
{
MediaHandler::getDirInfo( retlist, dirname, dots );
}
-
+
///////////////////////////////////////////////////////////////////
//
//
@@ -266,8 +253,8 @@ namespace zypp {
bool MediaNFS::getDoesFileExist( const Pathname & filename ) const
{
return MediaHandler::getDoesFileExist( filename );
- }
+ }
+
-
} // namespace media
} // namespace zypp
diff --git a/zypp/media/MediaNFS.h b/zypp/media/MediaNFS.h
index 10d1478..eea5daf 100644
--- a/zypp/media/MediaNFS.h
+++ b/zypp/media/MediaNFS.h
@@ -38,9 +38,7 @@ namespace zypp {
protected:
virtual void attachTo (bool next = false);
-
- /** \deprecated in favor of releaseFrom(string&) */
- virtual void releaseFrom( bool eject ) ZYPP_DEPRECATED;
+
virtual void releaseFrom( const std::string & ejectDev );
virtual void getFile( const Pathname & filename ) const;
virtual void getDir( const Pathname & dirname, bool recurse_r ) const;
diff --git a/zypp/media/MediaSMB.cc b/zypp/media/MediaSMB.cc
index 8ba2b9d..84b4fd5 100644
--- a/zypp/media/MediaSMB.cc
+++ b/zypp/media/MediaSMB.cc
@@ -341,12 +341,6 @@ namespace zypp {
mount.umount(attachPoint().asString());
}
- // deprecated
- void MediaSMB::releaseFrom( bool eject )
- {
- releaseFrom( "" );
- }
-
///////////////////////////////////////////////////////////////////
//
// METHOD NAME : MediaSMB::getFile
diff --git a/zypp/media/MediaSMB.h b/zypp/media/MediaSMB.h
index 04cf836..41d3f11 100644
--- a/zypp/media/MediaSMB.h
+++ b/zypp/media/MediaSMB.h
@@ -44,8 +44,6 @@ namespace zypp {
protected:
virtual void attachTo (bool next = false);
- /** \deprecated in favor of releaseFrom(string&) */
- virtual void releaseFrom( bool eject ) ZYPP_DEPRECATED;
virtual void releaseFrom( const std::string & ejectDev );
virtual void getFile( const Pathname & filename ) const;
virtual void getDir( const Pathname & dirname, bool recurse_r ) const;
diff --git a/zypp/media/MediaUserAuth.h b/zypp/media/MediaUserAuth.h
index 252e591..afa58de 100644
--- a/zypp/media/MediaUserAuth.h
+++ b/zypp/media/MediaUserAuth.h
@@ -46,19 +46,17 @@ public:
/**
* Checks validity of authentication data.
* \return true if the object contains non-empty username and
- * non-empty password, false otherwise.
+ * non-empty password, false otherwise.
*/
virtual bool valid() const;
void setUrl(const Url & url) { _url = url; }
void setUsername(const std::string & username) { _username = username; }
- /** \deprecated use setUsername() instead */
- ZYPP_DEPRECATED void setUserName(const std::string & username) { _username = username; }
- void setPassword(const std::string & password) { _password = password; }
+ void setPassword(const std::string & password) { _password = password; }
Url url() const { return _url; }
std::string username() const { return _username; }
- std::string password() const { return _password; }
+ std::string password() const { return _password; }
virtual std::ostream & dumpOn( std::ostream & str ) const;
@@ -105,7 +103,7 @@ public:
/**
* Checks validity of authentication data.
* \return true if the object contains non-empty username,
- * non-empty password, and specifies authentication type; false otherwise.
+ * non-empty password, and specifies authentication type; false otherwise.
*/
virtual bool valid() const;
@@ -132,7 +130,7 @@ public:
long authType() { return _auth_type; } const
std::string authTypeAsString() { return _auth_type_str; } const
- std::string getUserPwd() const { return username() + ":" + password(); }
+ std::string getUserPwd() const { return username() + ":" + password(); }
/**
@@ -140,7 +138,7 @@ public:
* into a long of ORed CURLAUTH_* identifiers.
* The method also automatically leaves out any auth types declared
* not supported by curl_version_info().
- *
+ *
* \throws MediaException if an invalid authentication type name is
* encountered.
*/
diff --git a/zypp/repo/dummy.cc b/zypp/repo/dummy.cc
deleted file mode 100644
index e69de29..0000000
diff --git a/zypp/sat/AttrMatcher.h b/zypp/sat/AttrMatcher.h
index 155733a..9b3bc64 100644
--- a/zypp/sat/AttrMatcher.h
+++ b/zypp/sat/AttrMatcher.h
@@ -34,8 +34,6 @@ namespace zypp
//
/** String matching option flags as used e.g. by \ref sat::AttrMatcher.
*
- *
- *
* \code
* Match mode( Match::GLOB | Match::NOCASE );
* \endcode
diff --git a/zypp/target/TargetImpl.cc b/zypp/target/TargetImpl.cc
index 92ff04e..5513bea 100644
--- a/zypp/target/TargetImpl.cc
+++ b/zypp/target/TargetImpl.cc
@@ -1019,21 +1019,6 @@ namespace zypp
///////////////////////////////////////////////////////////////////
- std::string TargetImpl::release() const
- {
- std::ifstream suseRelease( (_root / "/etc/SuSE-release").c_str() );
- for( iostr::EachLine in( suseRelease ); in; in.next() )
- {
- std::string line( str::trim( *in ) );
- if ( ! line.empty() )
- return line;
- }
-
- return _("Unknown Distribution");
- }
-
- ///////////////////////////////////////////////////////////////////
-
Product::constPtr TargetImpl::baseProduct() const
{
ResPool pool(ResPool::instance());
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
[zypp-commit] <libzypp> master : Remove deprecated virtualconflicts flag.
by Michael Andres 04 Jun '09
by Michael Andres 04 Jun '09
04 Jun '09
ref: refs/heads/master
commit cd282a79aef426c9803f7e6e441a291797dd00f8
Author: Michael Andres <ma(a)suse.de>
Date: Thu Jun 4 12:16:33 2009 +0200
Remove deprecated virtualconflicts flag.
---
zypp/solver/detail/Resolver.cc | 1 -
zypp/solver/detail/SATResolver.cc | 3 ---
zypp/solver/detail/SATResolver.h | 4 ----
3 files changed, 0 insertions(+), 8 deletions(-)
diff --git a/zypp/solver/detail/Resolver.cc b/zypp/solver/detail/Resolver.cc
index d980dee..90a6388 100644
--- a/zypp/solver/detail/Resolver.cc
+++ b/zypp/solver/detail/Resolver.cc
@@ -269,7 +269,6 @@ void Resolver::solverInit()
_satResolver->setAllowvendorchange ( allowVendorChange() );
_satResolver->setAllowuninstall ( forceResolve() );
_satResolver->setUpdatesystem (false);
- _satResolver->setAllowvirtualconflicts (false);
_satResolver->setNoupdateprovide (false);
_satResolver->setDosplitprovides (false);
_satResolver->setSolveSrcPackages ( solveSrcPackages() );
diff --git a/zypp/solver/detail/SATResolver.cc b/zypp/solver/detail/SATResolver.cc
index 3cfd604..7524b4a 100644
--- a/zypp/solver/detail/SATResolver.cc
+++ b/zypp/solver/detail/SATResolver.cc
@@ -116,7 +116,6 @@ SATResolver::dumpOn( std::ostream & os ) const
os << " allowvendorchange = " << _solv->allowvendorchange << endl;
os << " allowuninstall = " << _solv->allowuninstall << endl;
os << " updatesystem = " << _solv->updatesystem << endl;
- os << " allowvirtualconflicts = " << _solv->allowvirtualconflicts << endl;
os << " noupdateprovide = " << _solv->noupdateprovide << endl;
os << " dosplitprovides = " << _solv->dosplitprovides << endl;
os << " onlyRequires = " << _solv->dontinstallrecommended << endl;
@@ -142,7 +141,6 @@ SATResolver::SATResolver (const ResPool & pool, Pool *SATPool)
, _allowvendorchange(false)
, _allowuninstall(false)
, _updatesystem(false)
- , _allowvirtualconflicts(false)
, _noupdateprovide(false)
, _dosplitprovides(false)
, _onlyRequires(ZConfig::instance().solver_onlyRequires())
@@ -422,7 +420,6 @@ SATResolver::solving(const CapabilitySet & requires_caps,
_solv->allowuninstall = _allowuninstall;
_solv->allowarchchange = _allowarchchange;
_solv->allowvendorchange = _allowvendorchange;
- _solv->allowvirtualconflicts = _allowvirtualconflicts;
_solv->dosplitprovides = _dosplitprovides;
_solv->noupdateprovide = _noupdateprovide;
_solv->dontinstallrecommended = _onlyRequires;
diff --git a/zypp/solver/detail/SATResolver.h b/zypp/solver/detail/SATResolver.h
index 144816d..5cb5aba 100644
--- a/zypp/solver/detail/SATResolver.h
+++ b/zypp/solver/detail/SATResolver.h
@@ -88,7 +88,6 @@ class SATResolver : public base::ReferenceCounted, private base::NonCopyable {
bool _allowvendorchange; // allow to change vendor of installed solvables
bool _allowuninstall; // allow removal of installed solvables
bool _updatesystem; // update
- bool _allowvirtualconflicts; // false: conflicts on package name, true: conflicts on package provides
bool _noupdateprovide; // true: update packages needs not to provide old package
bool _dosplitprovides; // true: consider legacy split provides
bool _onlyRequires; // true: consider required packages only
@@ -187,9 +186,6 @@ class SATResolver : public base::ReferenceCounted, private base::NonCopyable {
bool updatesystem () const {return _updatesystem;}
void setUpdatesystem ( const bool updatesystem) { _updatesystem = updatesystem;}
- bool allowvirtualconflicts () const {return _allowvirtualconflicts;}
- void setAllowvirtualconflicts ( const bool allowvirtualconflicts) { _allowvirtualconflicts = allowvirtualconflicts;}
-
bool noupdateprovide () const {return _noupdateprovide;}
void setNoupdateprovide ( const bool noupdateprovide) { _noupdateprovide = noupdateprovide;}
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0
[zypp-commit] <sat-solver> master : - move some flags describing the rpm from solver to pool
by Michael Schroeder 04 Jun '09
by Michael Schroeder 04 Jun '09
04 Jun '09
ref: refs/heads/master
commit e6b243e99812cc58cea001d9120d76fb382e27d8
Author: Michael Schroeder <mls(a)suse.de>
Date: Thu Jun 4 11:42:08 2009 +0200
- move some flags describing the rpm from solver to pool
- change prune_to_best_version to just need a pool pointer
- create a new type containing transaction data
- change transaction code to work with a pool, not a solver
- add solver_calculate_noobsmap() helper function that calculates
the noobsoletes map from a solver job
---
applayer/xsolvable.c | 4 +-
bindings/pool.i | 107 +++++++++
bindings/solver.i | 107 ---------
src/bitmap.c | 2 +-
src/policy.c | 28 ++--
src/policy.h | 3 +-
src/pool.h | 7 +-
src/rules.c | 12 +-
src/solver.c | 45 +++--
src/solver.h | 10 +-
src/solverdebug.c | 16 +-
src/transaction.c | 226 +++++++++++---------
src/transaction.h | 25 ++-
.../install-zypper-force-test.solution | 4 +-
.../install-zypper-noforce-test.solution | 4 +-
tests/solver/deptestomatic.c | 26 +--
16 files changed, 338 insertions(+), 288 deletions(-)
diff --git a/applayer/xsolvable.c b/applayer/xsolvable.c
index be77b17..eedb12e 100644
--- a/applayer/xsolvable.c
+++ b/applayer/xsolvable.c
@@ -152,7 +152,6 @@ xsolvable_find( Pool *pool, char *name, const Repo *repo )
Queue plist;
int i, end;
Solvable *s;
- Solver *solver = solver_create(pool); /* XXX: who sets those flags? */
id = str2id( pool, name, 1 );
queue_init( &plist);
@@ -169,8 +168,7 @@ xsolvable_find( Pool *pool, char *name, const Repo *repo )
}
prune_to_best_arch(pool, &plist);
- prune_to_best_version(solver, &plist);
- solver_free(solver);
+ prune_to_best_version(pool, &plist);
if (plist.count == 0) {
return NULL;
}
diff --git a/bindings/pool.i b/bindings/pool.i
index dbf1121..85a8caf 100644
--- a/bindings/pool.i
+++ b/bindings/pool.i
@@ -210,6 +210,113 @@ typedef struct _Pool {} Pool;
void set_promoteepoch( int b )
{ $self->promoteepoch = b; }
+#if defined(SWIGRUBY)
+ %typemap(out) int no_virtual_conflicts
+ "$result = $1 ? Qtrue : Qfalse;";
+#endif
+ /*
+ * Allow virtual conflicts
+ *
+ * call-seq:
+ * pool.no_virtual_conflicts -> bool
+ *
+ */
+ int no_virtual_conflicts()
+ { return $self->novirtualconflicts; }
+
+#if defined(SWIGRUBY)
+ %rename( "no_virtual_conflicts=" ) set_no_virtual_conflicts( int bflag );
+#endif
+ /*
+ * call-seq:
+ * pool.no_virtual_conflicts = true
+ *
+ */
+ void set_no_virtual_conflicts( int bflag )
+ { $self->novirtualconflicts = bflag; }
+
+#if defined(SWIGRUBY)
+ %typemap(out) int allow_self_conflicts
+ "$result = $1 ? Qtrue : Qfalse;";
+#endif
+ /*
+ * Allow self conflicts
+ *
+ * If a package can conflict with itself
+ *
+ * call-seq:
+ * pool.allow_self_conflicts -> bool
+ *
+ */
+ int allow_self_conflicts()
+ { return $self->allowselfconflicts; }
+
+#if defined(SWIGRUBY)
+ %rename( "allow_self_conflicts=" ) set_allow_self_conflicts( int bflag );
+#endif
+ /*
+ * call-seq:
+ * pool.allow_self_conflicts = true
+ *
+ */
+ void set_allow_self_conflicts( int bflag )
+ { $self->allowselfconflicts = bflag; }
+
+#if defined(SWIGRUBY)
+ %typemap(out) int obsolete_uses_provides
+ "$result = $1 ? Qtrue : Qfalse;";
+#endif
+ /*
+ * Obsolete uses provides
+ *
+ * Obsolete dependencies usually match on package names only.
+ * Setting this flag will make obsoletes also match a provides.
+ *
+ * call-seq:
+ * pool.obsolete_uses_provides -> bool
+ *
+ */
+ int obsolete_uses_provides()
+ { return $self->obsoleteusesprovides; }
+
+#if defined(SWIGRUBY)
+ %rename( "obsolete_uses_provides=" ) set_obsolete_uses_provides( int bflag );
+#endif
+ /*
+ * Obsolete uses provides
+ *
+ * call-seq:
+ * pool.obsolete_uses_provides = true
+ *
+ */
+ void set_obsolete_uses_provides( int bflag )
+ { $self->obsoleteusesprovides= bflag; }
+
+#if defined(SWIGRUBY)
+ %typemap(out) int implicit_obsolete_uses_provides
+ "$result = $1 ? Qtrue : Qfalse;";
+#endif
+ /*
+ * Implicit obsolete uses provides
+ *
+ * call-seq:
+ * pool.implicit_obsolete_uses_provides -> bool
+ *
+ */
+ int implicit_obsolete_uses_provides()
+ { return $self->implicitobsoleteusesprovides; }
+
+#if defined(SWIGRUBY)
+ %rename( "implicit_obsolete_uses_provides=" ) set_implicit_obsolete_uses_provides( int bflag );
+#endif
+ /*
+ * call-seq:
+ * pool.implicit_obsolete_uses_provides = true
+ *
+ */
+ void set_implicit_obsolete_uses_provides( int bflag )
+ { $self->implicitobsoleteusesprovides= bflag; }
+
/*
* Set the pool to an _unprepared_ status.
*
diff --git a/bindings/solver.i b/bindings/solver.i
index 498c8e3..8c61840 100644
--- a/bindings/solver.i
+++ b/bindings/solver.i
@@ -304,113 +304,6 @@ typedef struct solver {} Solver;
{ $self->updatesystem = bflag; }
#if defined(SWIGRUBY)
- %typemap(out) int allow_virtual_conflicts
- "$result = $1 ? Qtrue : Qfalse;";
-#endif
- /*
- * Allow virtual conflicts
- *
- * call-seq:
- * solver.allow_virtual_conflicts -> bool
- *
- */
- int allow_virtual_conflicts()
- { return $self->allowvirtualconflicts; }
-
-#if defined(SWIGRUBY)
- %rename( "allow_virtual_conflicts=" ) set_allow_virtual_conflicts( int bflag );
-#endif
- /*
- * call-seq:
- * solver.allow_virtual_conflicts = true
- *
- */
- void set_allow_virtual_conflicts( int bflag )
- { $self->allowvirtualconflicts = bflag; }
-
-#if defined(SWIGRUBY)
- %typemap(out) int allow_self_conflicts
- "$result = $1 ? Qtrue : Qfalse;";
-#endif
- /*
- * Allow self conflicts
- *
- * If a package can conflict with itself
- *
- * call-seq:
- * solver.allow_self_conflicts -> bool
- *
- */
- int allow_self_conflicts()
- { return $self->allowselfconflicts; }
-
-#if defined(SWIGRUBY)
- %rename( "allow_self_conflicts=" ) set_allow_self_conflicts( int bflag );
-#endif
- /*
- * call-seq:
- * solver.allow_self_conflicts = true
- *
- */
- void set_allow_self_conflicts( int bflag )
- { $self->allowselfconflicts = bflag; }
-
-#if defined(SWIGRUBY)
- %typemap(out) int obsolete_uses_provides
- "$result = $1 ? Qtrue : Qfalse;";
-#endif
- /*
- * Obsolete uses provides
- *
- * Obsolete dependencies usually match on package names only.
- * Setting this flag will make obsoletes also match a provides.
- *
- * call-seq:
- * solver.obsolete_uses_provides -> bool
- *
- */
- int obsolete_uses_provides()
- { return $self->obsoleteusesprovides; }
-
-#if defined(SWIGRUBY)
- %rename( "obsolete_uses_provides=" ) set_obsolete_uses_provides( int bflag );
-#endif
- /*
- * Obsolete uses provides
- *
- * call-seq:
- * solver.obsolete_uses_provides = true
- *
- */
- void set_obsolete_uses_provides( int bflag )
- { $self->obsoleteusesprovides= bflag; }
-
-#if defined(SWIGRUBY)
- %typemap(out) int implicit_obsolete_uses_provides
- "$result = $1 ? Qtrue : Qfalse;";
-#endif
- /*
- * Implicit obsolete uses provides
- *
- * call-seq:
- * solver.implicit_obsolete_uses_provides -> bool
- *
- */
- int implicit_obsolete_uses_provides()
- { return $self->implicitobsoleteusesprovides; }
-
-#if defined(SWIGRUBY)
- %rename( "implicit_obsolete_uses_provides=" ) set_implicit_obsolete_uses_provides( int bflag );
-#endif
- /*
- * call-seq:
- * solver.implicit_obsolete_uses_provides = true
- *
- */
- void set_implicit_obsolete_uses_provides( int bflag )
- { $self->implicitobsoleteusesprovides= bflag; }
-
-#if defined(SWIGRUBY)
%typemap(out) int no_update_provide
"$result = $1 ? Qtrue : Qfalse;";
#endif
diff --git a/src/bitmap.c b/src/bitmap.c
index c94afe0..200bb41 100644
--- a/src/bitmap.c
+++ b/src/bitmap.c
@@ -20,7 +20,7 @@ void
map_init(Map *m, int n)
{
m->size = (n + 7) >> 3;
- m->map = sat_calloc(m->size, 1);
+ m->map = n ? sat_calloc(m->size, 1) : 0;
}
// free space allocated
diff --git a/src/policy.c b/src/policy.c
index 2148b10..caddaf6 100644
--- a/src/policy.c
+++ b/src/policy.c
@@ -32,8 +32,7 @@
static int
prune_to_best_version_sortcmp(const void *ap, const void *bp, void *dp)
{
- Solver *solv = dp;
- Pool *pool = solv->pool;
+ Pool *pool = dp;
int r;
Id a = *(Id *)ap;
Id b = *(Id *)bp;
@@ -52,14 +51,14 @@ prune_to_best_version_sortcmp(const void *ap, const void *bp, void *dp)
return strcmp(na, nb);
}
/* the same name, bring installed solvables to the front */
- if (solv->installed)
+ if (pool->installed)
{
- if (sa->repo == solv->installed)
+ if (sa->repo == pool->installed)
{
- if (sb->repo != solv->installed)
+ if (sb->repo != pool->installed)
return -1;
}
- else if (sb->repo == solv->installed)
+ else if (sb->repo == pool->installed)
return 1;
}
/* sort by repository sub-prio (installed repo handled above) */
@@ -269,9 +268,8 @@ prune_to_best_arch(Pool *pool, Queue *plist)
* return result through plist
*/
void
-prune_to_best_version(Solver *solv, Queue *plist)
+prune_to_best_version(Pool *pool, Queue *plist)
{
- Pool *pool = solv->pool;
Id best;
int i, j;
Solvable *s;
@@ -281,7 +279,7 @@ prune_to_best_version(Solver *solv, Queue *plist)
POOL_DEBUG(SAT_DEBUG_POLICY, "prune_to_best_version %d\n", plist->count);
/* sort by name first, prefer installed */
- sat_sort(plist->elements, plist->count, sizeof(Id), prune_to_best_version_sortcmp, solv);
+ sat_sort(plist->elements, plist->count, sizeof(Id), prune_to_best_version_sortcmp, pool);
/* delete obsoleted. hmm, looks expensive! */
/* FIXME maybe also check provides depending on noupdateprovide? */
@@ -299,7 +297,7 @@ prune_to_best_version(Solver *solv, Queue *plist)
{
if (pool->solvables[p].name == s->name)
continue;
- if (!solv->obsoleteusesprovides && !pool_match_nevr(pool, pool->solvables + p, obs))
+ if (!pool->obsoleteusesprovides && !pool_match_nevr(pool, pool->solvables + p, obs))
continue;
for (j = 0; j < plist->count; j++)
{
@@ -325,7 +323,7 @@ prune_to_best_version(Solver *solv, Queue *plist)
POOL_DEBUG(SAT_DEBUG_POLICY, "- %s[%s]\n",
solvable2str(pool, s),
- (solv->installed && s->repo == solv->installed) ? "installed" : "not installed");
+ (pool->installed && s->repo == pool->installed) ? "installed" : "not installed");
if (!best) /* if no best yet, the current is best */
{
@@ -371,7 +369,7 @@ prune_best_arch_name_version(Solver *solv, Pool *pool, Queue *plist)
if (plist->count > 1)
prune_to_best_arch(pool, plist);
if (plist->count > 1)
- prune_to_best_version(solv, plist);
+ prune_to_best_version(pool, plist);
}
@@ -473,7 +471,7 @@ policy_create_obsolete_index(Solver *solv)
continue;
if (pool->solvables[p].name == s->name)
continue;
- if (!solv->obsoleteusesprovides && !pool_match_nevr(pool, pool->solvables + p, obs))
+ if (!pool->obsoleteusesprovides && !pool_match_nevr(pool, pool->solvables + p, obs))
continue;
obsoletes[p - installed->start]++;
}
@@ -504,7 +502,7 @@ policy_create_obsolete_index(Solver *solv)
continue;
if (pool->solvables[p].name == s->name)
continue;
- if (!solv->obsoleteusesprovides && !pool_match_nevr(pool, pool->solvables + p, obs))
+ if (!pool->obsoleteusesprovides && !pool_match_nevr(pool, pool->solvables + p, obs))
continue;
p -= installed->start;
if (obsoletes_data[obsoletes[p]] != i)
@@ -567,7 +565,7 @@ policy_findupdatepackages(Solver *solv, Solvable *s, Queue *qs, int allow_all)
{
FOR_PROVIDES(p2, pp2, obs) /* and all matching providers of the obsoletes */
{
- if (!solv->obsoleteusesprovides && !pool_match_nevr(pool, pool->solvables + p2, obs))
+ if (!pool->obsoleteusesprovides && !pool_match_nevr(pool, pool->solvables + p2, obs))
continue;
if (p2 == n) /* match ! */
break;
diff --git a/src/policy.h b/src/policy.h
index 4c69177..9e4de94 100644
--- a/src/policy.h
+++ b/src/policy.h
@@ -19,8 +19,9 @@
/* This functions can be used for sorting solvables to a specific order like architecture, version. */
/* Solvables which does not fit to the system will be deleted from the list. */
extern void prune_best_arch_name_version(Solver *solv, Pool *pool, Queue *plist);
+
extern void prune_to_best_arch(Pool *pool, Queue *plist);
-extern void prune_to_best_version(Solver *solv, Queue *plist);
+extern void prune_to_best_version(Pool *pool, Queue *plist);
/* The following default policies can be overloaded by the application by using callbacks which are
diff --git a/src/pool.h b/src/pool.h
index 085f004..1c54264 100644
--- a/src/pool.h
+++ b/src/pool.h
@@ -72,7 +72,12 @@ struct _Pool {
Id *languagecache;
int languagecacheother;
- int promoteepoch; /* 0/1 */
+ /* flags to tell the library how the installed rpm works */
+ int promoteepoch; /* true: missing epoch is replaced by epoch of dependency */
+ int obsoleteusesprovides; /* true: obsoletes are matched against provides, not names */
+ int implicitobsoleteusesprovides; /* true: implicit obsoletes due to same name are matched against provides, not names */
+ int novirtualconflicts; /* true: conflicts on names, not on provides */
+ int allowselfconflicts; /* true: packages which conflict with itself are installable */
Id *id2arch; /* map arch ids to scores */
Id lastarch; /* last valid entry in id2arch */
diff --git a/src/rules.c b/src/rules.c
index 288252a..11f3301 100644
--- a/src/rules.c
+++ b/src/rules.c
@@ -632,7 +632,7 @@ solver_addrpmrulesforsolvable(Solver *solv, Solvable *s, Map *m)
if (dontfix && pool->solvables[p].repo == installed)
continue;
/* p == n: self conflict */
- if (p == n && !solv->allowselfconflicts)
+ if (p == n && !pool->allowselfconflicts)
{
if (ISRELDEP(con))
{
@@ -669,7 +669,7 @@ solver_addrpmrulesforsolvable(Solver *solv, Solvable *s, Map *m)
/* foreach provider of an obsoletes of 's' */
FOR_PROVIDES(p, pp, obs)
{
- if (!solv->obsoleteusesprovides /* obsoletes are matched names, not provides */
+ if (!pool->obsoleteusesprovides /* obsoletes are matched names, not provides */
&& !pool_match_nevr(pool, pool->solvables + p, obs))
continue;
addrpmrule(solv, -n, -p, SOLVER_RULE_RPM_PACKAGE_OBSOLETES, obs);
@@ -683,7 +683,7 @@ solver_addrpmrulesforsolvable(Solver *solv, Solvable *s, Map *m)
/* (actually, rpm mixes those packages. yuck...) */
if (noobs && (s->name != ps->name || s->evr != ps->evr || s->arch != ps->arch))
continue;
- if (!solv->implicitobsoleteusesprovides && s->name != ps->name)
+ if (!pool->implicitobsoleteusesprovides && s->name != ps->name)
continue;
if (s->name == ps->name)
addrpmrule(solv, -n, -p, SOLVER_RULE_RPM_SAME_NAME, 0);
@@ -1170,7 +1170,7 @@ solver_createdupmaps(Solver *solv)
{
FOR_PROVIDES(pi, pp, obs)
{
- if (!solv->obsoleteusesprovides && !pool_match_nevr(pool, pool->solvables + pi, obs))
+ if (!pool->obsoleteusesprovides && !pool_match_nevr(pool, pool->solvables + pi, obs))
continue;
MAPSET(&solv->dupinvolvedmap, pi);
}
@@ -1361,7 +1361,7 @@ jobtodisablelist(Solver *solv, Id how, Id what, Queue *q)
Solvable *ps = pool->solvables + p;
if (ps->repo != installed)
continue;
- if (!solv->obsoleteusesprovides && !pool_match_nevr(pool, ps, obs))
+ if (!pool->obsoleteusesprovides && !pool_match_nevr(pool, ps, obs))
continue;
queue_push(q, DISABLE_UPDATE);
queue_push(q, p);
@@ -1372,7 +1372,7 @@ jobtodisablelist(Solver *solv, Id how, Id what, Queue *q)
Solvable *ps = pool->solvables + p;
if (ps->repo != installed)
continue;
- if (!solv->implicitobsoleteusesprovides && ps->name != s->name)
+ if (!pool->implicitobsoleteusesprovides && ps->name != s->name)
continue;
queue_push(q, DISABLE_UPDATE);
queue_push(q, p);
diff --git a/src/solver.c b/src/solver.c
index e17205b..055ea32 100644
--- a/src/solver.c
+++ b/src/solver.c
@@ -1228,8 +1228,7 @@ solver_create(Pool *pool)
solv->pool = pool;
solv->installed = pool->installed;
- queue_init(&solv->transaction);
- queue_init(&solv->transaction_info);
+ transaction_init(&solv->trans, pool);
queue_init(&solv->ruletojob);
queue_init(&solv->decisionq);
queue_init(&solv->decisionq_why);
@@ -1266,8 +1265,7 @@ solver_create(Pool *pool)
void
solver_free(Solver *solv)
{
- queue_free(&solv->transaction);
- queue_free(&solv->transaction_info);
+ transaction_free(&solv->trans);
queue_free(&solv->job);
queue_free(&solv->ruletojob);
queue_free(&solv->decisionq);
@@ -1300,7 +1298,6 @@ solver_free(Solver *solv)
sat_free(solv->obsoletes);
sat_free(solv->obsoletes_data);
sat_free(solv->multiversionupdaters);
- sat_free(solv->transaction_installed);
sat_free(solv);
}
@@ -2346,6 +2343,25 @@ findrecommendedsuggested(Solver *solv)
map_free(&obsmap);
}
+void
+solver_calculate_noobsmap(Pool *pool, Map *noobsmap, Queue *job)
+{
+ int i;
+ Id how, what, select;
+ Id p, pp;
+ for (i = 0; i < job->count; i += 2)
+ {
+ how = job->elements[i];
+ if ((how & SOLVER_JOBMASK) != SOLVER_NOOBSOLETES)
+ continue;
+ what = job->elements[i + 1];
+ select = how & SOLVER_SELECTMASK;
+ if (!noobsmap->size)
+ map_init(noobsmap, pool->nsolvables);
+ FOR_JOB_SELECT(p, pp, select, what)
+ MAPSET(noobsmap, p);
+ }
+}
/*
*
@@ -2376,8 +2392,8 @@ solver_solve(Solver *solv, Queue *job)
POOL_DEBUG(SAT_DEBUG_STATS, "fixsystem=%d updatesystem=%d dosplitprovides=%d, noupdateprovide=%d noinfarchcheck=%d\n", solv->fixsystem, solv->updatesystem, solv->dosplitprovides, solv->noupdateprovide, solv->noinfarchcheck);
POOL_DEBUG(SAT_DEBUG_STATS, "distupgrade=%d distupgrade_removeunsupported=%d\n", solv->distupgrade, solv->distupgrade_removeunsupported);
POOL_DEBUG(SAT_DEBUG_STATS, "allowuninstall=%d, allowdowngrade=%d, allowarchchange=%d, allowvendorchange=%d\n", solv->allowuninstall, solv->allowdowngrade, solv->allowarchchange, solv->allowvendorchange);
- POOL_DEBUG(SAT_DEBUG_STATS, "promoteepoch=%d, allowvirtualconflicts=%d, allowselfconflicts=%d\n", pool->promoteepoch, solv->allowvirtualconflicts, solv->allowselfconflicts);
- POOL_DEBUG(SAT_DEBUG_STATS, "obsoleteusesprovides=%d, implicitobsoleteusesprovides=%d\n", solv->obsoleteusesprovides, solv->implicitobsoleteusesprovides);
+ POOL_DEBUG(SAT_DEBUG_STATS, "promoteepoch=%d, novirtualconflicts=%d, allowselfconflicts=%d\n", pool->promoteepoch, pool->novirtualconflicts, pool->allowselfconflicts);
+ POOL_DEBUG(SAT_DEBUG_STATS, "obsoleteusesprovides=%d, implicitobsoleteusesprovides=%d\n", pool->obsoleteusesprovides, pool->implicitobsoleteusesprovides);
POOL_DEBUG(SAT_DEBUG_STATS, "dontinstallrecommended=%d, ignorealreadyrecommended=%d, dontshowinstalledrecommended=%d\n", solv->dontinstallrecommended, solv->ignorealreadyrecommended, solv->dontshowinstalledrecommended);
/* create whatprovides if not already there */
@@ -2397,18 +2413,7 @@ solver_solve(Solver *solv, Queue *job)
*/
/* create noobsolete map if needed */
- for (i = 0; i < job->count; i += 2)
- {
- how = job->elements[i];
- if ((how & SOLVER_JOBMASK) != SOLVER_NOOBSOLETES)
- continue;
- what = job->elements[i + 1];
- select = how & SOLVER_SELECTMASK;
- if (!solv->noobsoletes.size)
- map_init(&solv->noobsoletes, pool->nsolvables);
- FOR_JOB_SELECT(p, pp, select, what)
- MAPSET(&solv->noobsoletes, p);
- }
+ solver_calculate_noobsmap(pool, &solv->noobsoletes, job);
map_init(&addedmap, pool->nsolvables);
MAPSET(&addedmap, SYSTEMSOLVABLE);
@@ -2825,7 +2830,7 @@ solver_solve(Solver *solv, Queue *job)
/*
* finally prepare transaction info
*/
- solver_create_transaction(solv);
+ transaction_calculate(&solv->trans, &solv->decisionq, &solv->noobsoletes);
POOL_DEBUG(SAT_DEBUG_STATS, "final solver statistics: %d problems, %d learned rules, %d unsolvable\n", solv->problems.count / 2, solv->stats_learned, solv->stats_unsolvable);
POOL_DEBUG(SAT_DEBUG_STATS, "solver_solve took %d ms\n", sat_timems(solve_start));
diff --git a/src/solver.h b/src/solver.h
index 08e6101..3166602 100644
--- a/src/solver.h
+++ b/src/solver.h
@@ -42,9 +42,7 @@ typedef struct _Solver {
Pool *pool;
Queue job; /* copy of the job we're solving */
- Queue transaction; /* solver result */
- Queue transaction_info; /* transaction obsoletes info */
- Id *transaction_installed; /* data for installed packages */
+ Transaction trans; /* calculated transaction */
Repo *installed; /* copy of pool->installed */
@@ -142,10 +140,6 @@ typedef struct _Solver {
int allowvendorchange; /* allow to change vendor of installed solvables */
int allowuninstall; /* allow removal of installed solvables */
int updatesystem; /* update all packages to the newest version */
- int allowvirtualconflicts; /* false: conflicts on package name, true: conflicts on package provides */
- int allowselfconflicts; /* true: packages wich conflict with itself are installable */
- int obsoleteusesprovides; /* true: obsoletes are matched against provides, not names */
- int implicitobsoleteusesprovides; /* true: implicit obsoletes due to same name are matched against provides, not names */
int noupdateprovide; /* true: update packages needs not to provide old package */
int dosplitprovides; /* true: consider legacy split provides */
int dontinstallrecommended; /* true: do not install recommended packages */
@@ -275,6 +269,8 @@ extern void solver_reset(Solver *solv);
extern int solver_dep_installed(Solver *solv, Id dep);
extern int solver_splitprovides(Solver *solv, Id dep);
+extern void solver_calculate_noobsmap(Pool *pool, Map *noobsmap, Queue *job);
+
/* obsolete */
extern SolverRuleinfo solver_problemruleinfo(Solver *solv, Queue *job, Id rid, Id *depp, Id *sourcep, Id *targetp);
diff --git a/src/solverdebug.c b/src/solverdebug.c
index 6bfc2a3..85796f5 100644
--- a/src/solverdebug.c
+++ b/src/solverdebug.c
@@ -37,6 +37,8 @@
*
*/
+/* OBSOLETE: use transaction code instead! */
+
Id *
solver_create_decisions_obsoletesmap(Solver *solv)
{
@@ -68,7 +70,7 @@ solver_create_decisions_obsoletesmap(Solver *solv)
Solvable *ps = pool->solvables + p;
if (noobs && (s->name != ps->name || s->evr != ps->evr || s->arch != ps->arch))
continue;
- if (!solv->implicitobsoleteusesprovides && s->name != ps->name)
+ if (!pool->implicitobsoleteusesprovides && s->name != ps->name)
continue;
if (pool->solvables[p].repo == installed && !obsoletesmap[p])
{
@@ -99,7 +101,7 @@ solver_create_decisions_obsoletesmap(Solver *solv)
{
FOR_PROVIDES(p, pp, obs)
{
- if (!solv->obsoleteusesprovides && !pool_match_nevr(pool, pool->solvables + p, obs))
+ if (!pool->obsoleteusesprovides && !pool_match_nevr(pool, pool->solvables + p, obs))
continue;
if (pool->solvables[p].repo == installed && !obsoletesmap[p])
{
@@ -273,10 +275,10 @@ solver_printdecisions(Solver *solv)
POOL_DEBUG(SAT_DEBUG_RESULT, "transaction:\n");
queue_init(&iq);
- for (i = 0; i < solv->transaction.count; i += 2)
+ for (i = 0; i < solv->trans.steps.count; i += 2)
{
- s = pool->solvables + solv->transaction.elements[i + 1];
- switch(solv->transaction.elements[i])
+ s = pool->solvables + solv->trans.steps.elements[i + 1];
+ switch(solv->trans.steps.elements[i])
{
case SOLVER_TRANSACTION_MULTIINSTALL:
POOL_DEBUG(SAT_DEBUG_RESULT, " multi install %s", solvable2str(pool, s));
@@ -306,7 +308,7 @@ solver_printdecisions(Solver *solv)
default:
break;
}
- switch(solv->transaction.elements[i])
+ switch(solv->trans.steps.elements[i])
{
case SOLVER_TRANSACTION_INSTALL:
case SOLVER_TRANSACTION_ERASE:
@@ -317,7 +319,7 @@ solver_printdecisions(Solver *solv)
case SOLVER_TRANSACTION_CHANGE:
case SOLVER_TRANSACTION_UPGRADE:
case SOLVER_TRANSACTION_REPLACE:
- solver_transaction_all_pkgs(solv, solv->transaction.elements[i + 1], &iq);
+ solver_transaction_all_pkgs(&solv->trans, solv->trans.steps.elements[i + 1], &iq);
if (iq.count)
{
POOL_DEBUG(SAT_DEBUG_RESULT, " (obsoletes");
diff --git a/src/transaction.c b/src/transaction.c
index 78646ac..cfedc79 100644
--- a/src/transaction.c
+++ b/src/transaction.c
@@ -58,20 +58,20 @@ obsq_sortcmp(const void *ap, const void *bp, void *dp)
}
void
-solver_transaction_all_pkgs(Solver *solv, Id p, Queue *pkgs)
+solver_transaction_all_pkgs(Transaction *trans, Id p, Queue *pkgs)
{
- Pool *pool = solv->pool;
+ Pool *pool = trans->pool;
Solvable *s = pool->solvables + p;
- Queue *ti = &solv->transaction_info;
+ Queue *ti = &trans->transaction_info;
Id q;
int i;
queue_empty(pkgs);
if (p <= 0 || !s->repo)
return;
- if (s->repo == solv->installed)
+ if (s->repo == pool->installed)
{
- q = solv->transaction_installed[p - solv->installed->start];
+ q = trans->transaction_installed[p - pool->installed->start];
if (!q)
return;
if (q > 0)
@@ -107,22 +107,22 @@ solver_transaction_all_pkgs(Solver *solv, Id p, Queue *pkgs)
}
Id
-solver_transaction_pkg(Solver *solv, Id p)
+solver_transaction_pkg(Transaction *trans, Id p)
{
- Pool *pool = solv->pool;
+ Pool *pool = trans->pool;
Solvable *s = pool->solvables + p;
Queue ti;
Id tibuf[5];
if (p <= 0 || !s->repo)
return 0;
- if (s->repo == solv->installed)
+ if (s->repo == pool->installed)
{
- p = solv->transaction_installed[p - solv->installed->start];
+ p = trans->transaction_installed[p - pool->installed->start];
return p < 0 ? -p : p;
}
queue_init_buffer(&ti, tibuf, sizeof(tibuf)/sizeof(*tibuf));
- solver_transaction_all_pkgs(solv, p, &ti);
+ solver_transaction_all_pkgs(trans, p, &ti);
p = ti.count ? ti.elements[0] : 0;
queue_free(&ti);
return p;
@@ -133,9 +133,9 @@ solver_transaction_pkg(Solver *solv, Id p)
* transaction might not be shown to the user */
Id
-solver_transaction_filter(Solver *solv, Id type, Id p, int flags)
+solver_transaction_show(Transaction *trans, Id type, Id p, int flags)
{
- Pool *pool = solv->pool;
+ Pool *pool = trans->pool;
Solvable *s = pool->solvables + p;
Queue oq, rq;
Id q;
@@ -159,7 +159,7 @@ solver_transaction_filter(Solver *solv, Id type, Id p, int flags)
}
/* most of the time there's only one reference, so check it first */
- q = solver_transaction_pkg(solv, p);
+ q = solver_transaction_pkg(trans, p);
if ((flags & SOLVER_TRANSACTION_SHOW_REPLACES) == 0)
{
Solvable *sq = pool->solvables + q;
@@ -173,13 +173,13 @@ solver_transaction_filter(Solver *solv, Id type, Id p, int flags)
return SOLVER_TRANSACTION_INSTALL;
}
}
- if (solver_transaction_pkg(solv, q) == p)
+ if (solver_transaction_pkg(trans, q) == p)
return type;
/* too bad, a miss. check em all */
queue_init(&oq);
queue_init(&rq);
- solver_transaction_all_pkgs(solv, p, &oq);
+ solver_transaction_all_pkgs(trans, p, &oq);
for (i = 0; i < oq.count; i++)
{
q = oq.elements[i];
@@ -192,7 +192,7 @@ solver_transaction_filter(Solver *solv, Id type, Id p, int flags)
/* check if we are referenced? */
if ((flags & SOLVER_TRANSACTION_SHOW_ALL) != 0)
{
- solver_transaction_all_pkgs(solv, q, &rq);
+ solver_transaction_all_pkgs(trans, q, &rq);
for (j = 0; j < rq.count; j++)
if (rq.elements[j] == p)
{
@@ -202,7 +202,7 @@ solver_transaction_filter(Solver *solv, Id type, Id p, int flags)
if (ref)
break;
}
- else if (solver_transaction_pkg(solv, q) == p)
+ else if (solver_transaction_pkg(trans, q) == p)
{
ref = 1;
break;
@@ -224,11 +224,11 @@ solver_transaction_filter(Solver *solv, Id type, Id p, int flags)
}
static void
-create_transaction_info(Solver *solv)
+create_transaction_info(Transaction *trans, Queue *decisionq, Map *noobsmap)
{
- Pool *pool = solv->pool;
- Queue *ti = &solv->transaction_info;
- Repo *installed = solv->installed;
+ Pool *pool = trans->pool;
+ Queue *ti = &trans->transaction_info;
+ Repo *installed = pool->installed;
int i, j, noobs;
Id p, p2, pp2;
Solvable *s, *s2;
@@ -236,25 +236,25 @@ create_transaction_info(Solver *solv)
queue_empty(ti);
if (!installed)
return; /* no info needed */
- for (i = 0; i < solv->decisionq.count; i++)
+ for (i = 0; i < decisionq->count; i++)
{
- p = solv->decisionq.elements[i];
+ p = decisionq->elements[i];
if (p <= 0 || p == SYSTEMSOLVABLE)
continue;
s = pool->solvables + p;
if (s->repo == installed)
continue;
- noobs = solv->noobsoletes.size && MAPTST(&solv->noobsoletes, p);
+ noobs = noobsmap && MAPTST(noobsmap, p);
FOR_PROVIDES(p2, pp2, s->name)
{
- if (solv->decisionmap[p2] > 0)
+ if (!MAPTST(&trans->transactsmap, p2))
continue;
s2 = pool->solvables + p2;
if (s2->repo != installed)
continue;
if (noobs && (s->name != s2->name || s->evr != s2->evr || s->arch != s2->arch))
continue;
- if (!solv->implicitobsoleteusesprovides && s->name != s2->name)
+ if (!pool->implicitobsoleteusesprovides && s->name != s2->name)
continue;
queue_push(ti, p);
queue_push(ti, p2);
@@ -269,7 +269,7 @@ create_transaction_info(Solver *solv)
s2 = pool->solvables + p2;
if (s2->repo != installed)
continue;
- if (!solv->obsoleteusesprovides && !pool_match_nevr(pool, pool->solvables + p2, obs))
+ if (!pool->obsoleteusesprovides && !pool_match_nevr(pool, pool->solvables + p2, obs))
continue;
queue_push(ti, p);
queue_push(ti, p2);
@@ -289,109 +289,138 @@ create_transaction_info(Solver *solv)
ti->count = j;
/* create transaction_installed helper */
- solv->transaction_installed = sat_calloc(installed->end - installed->start, sizeof(Id));
+ trans->transaction_installed = sat_calloc(installed->end - installed->start, sizeof(Id));
for (i = 0; i < ti->count; i += 2)
{
j = ti->elements[i + 1] - installed->start;
- if (!solv->transaction_installed[j])
- solv->transaction_installed[j] = ti->elements[i];
+ if (!trans->transaction_installed[j])
+ trans->transaction_installed[j] = ti->elements[i];
else
{
/* more than one package obsoletes us. compare */
Id q[4];
- if (solv->transaction_installed[j] > 0)
- solv->transaction_installed[j] = -solv->transaction_installed[j];
+ if (trans->transaction_installed[j] > 0)
+ trans->transaction_installed[j] = -trans->transaction_installed[j];
q[0] = q[2] = ti->elements[i + 1];
q[1] = ti->elements[i];
- q[3] = -solv->transaction_installed[j];
+ q[3] = -trans->transaction_installed[j];
if (obsq_sortcmp(q, q + 2, pool) < 0)
- solv->transaction_installed[j] = -ti->elements[i];
+ trans->transaction_installed[j] = -ti->elements[i];
}
}
}
+void
+transaction_init(Transaction *trans, Pool *pool)
+{
+ memset(trans, 0, sizeof(*trans));
+ trans->pool = pool;
+}
void
-solver_create_transaction(Solver *solv)
+transaction_free(Transaction *trans)
{
- Pool *pool = solv->pool;
- Repo *installed = solv->installed;
+ queue_free(&trans->steps);
+ queue_free(&trans->transaction_info);
+ trans->transaction_installed = sat_free(trans->transaction_installed);
+ map_free(&trans->transactsmap);
+}
+
+void
+transaction_calculate(Transaction *trans, Queue *decisionq, Map *noobsmap)
+{
+ Pool *pool = trans->pool;
+ Repo *installed = pool->installed;
int i, r, noobs;
Id p, p2;
Solvable *s, *s2;
- queue_empty(&solv->transaction);
- create_transaction_info(solv);
+ if (noobsmap && !noobsmap->size)
+ noobsmap = 0; /* ignore empty map */
+ queue_empty(&trans->steps);
+ map_init(&trans->transactsmap, pool->nsolvables);
+ for (i = 0; i < decisionq->count; i++)
+ {
+ p = decisionq->elements[i];
+ s = pool->solvables + (p > 0 ? p : -p);
+ if (!s->repo)
+ continue;
+ if (installed && s->repo == installed && p < 0)
+ MAPSET(&trans->transactsmap, -p);
+ if ((!installed || s->repo != installed) && p > 0)
+ MAPSET(&trans->transactsmap, p);
+ }
+ create_transaction_info(trans, decisionq, noobsmap);
if (installed)
{
FOR_REPO_SOLVABLES(installed, p, s)
{
- if (solv->decisionmap[p] > 0)
+ if (!MAPTST(&trans->transactsmap, p))
continue;
- p2 = solver_transaction_pkg(solv, p);
+ p2 = solver_transaction_pkg(trans, p);
if (!p2)
- queue_push(&solv->transaction, SOLVER_TRANSACTION_ERASE);
+ queue_push(&trans->steps, SOLVER_TRANSACTION_ERASE);
else
{
s2 = pool->solvables + p2;
if (s->name == s2->name)
{
if (s->evr == s2->evr && solvable_identical(s, s2))
- queue_push(&solv->transaction, SOLVER_TRANSACTION_REINSTALLED);
+ queue_push(&trans->steps, SOLVER_TRANSACTION_REINSTALLED);
else
{
r = evrcmp(pool, s->evr, s2->evr, EVRCMP_COMPARE);
if (r < 0)
- queue_push(&solv->transaction, SOLVER_TRANSACTION_UPGRADED);
+ queue_push(&trans->steps, SOLVER_TRANSACTION_UPGRADED);
else if (r > 0)
- queue_push(&solv->transaction, SOLVER_TRANSACTION_DOWNGRADED);
+ queue_push(&trans->steps, SOLVER_TRANSACTION_DOWNGRADED);
else
- queue_push(&solv->transaction, SOLVER_TRANSACTION_CHANGED);
+ queue_push(&trans->steps, SOLVER_TRANSACTION_CHANGED);
}
}
else
- queue_push(&solv->transaction, SOLVER_TRANSACTION_REPLACED);
+ queue_push(&trans->steps, SOLVER_TRANSACTION_REPLACED);
}
- queue_push(&solv->transaction, p);
+ queue_push(&trans->steps, p);
}
}
- for (i = 0; i < solv->decisionq.count; i++)
+ for (i = 0; i < decisionq->count; i++)
{
- p = solv->decisionq.elements[i];
+ p = decisionq->elements[i];
if (p < 0 || p == SYSTEMSOLVABLE)
continue;
s = pool->solvables + p;
- if (solv->installed && s->repo == solv->installed)
+ if (installed && s->repo == installed)
continue;
- noobs = solv->noobsoletes.size && MAPTST(&solv->noobsoletes, p);
- p2 = solver_transaction_pkg(solv, p);
+ noobs = noobsmap && MAPTST(noobsmap, p);
+ p2 = solver_transaction_pkg(trans, p);
if (noobs)
- queue_push(&solv->transaction, p2 ? SOLVER_TRANSACTION_MULTIREINSTALL : SOLVER_TRANSACTION_MULTIINSTALL);
+ queue_push(&trans->steps, p2 ? SOLVER_TRANSACTION_MULTIREINSTALL : SOLVER_TRANSACTION_MULTIINSTALL);
else if (!p2)
- queue_push(&solv->transaction, SOLVER_TRANSACTION_INSTALL);
+ queue_push(&trans->steps, SOLVER_TRANSACTION_INSTALL);
else
{
s2 = pool->solvables + p2;
if (s->name == s2->name)
{
if (s->evr == s2->evr && solvable_identical(s, s2))
- queue_push(&solv->transaction, SOLVER_TRANSACTION_REINSTALL);
+ queue_push(&trans->steps, SOLVER_TRANSACTION_REINSTALL);
else
{
r = evrcmp(pool, s->evr, s2->evr, EVRCMP_COMPARE);
if (r > 0)
- queue_push(&solv->transaction, SOLVER_TRANSACTION_UPGRADE);
+ queue_push(&trans->steps, SOLVER_TRANSACTION_UPGRADE);
else if (r < 0)
- queue_push(&solv->transaction, SOLVER_TRANSACTION_DOWNGRADE);
+ queue_push(&trans->steps, SOLVER_TRANSACTION_DOWNGRADE);
else
- queue_push(&solv->transaction, SOLVER_TRANSACTION_CHANGE);
+ queue_push(&trans->steps, SOLVER_TRANSACTION_CHANGE);
}
}
else
- queue_push(&solv->transaction, SOLVER_TRANSACTION_REPLACE);
+ queue_push(&trans->steps, SOLVER_TRANSACTION_REPLACE);
}
- queue_push(&solv->transaction, p);
+ queue_push(&trans->steps, p);
}
}
@@ -417,7 +446,7 @@ struct transel {
};
struct orderdata {
- Solver *solv;
+ Transaction *trans;
struct transel *tes;
int ntes;
Id *edgedata;
@@ -429,19 +458,19 @@ struct orderdata {
static int
addedge(struct orderdata *od, Id from, Id to, int type)
{
- Solver *solv = od->solv;
- Pool *pool = solv->pool;
+ Transaction *trans = od->trans;
+ Pool *pool = trans->pool;
Solvable *s;
struct transel *te;
int i;
// printf("addedge %d %d type %d\n", from, to, type);
s = pool->solvables + from;
- if (s->repo == solv->installed && solv->transaction_installed[from - solv->installed->start])
+ if (s->repo == pool->installed && trans->transaction_installed[from - pool->installed->start])
{
/* passive, map to active */
- if (solv->transaction_installed[from - solv->installed->start] > 0)
- from = solv->transaction_installed[from - solv->installed->start];
+ if (trans->transaction_installed[from - pool->installed->start] > 0)
+ from = trans->transaction_installed[from - pool->installed->start];
else
{
int ret = 0;
@@ -449,7 +478,7 @@ addedge(struct orderdata *od, Id from, Id to, int type)
Id tibuf[5];
queue_init_buffer(&ti, tibuf, sizeof(tibuf)/sizeof(*tibuf));
- solver_transaction_all_pkgs(solv, from, &ti);
+ solver_transaction_all_pkgs(trans, from, &ti);
for (i = 0; i < ti.count; i++)
ret |= addedge(od, ti.elements[i], to, type);
queue_free(&ti);
@@ -457,11 +486,11 @@ addedge(struct orderdata *od, Id from, Id to, int type)
}
}
s = pool->solvables + to;
- if (s->repo == solv->installed && solv->transaction_installed[to - solv->installed->start])
+ if (s->repo == pool->installed && trans->transaction_installed[to - pool->installed->start])
{
/* passive, map to active */
- if (solv->transaction_installed[to - solv->installed->start] > 0)
- to = solv->transaction_installed[to - solv->installed->start];
+ if (trans->transaction_installed[to - pool->installed->start] > 0)
+ to = trans->transaction_installed[to - pool->installed->start];
else
{
int ret = 0;
@@ -469,7 +498,7 @@ addedge(struct orderdata *od, Id from, Id to, int type)
Id tibuf[5];
queue_init_buffer(&ti, tibuf, sizeof(tibuf)/sizeof(*tibuf));
- solver_transaction_all_pkgs(solv, to, &ti);
+ solver_transaction_all_pkgs(trans, to, &ti);
for (i = 0; i < ti.count; i++)
ret |= addedge(od, from, ti.elements[i], type);
queue_free(&ti);
@@ -535,7 +564,8 @@ addedge(struct orderdata *od, Id from, Id to, int type)
static int
havechoice(struct orderdata *od, Id p, Id q1, Id q2)
{
- Solver *solv = od->solv;
+ Transaction *trans = od->trans;
+ Pool *pool = trans->pool;
Id ti1buf[5], ti2buf[5];
Queue ti1, ti2;
int i, j;
@@ -543,18 +573,18 @@ havechoice(struct orderdata *od, Id p, Id q1, Id q2)
/* both q1 and q2 are uninstalls. check if their TEs intersect */
/* common case: just one TE for both packages */
printf("havechoice %d %d %d\n", p, q1, q2);
- if (solv->transaction_installed[q1 - solv->installed->start] == 0)
+ if (trans->transaction_installed[q1 - pool->installed->start] == 0)
return 1;
- if (solv->transaction_installed[q2 - solv->installed->start] == 0)
+ if (trans->transaction_installed[q2 - pool->installed->start] == 0)
return 1;
- if (solv->transaction_installed[q1 - solv->installed->start] == solv->transaction_installed[q2 - solv->installed->start])
+ if (trans->transaction_installed[q1 - pool->installed->start] == trans->transaction_installed[q2 - pool->installed->start])
return 0;
- if (solv->transaction_installed[q1 - solv->installed->start] > 0 && solv->transaction_installed[q2 - solv->installed->start] > 0)
+ if (trans->transaction_installed[q1 - pool->installed->start] > 0 && trans->transaction_installed[q2 - pool->installed->start] > 0)
return 1;
queue_init_buffer(&ti1, ti1buf, sizeof(ti1buf)/sizeof(*ti1buf));
- solver_transaction_all_pkgs(solv, q1, &ti1);
+ solver_transaction_all_pkgs(trans, q1, &ti1);
queue_init_buffer(&ti2, ti2buf, sizeof(ti2buf)/sizeof(*ti2buf));
- solver_transaction_all_pkgs(solv, q2, &ti2);
+ solver_transaction_all_pkgs(trans, q2, &ti2);
for (i = 0; i < ti1.count; i++)
for (j = 0; j < ti2.count; j++)
if (ti1.elements[i] == ti2.elements[j])
@@ -572,12 +602,12 @@ havechoice(struct orderdata *od, Id p, Id q1, Id q2)
static void
addsolvableedges(struct orderdata *od, Solvable *s)
{
- Solver *solv = od->solv;
- Pool *pool = solv->pool;
+ Transaction *trans = od->trans;
+ Pool *pool = trans->pool;
Id req, *reqp, con, *conp;
Id p, p2, pp2;
int i, j, pre, numins;
- Repo *installed = solv->installed;
+ Repo *installed = pool->installed;
Solvable *s2;
Queue reqq;
@@ -604,12 +634,12 @@ addsolvableedges(struct orderdata *od, Solvable *s)
reqq.count = 0; /* self provides */
break;
}
- if (s2->repo == installed && solv->decisionmap[p2] > 0)
+ if (s2->repo == installed && !MAPTST(&trans->transactsmap, p2))
{
reqq.count = 0; /* provided by package that stays installed */
break;
}
- if (s2->repo != installed && solv->decisionmap[p2] <= 0)
+ if (s2->repo != installed && !MAPTST(&trans->transactsmap, p2))
continue; /* package stays uninstalled */
if (s->repo == installed)
@@ -694,7 +724,7 @@ addsolvableedges(struct orderdata *od, Solvable *s)
continue;
if (s->repo == installed)
{
- if (s2->repo != installed && solv->decisionmap[p2] >= 0)
+ if (s2->repo != installed && MAPTST(&trans->transactsmap, p2))
{
/* deinstall p before installing p2 */
addedge(od, p2, p, TYPE_CON);
@@ -702,7 +732,7 @@ addsolvableedges(struct orderdata *od, Solvable *s)
}
else
{
- if (s2->repo == installed && solv->decisionmap[p2] < 0)
+ if (s2->repo == installed && MAPTST(&trans->transactsmap, p2))
{
/* deinstall p2 before installing p */
addedge(od, p, p2, TYPE_CON);
@@ -741,7 +771,7 @@ haveprereq(Pool *pool, Id solvid)
void
breakcycle(struct orderdata *od, Id *cycle)
{
- Pool *pool = od->solv->pool;
+ Pool *pool = od->trans->pool;
Id ddegmin, ddegmax, ddeg;
int k, l;
struct transel *te;
@@ -797,11 +827,11 @@ breakcycle(struct orderdata *od, Id *cycle)
}
void
-solver_order_transaction(Solver *solv)
+transaction_order(Transaction *trans)
{
- Pool *pool = solv->pool;
- Queue *tr = &solv->transaction;
- Repo *installed = solv->installed;
+ Pool *pool = trans->pool;
+ Queue *tr = &trans->steps;
+ Repo *installed = pool->installed;
Id type, p;
Solvable *s;
int i, j, k, numte, numedge;
@@ -821,8 +851,9 @@ solver_order_transaction(Solver *solv)
{
p = tr->elements[i + 1];
s = pool->solvables + p;
- if (s->repo != installed || !solv->transaction_installed[p - solv->installed->start])
- numte++;
+ if (installed && s->repo == installed && trans->transaction_installed[p - installed->start])
+ continue;
+ numte++;
}
if (!numte)
return; /* nothing to do... */
@@ -830,7 +861,7 @@ solver_order_transaction(Solver *solv)
POOL_DEBUG(SAT_DEBUG_STATS, "transaction elements: %d\n", numte);
numte++; /* leave first one zero */
memset(&od, 0, sizeof(od));
- od.solv = solv;
+ od.trans = trans;
od.ntes = numte;
od.tes = sat_calloc(numte, sizeof(*od.tes));
od.edgedata = sat_extend(0, 0, 1, sizeof(Id), EDGEDATA_BLOCK);
@@ -842,7 +873,7 @@ solver_order_transaction(Solver *solv)
{
p = tr->elements[i + 1];
s = pool->solvables + p;
- if (s->repo == installed && solv->transaction_installed[p - solv->installed->start])
+ if (installed && s->repo == installed && trans->transaction_installed[p - installed->start])
continue;
te->p = p;
te->type = tr->elements[i];
@@ -864,6 +895,7 @@ solver_order_transaction(Solver *solv)
for (j = te->edges; od.edgedata[j]; j += 2)
numedge++;
POOL_DEBUG(SAT_DEBUG_STATS, "edges: %d, edge space: %d\n", numedge, od.nedgedata / 2);
+ POOL_DEBUG(SAT_DEBUG_STATS, "edge creation took %d ms\n", sat_timems(now));
/* kill all cycles */
broken = 0;
@@ -995,7 +1027,7 @@ solver_order_transaction(Solver *solv)
{
p = tr->elements[i + 1];
s = pool->solvables + p;
- if (s->repo == installed && solv->transaction_installed[p - installed->start])
+ if (s->repo == installed && trans->transaction_installed[p - installed->start])
obstypes[p - installed->start] = tr->elements[i];
}
}
@@ -1036,7 +1068,7 @@ solver_order_transaction(Solver *solv)
if (installed && s->repo != installed)
{
queue_empty(&obsq);
- solver_transaction_all_pkgs(solv, te->p, &obsq);
+ solver_transaction_all_pkgs(trans, te->p, &obsq);
for (j = 0; j < obsq.count; j++)
{
p = obsq.elements[j];
diff --git a/src/transaction.h b/src/transaction.h
index 25a7967..c1f87b8 100644
--- a/src/transaction.h
+++ b/src/transaction.h
@@ -19,9 +19,20 @@ extern "C" {
#include "pooltypes.h"
#include "queue.h"
+#include "bitmap.h"
-struct _Solver;
+struct _Pool;
+typedef struct _Transaction {
+ struct _Pool *pool;
+ Queue steps;
+ Queue transaction_info;
+ Id *transaction_installed;
+ Map transactsmap;
+} Transaction;
+
+
+/* step types */
#define SOLVER_TRANSACTION_ERASE 0x10
#define SOLVER_TRANSACTION_REINSTALLED 0x11
#define SOLVER_TRANSACTION_DOWNGRADED 0x12
@@ -39,14 +50,18 @@ struct _Solver;
#define SOLVER_TRANSACTION_MULTIINSTALL 0x30
#define SOLVER_TRANSACTION_MULTIREINSTALL 0x31
+/* show modes */
#define SOLVER_TRANSACTION_SHOW_ACTIVE (1 << 0)
#define SOLVER_TRANSACTION_SHOW_ALL (1 << 1)
#define SOLVER_TRANSACTION_SHOW_REPLACES (1 << 2)
-extern void solver_create_transaction(struct _Solver *solv);
-extern void solver_transaction_all_pkgs(struct _Solver *solv, Id p, Queue *pkgs);
-extern Id solver_transaction_pkg(struct _Solver *solv, Id p);
-extern Id solver_transaction_filter(struct _Solver *solv, Id type, Id p, int mode);
+extern void transaction_init(Transaction *trans, struct _Pool *pool);
+extern void transaction_free(Transaction *trans);
+extern void transaction_calculate(Transaction *trans, Queue *decisionq, Map *noobsmap);
+extern void solver_transaction_all_pkgs(Transaction *trans, Id p, Queue *pkgs);
+extern Id solver_transaction_pkg(Transaction *trans, Id p);
+extern Id solver_transaction_show(Transaction *trans, Id type, Id p, int mode);
+extern void transaction_order(Transaction *trans);
#ifdef __cplusplus
}
diff --git a/tests/solver/data.libzypp/sat-tests/install-zypper/install-zypper-force-test.solution b/tests/solver/data.libzypp/sat-tests/install-zypper/install-zypper-force-test.solution
index 84390b0..2025e5f 100644
--- a/tests/solver/data.libzypp/sat-tests/install-zypper/install-zypper-force-test.solution
+++ b/tests/solver/data.libzypp/sat-tests/install-zypper/install-zypper-force-test.solution
@@ -1,6 +1,5 @@
>!> Installing zypper from channel zypp:svn
>!> Solution #1:
->!> install bash-completion-20060301-71.noarch[factory]
>!> upgrade glibc-2.7-15.x86_64 => glibc-2.8-5.x86_64[factory]
>!> upgrade glibc-devel-2.7-14.x86_64 => glibc-devel-2.8-5.x86_64[factory]
>!> upgrade glibc-locale-2.7-14.x86_64 => glibc-locale-2.8-5.x86_64[factory]
@@ -11,8 +10,9 @@
>!> upgrade ruby-zypp-0.4.6-12.12.x86_64 => ruby-zypp-0.4.6-15.5.x86_64[zypp:svn]
>!> upgrade satsolver-tools-0.0.25-12.1.x86_64 => satsolver-tools-0.0.28-3.1.x86_64[zypp:svn]
>!> upgrade yast2-ncurses-pkg-2.16.6-13.1.x86_64 => yast2-ncurses-pkg-2.16.6-24.1.x86_64[YaST_SVN]
->!> upgrade yast2-perl-bindings-2.16.5-12.13.x86_64 => yast2-perl-bindings-2.16.6-4.x86_64[factory]
+>!> upgrade yast2-perl-bindings-2.16.5-12.13.x86_64 => yast2-perl-bindings-2.16.6-3.9.x86_64[YaST_SVN]
>!> upgrade yast2-pkg-bindings-2.16.23-18.2.x86_64 => yast2-pkg-bindings-2.16.29-1.1.x86_64[YaST_SVN]
>!> upgrade yast2-qt-pkg-2.16.32-1.3.x86_64 => yast2-qt-pkg-2.16.37-2.1.x86_64[YaST_SVN]
>!> upgrade zypper-0.10.6-6.4.x86_64 => zypper-0.11.0-8.1.x86_64[zypp:svn]
+>!> install bash-completion-20060301-71.noarch[factory]
>!> installs=1, upgrades=14, uninstalls=0
diff --git a/tests/solver/data.libzypp/sat-tests/install-zypper/install-zypper-noforce-test.solution b/tests/solver/data.libzypp/sat-tests/install-zypper/install-zypper-noforce-test.solution
index 84390b0..2025e5f 100644
--- a/tests/solver/data.libzypp/sat-tests/install-zypper/install-zypper-noforce-test.solution
+++ b/tests/solver/data.libzypp/sat-tests/install-zypper/install-zypper-noforce-test.solution
@@ -1,6 +1,5 @@
>!> Installing zypper from channel zypp:svn
>!> Solution #1:
->!> install bash-completion-20060301-71.noarch[factory]
>!> upgrade glibc-2.7-15.x86_64 => glibc-2.8-5.x86_64[factory]
>!> upgrade glibc-devel-2.7-14.x86_64 => glibc-devel-2.8-5.x86_64[factory]
>!> upgrade glibc-locale-2.7-14.x86_64 => glibc-locale-2.8-5.x86_64[factory]
@@ -11,8 +10,9 @@
>!> upgrade ruby-zypp-0.4.6-12.12.x86_64 => ruby-zypp-0.4.6-15.5.x86_64[zypp:svn]
>!> upgrade satsolver-tools-0.0.25-12.1.x86_64 => satsolver-tools-0.0.28-3.1.x86_64[zypp:svn]
>!> upgrade yast2-ncurses-pkg-2.16.6-13.1.x86_64 => yast2-ncurses-pkg-2.16.6-24.1.x86_64[YaST_SVN]
->!> upgrade yast2-perl-bindings-2.16.5-12.13.x86_64 => yast2-perl-bindings-2.16.6-4.x86_64[factory]
+>!> upgrade yast2-perl-bindings-2.16.5-12.13.x86_64 => yast2-perl-bindings-2.16.6-3.9.x86_64[YaST_SVN]
>!> upgrade yast2-pkg-bindings-2.16.23-18.2.x86_64 => yast2-pkg-bindings-2.16.29-1.1.x86_64[YaST_SVN]
>!> upgrade yast2-qt-pkg-2.16.32-1.3.x86_64 => yast2-qt-pkg-2.16.37-2.1.x86_64[YaST_SVN]
>!> upgrade zypper-0.10.6-6.4.x86_64 => zypper-0.11.0-8.1.x86_64[zypp:svn]
+>!> install bash-completion-20060301-71.noarch[factory]
>!> installs=1, upgrades=14, uninstalls=0
diff --git a/tests/solver/deptestomatic.c b/tests/solver/deptestomatic.c
index 5da6b4c..8eccf0e 100644
--- a/tests/solver/deptestomatic.c
+++ b/tests/solver/deptestomatic.c
@@ -1503,9 +1503,9 @@ endElement( void *userData, const char *name )
if (redcarpet)
pool->promoteepoch = 1;
- Solver *solv = solver_create( pd->pool );
+ Solver *solv = solver_create(pd->pool);
solv->fixsystem = pd->fixsystem;
- solv->allowselfconflicts = 1;
+ pd->pool->allowselfconflicts = 1; /* XXX: should fix test cases instead */
solv->updatesystem = pd->updatesystem;
solv->allowdowngrade = pd->allowdowngrade;
solv->allowuninstall = pd->allowuninstall;
@@ -1534,11 +1534,8 @@ endElement( void *userData, const char *name )
}
rc_printdecisions(solv, &pd->trials);
#if 0
- if (1)
- {
- extern void solver_order_transaction(Solver *solv);
- solver_order_transaction(solv);
- }
+ transaction_order(&solv->trans);
+ solver_printdecisions(solv);
#endif
}
// clean up
@@ -1610,6 +1607,7 @@ static void
rc_printdecisions(Solver *solv, Queue *job)
{
Pool *pool = solv->pool;
+ Transaction *trans = &solv->trans;
int i;
Solvable *s;
@@ -1631,14 +1629,14 @@ rc_printdecisions(Solver *solv, Queue *job)
int installs = 0, uninstalls = 0, upgrades = 0;
Id type, p;
- sat_sort(solv->transaction.elements, solv->transaction.count / 2, 2 * sizeof(Id), transaction_sortcmp, pool);
+ sat_sort(trans->steps.elements, trans->steps.count / 2, 2 * sizeof(Id), transaction_sortcmp, pool);
- for (i = 0; i < solv->transaction.count; i += 2)
+ for (i = 0; i < trans->steps.count; i += 2)
{
- type = solv->transaction.elements[i];
- p = solv->transaction.elements[i + 1];
- s = pool->solvables + solv->transaction.elements[i + 1];
- type = solver_transaction_filter(solv, type, p, 0);
+ type = trans->steps.elements[i];
+ p = trans->steps.elements[i + 1];
+ s = pool->solvables + trans->steps.elements[i + 1];
+ type = solver_transaction_show(trans, type, p, 0);
switch(type)
{
case SOLVER_TRANSACTION_INSTALL:
@@ -1666,7 +1664,7 @@ rc_printdecisions(Solver *solv, Queue *job)
printf(">!> upgrade %s-%s => ", id2str(pool, s->name), id2str(pool, s->evr));
else
printf(">!> upgrade %s-%s.%s => ", id2str(pool, s->name), id2str(pool, s->evr), id2str(pool, s->arch));
- s = pool->solvables + solver_transaction_pkg(solv, solv->transaction.elements[i + 1]);
+ s = pool->solvables + solver_transaction_pkg(trans, trans->steps.elements[i + 1]);
if (redcarpet)
printf("%s-%s%s", id2str(pool, s->name), id2rc(solv, s->evr), id2str(pool, s->evr));
else
--
To unsubscribe, e-mail: zypp-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: zypp-commit+help(a)opensuse.org
1
0