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);
}
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<Product>::kind,
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<Product>::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)
#include "serialize.h"
#include "xml_escape_parser.hpp"
+#define SERIALIZER_VERSION "2.0"
+
using namespace std;
///////////////////////////////////////////////////////////////////
namespace zypp
{
stringstream out;
// sad the yum guys did not acll it edition
- out << "<version ver=\"" << xml_escape(edition.version()) << "\" rel=\"" << xml_escape(edition.release()) << "\"/>";
+ out << "<version ver=\"" << xml_escape(edition.version()) << "\" rel=\"" << xml_escape(edition.release()) << "\" epoch=\"" << edition.epoch() << "\" />";
return out.str();
}
{
stringstream out;
out << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << std::endl;
- out << "<language xmlns=\"http://www.novell.com/metadata/zypp/xml-store\">" << std::endl;
+ out << "<language version=\"" << SERIALIZER_VERSION << "\" xmlns=\"http://www.novell.com/metadata/zypp/xml-store\">" << std::endl;
out << toXML(static_cast<Resolvable::constPtr>(obj)) << std::endl;
out << toXML(static_cast<ResObject::constPtr>(obj));
out << "</language>" << std::endl;
{
stringstream out;
out << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << std::endl;
- out << "<pattern xmlns=\"http://www.novell.com/metadata/zypp/xml-store\">" << std::endl;
+ out << "<pattern version=\"" << SERIALIZER_VERSION << "\" xmlns=\"http://www.novell.com/metadata/zypp/xml-store\">" << std::endl;
out << toXML(static_cast<Resolvable::constPtr>(obj)) << std::endl;
out << toXML(static_cast<ResObject::constPtr>(obj));
{
stringstream out;
out << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << std::endl;
- out << "<pattern xmlns=\"http://www.novell.com/metadata/zypp/xml-store\">" << std::endl;
+ out << "<pattern version=\"" << SERIALIZER_VERSION << "\" xmlns=\"http://www.novell.com/metadata/zypp/xml-store\">" << std::endl;
out << toXML(static_cast<Resolvable::constPtr>(obj)) << std::endl;
out << toXML(static_cast<ResObject::constPtr>(obj));
{
stringstream out;
out << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << std::endl;
- out << "<product xmlns=\"http://www.novell.com/metadata/zypp/xml-store\" type=\"" << xml_escape(obj->category()) << "\">" << std::endl;
+ out << "<product version=\"" << SERIALIZER_VERSION << "\" xmlns=\"http://www.novell.com/metadata/zypp/xml-store\" type=\"" << xml_escape(obj->category()) << "\">" << std::endl;
out << toXML(static_cast<Resolvable::constPtr>(obj)) << std::endl;
#warning "FIXME description and displayname of products"
detail::ResImplTraits<Product::Impl>::constPtr pipp( detail::ImplConnect::resimpl( obj ) );
out << translatedTextToXML(pipp->shortName(), "shortname");
+ out << " <distribution-name>" << xml_escape(obj->distributionName()) << "</distribution-name>" << std::endl;
+ out << " <distribution-edition>" << xml_escape(obj->distributionEdition().asString()) << "</distribution-edition>" << std::endl;
out << " <source>" << xml_escape(obj->source().alias()) << "</source>" << std::endl;
out << " <release-notes-url>" << xml_escape(obj->releaseNotesUrl().asString()) << "</release-notes-url>" << std::endl;
out << " <update-urls>" << std::endl;
{
stringstream out;
out << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << std::endl;
- out << "<patch xmlns=\"http://www.novell.com/metadata/zypp/xml-store\">" << std::endl;
+ out << "<patch version=\"" << SERIALIZER_VERSION << "\" xmlns=\"http://www.novell.com/metadata/zypp/xml-store\">" << std::endl;
// reuse Resolvable information serialize function
out << toXML(static_cast<Resolvable::constPtr>(obj));
{
stringstream out;
out << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << std::endl;
- out << "<source xmlns=\"http://www.novell.com/metadata/zypp/xml-store\">" << std::endl;
+ out << "<source version=\"" << SERIALIZER_VERSION << "\" xmlns=\"http://www.novell.com/metadata/zypp/xml-store\">" << std::endl;
out << " <enabled>" << obj.enabled() << "</enabled>" << std::endl;
out << " <auto-refresh>" << obj.autorefresh() << "</auto-refresh>" << std::endl;
out << " <product-dir>" << obj.path() << "</product-dir>" << std::endl;