Mailinglist Archive: zypp-commit (149 mails)

< Previous Next >
[zypp-commit] r5338 - in /trunk/libzypp/zypp: ./ detail/ source/susetags/ source/yum/ target/rpm/
  • From: mlandres@xxxxxxxxxxxxxxxx
  • Date: Wed, 11 Apr 2007 13:34:51 -0000
  • Message-id: <20070411133451.E147C23674@xxxxxxxxxxxxxxxx>
Author: mlandres
Date: Wed Apr 11 15:34:51 2007
New Revision: 5338

URL: http://svn.opensuse.org/viewcvs/zypp?rev=5338&view=rev
Log:
- Parse and provide package keywords. (Fate 120368)

Modified:
    trunk/libzypp/zypp/Package.cc
    trunk/libzypp/zypp/Package.h
    trunk/libzypp/zypp/detail/PackageImplIf.cc
    trunk/libzypp/zypp/detail/PackageImplIf.h
    trunk/libzypp/zypp/source/susetags/PackagesParser.cc
    trunk/libzypp/zypp/source/susetags/SuseTagsPackageImpl.cc
    trunk/libzypp/zypp/source/susetags/SuseTagsPackageImpl.h
    trunk/libzypp/zypp/source/yum/YUMPackageImpl.cc
    trunk/libzypp/zypp/source/yum/YUMPackageImpl.h
    trunk/libzypp/zypp/target/rpm/RpmPackageImpl.cc
    trunk/libzypp/zypp/target/rpm/RpmPackageImpl.h

Modified: trunk/libzypp/zypp/Package.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/Package.cc?rev=5338&r1=5337&r2=5338&view=diff
==============================================================================
--- trunk/libzypp/zypp/Package.cc (original)
+++ trunk/libzypp/zypp/Package.cc Wed Apr 11 15:34:51 2007
@@ -70,6 +70,8 @@
   PackageGroup Package::group() const
   { return pimpl().group(); }
 
+  Package::Keywords Package::keywords() const
+  { return pimpl().keywords(); }
 
   /** Don't ship it as class Url, because it might be
    * in fact anything but a legal Url. */

Modified: trunk/libzypp/zypp/Package.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/Package.h?rev=5338&r1=5337&r2=5338&view=diff
==============================================================================
--- trunk/libzypp/zypp/Package.h (original)
+++ trunk/libzypp/zypp/Package.h Wed Apr 11 15:34:51 2007
@@ -29,7 +29,6 @@
   */
   class Package : public ResObject
   {
-
   public:
     typedef detail::PackageImplIf    Impl;
     typedef Package                  Self;
@@ -38,6 +37,9 @@
     typedef TraitsType::constPtrType constPtr;
 
   public:
+    typedef std::set<PackageKeyword> Keywords;
+
+  public:
     /**
      * Checksum the source says this package should have
      */
@@ -54,6 +56,8 @@
     std::string packager() const;
     /** */
     PackageGroup group() const;
+    /** */
+    Keywords keywords() const;
     /** Don't ship it as class Url, because it might be
      * in fact anything but a legal Url. */
     std::string url() const;

Modified: trunk/libzypp/zypp/detail/PackageImplIf.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/detail/PackageImplIf.cc?rev=5338&r1=5337&r2=5338&view=diff
==============================================================================
--- trunk/libzypp/zypp/detail/PackageImplIf.cc (original)
+++ trunk/libzypp/zypp/detail/PackageImplIf.cc Wed Apr 11 15:34:51 2007
@@ -44,6 +44,9 @@
       PackageGroup PackageImplIf::group() const
       { return PackageGroup(); }
 
+      PackageImplIf::Keywords PackageImplIf::keywords() const
+      { return std::set<PackageKeyword>(); }
+
       Changelog PackageImplIf::changelog() const
       { return Changelog(); }
 

Modified: trunk/libzypp/zypp/detail/PackageImplIf.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/detail/PackageImplIf.h?rev=5338&r1=5337&r2=5338&view=diff
==============================================================================
--- trunk/libzypp/zypp/detail/PackageImplIf.h (original)
+++ trunk/libzypp/zypp/detail/PackageImplIf.h Wed Apr 11 15:34:51 2007
@@ -20,6 +20,7 @@
 #include "zypp/Arch.h"
 #include "zypp/Changelog.h"
 #include "zypp/DiskUsage.h"
+#include "zypp/PackageKeyword.h"
 #include "zypp/source/PackageDelta.h"
 
 ///////////////////////////////////////////////////////////////////
@@ -46,6 +47,7 @@
     public:
       typedef packagedelta::DeltaRpm    DeltaRpm;
       typedef packagedelta::PatchRpm    PatchRpm;
+      typedef std::set<PackageKeyword>  Keywords;
 
     public:
       /** \name Rpm Package Attributes. */
@@ -63,6 +65,8 @@
       /** */
       virtual PackageGroup group() const PURE_VIRTUAL;
       /** */
+      virtual Keywords keywords() const PURE_VIRTUAL;
+      /** */
       virtual Changelog changelog() const PURE_VIRTUAL;
       /** */
       virtual Pathname location() const PURE_VIRTUAL;

Modified: trunk/libzypp/zypp/source/susetags/PackagesParser.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/source/susetags/PackagesParser.cc?rev=5338&r1=5337&r2=5338&view=diff
==============================================================================
--- trunk/libzypp/zypp/source/susetags/PackagesParser.cc (original)
+++ trunk/libzypp/zypp/source/susetags/PackagesParser.cc Wed Apr 11 15:34:51 2007
@@ -356,13 +356,12 @@
     {
       collectDeps( mtag_r.values, _nvrad[Dep::ENHANCES] );
     }
-    else if ( mtag_r.name == "Key" )
+    else if ( mtag_r.name == "Kwd" )
     {
-      _pkgImpl->_keywords = mtag_r.values;
+      _pkgImpl->_keywords.insert( mtag_r.values.begin(), mtag_r.values.end() );
     }
     else if ( mtag_r.name == "Aut" )
     {
-      // MultiTag is a Set but author is a list
       _pkgImpl->_authors = mtag_r.values;
     }
   }

Modified: trunk/libzypp/zypp/source/susetags/SuseTagsPackageImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/source/susetags/SuseTagsPackageImpl.cc?rev=5338&r1=5337&r2=5338&view=diff
==============================================================================
--- trunk/libzypp/zypp/source/susetags/SuseTagsPackageImpl.cc (original)
+++ trunk/libzypp/zypp/source/susetags/SuseTagsPackageImpl.cc Wed Apr 11 15:34:51 2007
@@ -124,6 +124,11 @@
   return _group;
 }
 
+SuseTagsPackageImpl::Keywords SuseTagsPackageImpl::keywords() const
+{
+  return _keywords;
+}
+
 Changelog SuseTagsPackageImpl::changelog() const
 {
   return Changelog();

Modified: trunk/libzypp/zypp/source/susetags/SuseTagsPackageImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/source/susetags/SuseTagsPackageImpl.h?rev=5338&r1=5337&r2=5338&view=diff
==============================================================================
--- trunk/libzypp/zypp/source/susetags/SuseTagsPackageImpl.h (original)
+++ trunk/libzypp/zypp/source/susetags/SuseTagsPackageImpl.h Wed Apr 11 15:34:51 2007
@@ -68,7 +68,9 @@
         /** */
         virtual PackageGroup group() const;
         /** */
-        virtual Changelog changelog() const;
+       virtual Keywords keywords() const;
+       /** */
+       virtual Changelog changelog() const;
         /** */
         virtual Pathname location() const;
         /** Don't ship it as class Url, because it might be
@@ -109,8 +111,8 @@
         NVRA _nvra;
 
         PackageGroup _group;
+       Keywords _keywords;
         std::list<std::string> _authors;
-        std::list<std::string> _keywords;
         ByteCount _size;
         ByteCount _archivesize;
         Vendor _vendor;

Modified: trunk/libzypp/zypp/source/yum/YUMPackageImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/source/yum/YUMPackageImpl.cc?rev=5338&r1=5337&r2=5338&view=diff
==============================================================================
--- trunk/libzypp/zypp/source/yum/YUMPackageImpl.cc (original)
+++ trunk/libzypp/zypp/source/yum/YUMPackageImpl.cc Wed Apr 11 15:34:51 2007
@@ -53,7 +53,7 @@
     _changelog(), // TODO
     _type(parsed.type),
     _authors(parsed.authors),
-    _keywords( parsed.keywords),
+    _keywords( parsed.keywords.begin(), parsed.keywords.end() ),
     _mediaNumber(str::strtonum<unsigned int>(parsed.media)),
     _checksum(parsed.checksumType,
               parsed.checksum),
@@ -65,14 +65,6 @@
     _package_size(str::strtonum<unsigned int>(parsed.sizePackage)),
     _size(str::strtonum<unsigned int>(parsed.sizeInstalled)),
     _source(source_r)
-#if 0
-    :
-    _size_package(strtol(parsed.sizePackage.c_str(), 0, 10)),
-    _size_archive(strtol(parsed.sizeArchive.c_str(), 0, 10)),
-    _size_installed(strtol(parsed.sizeInstalled.c_str(), 0, 10)),
-    _sourcepkg(parsed.sourcerpm),
-    _dir_sizes(parsed.dirSizes),
-#endif
 {
   for (std::list<FileData>::const_iterator it = filelist.files.begin();
        it != filelist.files.end();
@@ -250,7 +242,7 @@
 }
 
 /** */
-std::list<std::string> YUMPackageImpl::keywords() const
+YUMPackageImpl::Keywords YUMPackageImpl::keywords() const
 {
   return _keywords;
 }

Modified: trunk/libzypp/zypp/source/yum/YUMPackageImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/source/yum/YUMPackageImpl.h?rev=5338&r1=5337&r2=5338&view=diff
==============================================================================
--- trunk/libzypp/zypp/source/yum/YUMPackageImpl.h (original)
+++ trunk/libzypp/zypp/source/yum/YUMPackageImpl.h Wed Apr 11 15:34:51 2007
@@ -97,7 +97,7 @@
   /** */
   virtual std::string type() const;
   /** */
-  virtual std::list<std::string> keywords() const;
+  virtual Keywords keywords() const;
   /** */
   virtual bool installOnly() const;
   /** */
@@ -123,7 +123,7 @@
   Changelog _changelog;
   std::string _type;
   std::list<std::string> _authors;
-  std::list<std::string> _keywords;
+  Keywords _keywords;
   unsigned _mediaNumber;
   CheckSum _checksum;
   std::list<std::string> _filenames;

Modified: trunk/libzypp/zypp/target/rpm/RpmPackageImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/target/rpm/RpmPackageImpl.cc?rev=5338&r1=5337&r2=5338&view=diff
==============================================================================
--- trunk/libzypp/zypp/target/rpm/RpmPackageImpl.cc (original)
+++ trunk/libzypp/zypp/target/rpm/RpmPackageImpl.cc Wed Apr 11 15:34:51 2007
@@ -50,17 +50,10 @@
        _group(data->tag_group()),
        _changelog(data->tag_changelog()),
        _type("rpm"), // FIXME in the future
-//     _authors(data->authors),
-//     _keywords(data->keywords),
        _filenames(data->tag_filenames()),
 //     _disk_usage(data->diskusage),
        _size(data->tag_size()),
        _archivesize(data->tag_archivesize())
-#if 0
-       _size_installed( strtol(parsed.sizeInstalled.c_str(), 0, 10)),
-       _sourcepkg( parsed.sourcerpm),
-       _dir_sizes(parsed.dirSizes),
-#endif
       {
         // we know we are reading english.
         _description.setText(data->tag_description(), Locale("en"));
@@ -159,10 +152,6 @@
       { return _archivesize; }
 
       /** */
-      std::list<std::string> RPMPackageImpl::authors() const
-      { return _authors; }
-
-      /** */
       std::list<std::string> RPMPackageImpl::filenames() const
       { return _filenames; }
 
@@ -171,10 +160,6 @@
       { return _type; }
 
       /** */
-      std::list<std::string> RPMPackageImpl::keywords() const
-      { return _keywords; }
-
-      /** */
       DiskUsage RPMPackageImpl::diskUsage() const
       { return _disk_usage; }
 

Modified: trunk/libzypp/zypp/target/rpm/RpmPackageImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/target/rpm/RpmPackageImpl.h?rev=5338&r1=5337&r2=5338&view=diff
==============================================================================
--- trunk/libzypp/zypp/target/rpm/RpmPackageImpl.h (original)
+++ trunk/libzypp/zypp/target/rpm/RpmPackageImpl.h Wed Apr 11 15:34:51 2007
@@ -85,14 +85,10 @@
        /** */
        virtual ByteCount archivesize() const;
        /** */
-       virtual std::list<std::string> authors() const;
-       /** */
        virtual std::list<std::string> filenames() const;
         /** */
         virtual std::string type() const;
         /** */
-        virtual std::list<std::string> keywords() const;
-        /** */
         virtual DiskUsage diskUsage() const;
         /** */
         virtual Source_Ref source() const;
@@ -115,8 +111,6 @@
        Changelog _changelog;
        Pathname _location;                     // for 'local' rpms
        std::string _type;
-       std::list<std::string> _authors;
-       std::list<std::string>_keywords;
        std::list<std::string> _filenames;
        DiskUsage _disk_usage;
        ByteCount _size;

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

< Previous Next >
This Thread
  • No further messages