From 8c1e4c18d35c3b78cc4a6ec578ad4bfb8225cbf5 Mon Sep 17 00:00:00 2001 From: Duncan Mac-Vicar P Date: Fri, 20 Oct 2006 10:15:07 +0000 Subject: [PATCH] - adapt Product to provde distribution info - bump version --- VERSION | 2 +- zypp/parser/xmlstore/XMLProductParser.cc | 7 +++++++ zypp/source/susetags/ProductMetadataParser.cc | 15 +-------------- zypp/target/store/serialize.cc | 18 +++++++++++------- 4 files changed, 20 insertions(+), 22 deletions(-) diff --git a/VERSION b/VERSION index 100d7b2..de672cd 100644 --- a/VERSION +++ b/VERSION @@ -49,5 +49,5 @@ dnl ================================================== m4_define([LIBZYPP_MINOR], [4]) m4_define([LIBZYPP_COMPATMINOR], [4]) dnl ================================================== -m4_define([LIBZYPP_PATCH], [1]) +m4_define([LIBZYPP_PATCH], [2]) dnl ================================================== diff --git a/zypp/parser/xmlstore/XMLProductParser.cc b/zypp/parser/xmlstore/XMLProductParser.cc index 887a5cb..fffeee1 100644 --- a/zypp/parser/xmlstore/XMLProductParser.cc +++ b/zypp/parser/xmlstore/XMLProductParser.cc @@ -74,12 +74,19 @@ namespace zypp { else if (name == "release-notes-url") { productPtr->releasenotesurl = _helper.content(child); } + else if (name == "distribution-name") { + productPtr->dist_name = _helper.content(child); + } + else if (name == "distribution-edition") { + productPtr->dist_version = _helper.content(child); + } else if (name == "shortname") { productPtr->short_name.setText(_helper.content(child), Locale(_helper.attribute(child,"lang"))); } else if (name == "product-flags") { parseProductFlags( productPtr, child); } + else if (name == "update-urls") { parseUpdateUrls( productPtr, child); } diff --git a/zypp/source/susetags/ProductMetadataParser.cc b/zypp/source/susetags/ProductMetadataParser.cc index cb61553..bf7f02e 100644 --- a/zypp/source/susetags/ProductMetadataParser.cc +++ b/zypp/source/susetags/ProductMetadataParser.cc @@ -253,8 +253,6 @@ void ProductMetadataParser::parse( const Pathname & file_r, Source_Ref source_r MIL << "Product arch is " << prodarch << endl; -#warning EXCHANGE CODE AS SOON AS TARGET STORE SERIALIZES AND RESTORES DISTPRODUCT AND VERSION -#if 0 // Insert a "Provides" _dist_name" == _dist_version" CapFactory capfactory; prodImpl->_deps[Dep::PROVIDES].insert( capfactory.parse( ResTraits::kind, @@ -263,18 +261,7 @@ void ProductMetadataParser::parse( const Pathname & file_r, Source_Ref source_r Edition( prodImpl->_dist_version ) ) ); NVRAD dataCollect( prodImpl->_name, Edition( prodImpl->_version ), prodarch, prodImpl->_deps ); -#else - // before we used to create the product with name and version instead of distname and distversion - // but now we use distname and distversion and we insert a "Provides" with name and version - // (#205392) - CapFactory capfactory; - prodImpl->_deps[Dep::PROVIDES].insert( capfactory.parse( ResTraits::kind, - prodImpl->_name, - Rel::EQ, - Edition( prodImpl->_version ) ) ); - - NVRAD dataCollect( prodImpl->_dist_name, Edition( prodImpl->_dist_version ), prodarch, prodImpl->_deps ); -#endif + result = detail::makeResolvableFromImpl( dataCollect, prodImpl ); } catch (const Exception & excpt_r) diff --git a/zypp/target/store/serialize.cc b/zypp/target/store/serialize.cc index dc1fd21..312ea48 100644 --- a/zypp/target/store/serialize.cc +++ b/zypp/target/store/serialize.cc @@ -28,6 +28,8 @@ #include "serialize.h" #include "xml_escape_parser.hpp" +#define SERIALIZER_VERSION "2.0" + using namespace std; /////////////////////////////////////////////////////////////////// namespace zypp @@ -95,7 +97,7 @@ std::string toXML( const Edition &edition ) { stringstream out; // sad the yum guys did not acll it edition - out << ""; + out << ""; return out.str(); } @@ -277,7 +279,7 @@ std::string toXML( const Language::constPtr &obj ) { stringstream out; out << "" << std::endl; - out << "" << std::endl; + out << "" << std::endl; out << toXML(static_cast(obj)) << std::endl; out << toXML(static_cast(obj)); out << "" << std::endl; @@ -290,7 +292,7 @@ std::string toXML( const Selection::constPtr &obj ) { stringstream out; out << "" << std::endl; - out << "" << std::endl; + out << "" << std::endl; out << toXML(static_cast(obj)) << std::endl; out << toXML(static_cast(obj)); @@ -319,7 +321,7 @@ std::string toXML( const Pattern::constPtr &obj ) { stringstream out; out << "" << std::endl; - out << "" << std::endl; + out << "" << std::endl; out << toXML(static_cast(obj)) << std::endl; out << toXML(static_cast(obj)); @@ -338,7 +340,7 @@ std::string toXML( const Product::constPtr &obj ) { stringstream out; out << "" << std::endl; - out << "category()) << "\">" << std::endl; + out << "category()) << "\">" << std::endl; out << toXML(static_cast(obj)) << std::endl; #warning "FIXME description and displayname of products" @@ -348,6 +350,8 @@ std::string toXML( const Product::constPtr &obj ) detail::ResImplTraits::constPtr pipp( detail::ImplConnect::resimpl( obj ) ); out << translatedTextToXML(pipp->shortName(), "shortname"); + out << " " << xml_escape(obj->distributionName()) << "" << std::endl; + out << " " << xml_escape(obj->distributionEdition().asString()) << "" << std::endl; out << " " << xml_escape(obj->source().alias()) << "" << std::endl; out << " " << xml_escape(obj->releaseNotesUrl().asString()) << "" << std::endl; out << " " << std::endl; @@ -414,7 +418,7 @@ std::string toXML( const Patch::constPtr &obj ) { stringstream out; out << "" << std::endl; - out << "" << std::endl; + out << "" << std::endl; // reuse Resolvable information serialize function out << toXML(static_cast(obj)); @@ -445,7 +449,7 @@ std::string toXML( const source::SourceInfo &obj ) { stringstream out; out << "" << std::endl; - out << "" << std::endl; + out << "" << std::endl; out << " " << obj.enabled() << "" << std::endl; out << " " << obj.autorefresh() << "" << std::endl; out << " " << obj.path() << "" << std::endl; -- 2.7.4