Mailinglist Archive: zypp-commit (149 mails)

< Previous Next >
[zypp-commit] r5340 - in /trunk/libzypp/zypp: parser/yum/ source/yum/
  • From: dmacvicar@xxxxxxxxxxxxxxxx
  • Date: Wed, 11 Apr 2007 15:32:11 -0000
  • Message-id: <20070411153211.AB13723683@xxxxxxxxxxxxxxxx>
Author: dmacvicar
Date: Wed Apr 11 17:32:11 2007
New Revision: 5340

URL: http://svn.opensuse.org/viewcvs/zypp?rev=5340&view=rev
Log:

- forward port fixes from SP1 / 10.2 branch
- distribution name and edition for YUM product
- patch rpms location for YUM packages


Modified:
    trunk/libzypp/zypp/parser/yum/YUMParserData.h
    trunk/libzypp/zypp/parser/yum/YUMProductParser.cc
    trunk/libzypp/zypp/parser/yum/YUMProductParser.h
    trunk/libzypp/zypp/source/yum/YUMProductImpl.cc
    trunk/libzypp/zypp/source/yum/YUMProductImpl.h
    trunk/libzypp/zypp/source/yum/YUMSourceImpl.cc

Modified: trunk/libzypp/zypp/parser/yum/YUMParserData.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/parser/yum/YUMParserData.h?rev=5340&r1=5339&r2=5340&view=diff
==============================================================================
--- trunk/libzypp/zypp/parser/yum/YUMParserData.h (original)
+++ trunk/libzypp/zypp/parser/yum/YUMParserData.h Wed Apr 11 17:32:11 2007
@@ -515,6 +515,8 @@
   TranslatedText description;
   TranslatedText short_name;
   // those are suse specific tags
+  std::string distribution_name;
+  std::string distribution_edition;
   std::string releasenotesurl;
 };
 

Modified: trunk/libzypp/zypp/parser/yum/YUMProductParser.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/parser/yum/YUMProductParser.cc?rev=5340&r1=5339&r2=5340&view=diff
==============================================================================
--- trunk/libzypp/zypp/parser/yum/YUMProductParser.cc (original)
+++ trunk/libzypp/zypp/parser/yum/YUMProductParser.cc Wed Apr 11 17:32:11 2007
@@ -12,6 +12,8 @@
 
 #include <istream>
 #include <string>
+#include "zypp/ZYppFactory.h"
+#include "zypp/ZYpp.h"
 #include "zypp/parser/xml_parser_assert.h"
 #include <libxml/xmlreader.h>
 #include <libxml/tree.h>
@@ -34,15 +36,18 @@
 
 YUMProductParser::YUMProductParser(std::istream &is, const std::string& baseUrl, parser::ParserProgress::Ptr progress )
     : XMLNodeIterator<YUMProductData_Ptr>(is, baseUrl,PRODUCTSCHEMA, progress)
+      , _zypp_architecture( getZYpp()->architecture() )
 {
   fetchNext();
 }
 
 YUMProductParser::YUMProductParser()
+  : _zypp_architecture( getZYpp()->architecture() )
 { }
 
 YUMProductParser::YUMProductParser(YUMProductData_Ptr& entry)
     : XMLNodeIterator<YUMProductData_Ptr>(entry)
+      , _zypp_architecture( getZYpp()->architecture() )
 { }
 
 
@@ -77,6 +82,25 @@
       {
         productPtr->name = _helper.content(child);
       }
+      else if (name == "arch")
+      {
+        productPtr->arch = _helper.content(child);
+        try
+        {
+          if (!Arch(productPtr->arch).compatibleWith( _zypp_architecture ))
+          {
+            productPtr = NULL;                 // skip <package>, incompatible architecture
+            break;
+          }
+        }
+        catch ( const Exception & excpt_r )
+        {
+          ZYPP_CAUGHT( excpt_r );
+          DBG << "Skipping malformed " << productPtr->arch << endl;
+          productPtr = NULL;
+          break;
+        }
+      }
       else if (name == "vendor")
       {
         productPtr->vendor = _helper.content(child);
@@ -103,6 +127,14 @@
         productPtr->ver = _helper.attribute(child,"ver");
         productPtr->rel = _helper.attribute(child,"rel");
       }
+      else if (name == "distribution-name")
+      {
+        productPtr->distribution_name = _helper.content(child);
+      }
+      else if (name == "distribution-edition")
+      {
+        productPtr->distribution_edition = _helper.content(child);
+      }
       else if (name == "provides")
       {
         prim.parseDependencyEntries(& productPtr->provides, child);

Modified: trunk/libzypp/zypp/parser/yum/YUMProductParser.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/parser/yum/YUMProductParser.h?rev=5340&r1=5339&r2=5340&view=diff
==============================================================================
--- trunk/libzypp/zypp/parser/yum/YUMProductParser.h (original)
+++ trunk/libzypp/zypp/parser/yum/YUMProductParser.h Wed Apr 11 17:32:11 2007
@@ -59,6 +59,7 @@
   virtual bool isInterested(const xmlNodePtr nodePtr);
   virtual YUMProductData_Ptr process(const xmlTextReaderPtr reader);
   LibXMLHelper _helper;
+  Arch _zypp_architecture;
 };
 } // namespace yum
 } // namespace parser

Modified: trunk/libzypp/zypp/source/yum/YUMProductImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/source/yum/YUMProductImpl.cc?rev=5340&r1=5339&r2=5340&view=diff
==============================================================================
--- trunk/libzypp/zypp/source/yum/YUMProductImpl.cc (original)
+++ trunk/libzypp/zypp/source/yum/YUMProductImpl.cc Wed Apr 11 17:32:11 2007
@@ -51,6 +51,8 @@
       :        _category(parsed.type),
       _vendor(parsed.vendor),
       _short_name(parsed.short_name),
+      _distribution_name(parsed.distribution_name),
+      _distribution_edition(Edition(parsed.distribution_edition)),
       _source(source_r)
       {
       }
@@ -92,12 +94,12 @@
 
       std::string YUMProductImpl::distributionName() const
       {
-        return ProductImplIf::distributionName();
+        return _distribution_name;
       }
 
       Edition YUMProductImpl::distributionEdition() const
       {
-        return ProductImplIf::distributionEdition();
+        return _distribution_edition;
       }
 
       /////////////////////////////////////////////////////////////////

Modified: trunk/libzypp/zypp/source/yum/YUMProductImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/source/yum/YUMProductImpl.h?rev=5340&r1=5339&r2=5340&view=diff
==============================================================================
--- trunk/libzypp/zypp/source/yum/YUMProductImpl.h (original)
+++ trunk/libzypp/zypp/source/yum/YUMProductImpl.h Wed Apr 11 17:32:11 2007
@@ -54,7 +54,8 @@
   TranslatedText _summary;
   TranslatedText _description;
   TranslatedText _short_name;
-
+  std::string _distribution_name;
+  Edition _distribution_edition;
 private:
   Source_Ref _source;
 public:

Modified: trunk/libzypp/zypp/source/yum/YUMSourceImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/source/yum/YUMSourceImpl.cc?rev=5340&r1=5339&r2=5340&view=diff
==============================================================================
--- trunk/libzypp/zypp/source/yum/YUMSourceImpl.cc (original)
+++ trunk/libzypp/zypp/source/yum/YUMSourceImpl.cc Wed Apr 11 17:32:11 2007
@@ -959,7 +959,7 @@
       {
         YUMPackageImpl::PatchRpm patch_rpm;
 
-        patch_rpm.location( OnMediaLocation()
+        patch_rpm.location( source::OnMediaLocation()
                             .medianr( str::strtonum<unsigned>( it->media ) )
                             .filename( it->location )
                             .checksum( CheckSum( it->checksumType, it->checksum ) )
@@ -985,7 +985,7 @@
       {
         YUMPackageImpl::DeltaRpm delta_rpm;
 
-        delta_rpm.location( OnMediaLocation()
+        delta_rpm.location( source::OnMediaLocation()
                             .medianr( str::strtonum<unsigned>( it->media ) )
                             .filename( it->location )
                             .checksum( CheckSum( it->checksumType, it->checksum ) )

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages