From 4b71a5961b79f9aa821c96ce41291cf1870ccb5d Mon Sep 17 00:00:00 2001 From: Stefan Schubert Date: Mon, 25 Feb 2008 15:53:49 +0000 Subject: [PATCH] fix in generating testcases. e.g. modaliases will be written back in the original form --- zypp/solver/detail/Testcase.cc | 48 ++++++++++++++++++++++++++++++++++++++++-- zypp/solver/detail/Testcase.h | 2 +- 2 files changed, 47 insertions(+), 3 deletions(-) diff --git a/zypp/solver/detail/Testcase.cc b/zypp/solver/detail/Testcase.cc index dbf33ff..84c78b1 100644 --- a/zypp/solver/detail/Testcase.cc +++ b/zypp/solver/detail/Testcase.cc @@ -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 @@ template<> std::string helixXML( const Capability &cap ) { stringstream str; - str << "" << endl; + CapDetail detail = cap.detail(); + if (detail.isSimple()) { + if (detail.isVersioned()) { + str << "" << endl; + } else { + str << "" << endl; + } + } else if (detail.isExpression()) { + if (detail.capRel() == CapDetail::CAP_AND + && detail.lhs().detail().isNamed() + && detail.rhs().detail().isNamed()) { + // packageand dependency + str << "" << 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 << "" << endl; + } else { + str << "" << endl; + MIL << "ignoring " << cap << " cause this format will be supported" << endl; + } + } + } else { + str << "" << endl; + MIL << "ignoring " << cap << " cause this format will be supported" << endl; + } return str.str(); } @@ -344,7 +388,7 @@ bool Testcase::createTestcase(Resolver & resolver, bool dumpPool, bool runSolver // writing control file "*-test.xml" - HelixControl control (dumpPath + "/solver-test.xml.gz", + HelixControl control (dumpPath + "/solver-test.xml", repoTable, ZConfig::instance().systemArchitecture(), language); diff --git a/zypp/solver/detail/Testcase.h b/zypp/solver/detail/Testcase.h index 7f1da3b..df63a1c 100644 --- a/zypp/solver/detail/Testcase.h +++ b/zypp/solver/detail/Testcase.h @@ -102,7 +102,7 @@ class HelixControl { 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 (); -- 2.7.4