Author: schubi2
Date: Mon Feb 25 16:53:49 2008
New Revision: 8904
URL: http://svn.opensuse.org/viewcvs/zypp?rev=8904&view=rev
Log:
fix in generating testcases. e.g. modaliases will be written back in the original form
Modified:
trunk/libzypp/zypp/solver/detail/Testcase.cc
trunk/libzypp/zypp/solver/detail/Testcase.h
Modified: trunk/libzypp/zypp/solver/detail/Testcase.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/solver/detail/Testcase.cc?rev=8904&r1=8903&r2=8904&view=diff
==============================================================================
--- trunk/libzypp/zypp/solver/detail/Testcase.cc (original)
+++ trunk/libzypp/zypp/solver/detail/Testcase.cc Mon Feb 25 16:53:49 2008
@@ -27,6 +27,7 @@
#include "zypp/base/PtrTypes.h"
#include "zypp/Capabilities.h"
#include "zypp/sat/Solvable.h"
+#include "zypp/sat/detail/PoolImpl.h"
/////////////////////////////////////////////////////////////////////////
@@ -95,7 +96,50 @@
std::string helixXML( const Capability &cap )
{
stringstream str;
- str << "<dep name='" << xml_escape(cap.asString()) << "' />" << endl;
+ CapDetail detail = cap.detail();
+ if (detail.isSimple()) {
+ if (detail.isVersioned()) {
+ str << "" << endl;
+ } else {
+ str << "<dep name='" << xml_escape(cap.asString()) << "' />" << endl;
+ }
+ } else if (detail.isExpression()) {
+ if (detail.capRel() == CapDetail::CAP_AND
+ && detail.lhs().detail().isNamed()
+ && detail.rhs().detail().isNamed()) {
+ // packageand dependency
+ str << "<dep name='packageand("
+ << IdString(detail.lhs().id()) << ","
+ << IdString(detail.rhs().id()) << ")' />" << endl;
+ } else {
+ // modalias ?
+ IdString packageName;
+ if (detail.capRel() == CapDetail::CAP_AND) {
+ packageName = IdString(detail.lhs().id());
+ detail = detail.rhs().detail();
+ }
+ if (detail.capRel() == CapDetail::CAP_NAMESPACE
+ && detail.lhs().id() == NAMESPACE_MODALIAS) {
+ str << "<dep name='modalias(";
+ if (!packageName.empty())
+ str << packageName << ":";
+ str << IdString(detail.rhs().id()) << ")' />" << endl;
+ } else {
+ str << "<!--- ignoring '" << xml_escape(cap.asString()) << "' -->" << endl;
+ MIL << "ignoring " << cap << " cause this format will be supported" << endl;
+ }
+ }
+ } else {
+ str << "<!--- ignoring '" << xml_escape(cap.asString()) << "' -->" << endl;
+ MIL << "ignoring " << cap << " cause this format will be supported" << endl;
+ }
return str.str();
}
@@ -344,7 +388,7 @@
// writing control file "*-test.xml"
- HelixControl control (dumpPath + "/solver-test.xml.gz",
+ HelixControl control (dumpPath + "/solver-test.xml",
repoTable,
ZConfig::instance().systemArchitecture(),
language);
Modified: trunk/libzypp/zypp/solver/detail/Testcase.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/solver/detail/Testcase.h?rev=8904&r1=8903&r2=8904&view=diff
==============================================================================
--- trunk/libzypp/zypp/solver/detail/Testcase.h (original)
+++ trunk/libzypp/zypp/solver/detail/Testcase.h Mon Feb 25 16:53:49 2008
@@ -102,7 +102,7 @@
const RepositoryTable & sourceTable,
const Arch & systemArchitecture,
const PoolItemList &languages,
- const std::string & systemPath = "solver-system.xml");
+ const std::string & systemPath = "solver-system.xml.gz");
HelixControl ();
~HelixControl ();
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org