add products/keywords to repository
authorDuncan Mac-Vicar P <dmacvicar@suse.de>
Mon, 22 Sep 2008 13:08:14 +0000 (13:08 +0000)
committerDuncan Mac-Vicar P <dmacvicar@suse.de>
Mon, 22 Sep 2008 13:08:14 +0000 (13:08 +0000)
add cpename to product

libzypp.spec.cmake
zypp/Product.cc
zypp/Product.h
zypp/Repository.cc
zypp/Repository.h
zypp/sat/SolvAttr.cc
zypp/sat/SolvAttr.h

index 8ee9d1f..7089461 100644 (file)
@@ -24,7 +24,7 @@ Prefix:         /usr
 Provides:       yast2-packagemanager
 Obsoletes:      yast2-packagemanager
 BuildRequires:  cmake
-BuildRequires:  libsatsolver-devel >= 0.10.11 openssl-devel
+BuildRequires:  libsatsolver-devel >= 0.10.13 openssl-devel
 BuildRequires:  boost-devel curl-devel dejagnu doxygen gcc-c++ gettext-devel graphviz hal-devel libxml2-devel
 
 %if 0%{?suse_version}
index d1e7add..44f92d9 100644 (file)
@@ -144,6 +144,9 @@ namespace zypp
   std::string Product::updaterepoKey() const
   { return lookupStrAttribute( sat::SolvAttr::productUpdaterepoKey ); }
 
+  std::string Product::cpeName() const
+  { return lookupStrAttribute( sat::SolvAttr::productCpeName ); }
+
   std::list<std::string> Product::flags() const
   {
     std::list<std::string> ret;
index 9dfbb87..3aac0c7 100644 (file)
@@ -75,6 +75,14 @@ namespace zypp
      */
     std::string updaterepoKey() const;
 
+    /**
+     * The Common Platform Enumeration name
+     * for this product.
+     *
+     * See http://cpe.mitre.org
+     */
+    std::string cpeName() const;
+
     /** The product flags */
     std::list<std::string> flags() const;
 
index 497b59f..4d9fe0d 100644 (file)
@@ -123,6 +123,12 @@ namespace zypp
       return Date();
     }
 
+    Repository::Keywords Repository::keywords() const
+    { return Keywords(sat::SolvAttr::repositoryKeywords); }
+    
+    Repository::Products Repository::products() const
+    { return Products(sat::SolvAttr::repositoryProducts); }
+
     bool Repository::maybeOutdated() const
     {
         // system repo is not mirrored
index 932402b..da972f5 100644 (file)
@@ -48,6 +48,8 @@ namespace zypp
         typedef sat::detail::size_type size_type;
         typedef sat::detail::RepoIdType IdType;
         typedef sat::ArrayAttr<std::string,std::string> UpdateKeys;
+        typedef sat::ArrayAttr<std::string,std::string> Keywords;
+        typedef sat::ArrayAttr<std::string,std::string> Products;
 
     public:
         /** Default ctor creates \ref noRepository.*/
@@ -134,6 +136,17 @@ namespace zypp
         zypp::Date suggestedExpirationTimestamp() const;
 
         /**
+         * repository keywords (tags)
+         */
+        Keywords keywords() const;
+
+        /**
+         * Products this repository claims it is
+         * built for.
+         */
+        Products products() const;
+
+        /**
          * The suggested expiration date of this repository
          * already passed
          *
index 303f835..67d38c5 100644 (file)
@@ -109,11 +109,14 @@ namespace sat
   const SolvAttr SolvAttr::productRegisterRelease( PRODUCT_REGISTER_RELEASE );
   const SolvAttr SolvAttr::productUrl( PRODUCT_URL );
   const SolvAttr SolvAttr::productUrlType( PRODUCT_URL_TYPE );
+  const SolvAttr SolvAttr::productCpeName( PRODUCT_CPE_NAME );
 
   // repository
   const SolvAttr SolvAttr::repositoryTimestamp ( REPOSITORY_TIMESTAMP );
   const SolvAttr SolvAttr::repositoryExpire ( REPOSITORY_EXPIRE );
   const SolvAttr SolvAttr::repositoryUpdates ( REPOSITORY_UPDATES );
+  const SolvAttr SolvAttr::repositoryProducts ( REPOSITORY_PRODUCTS );
+  const SolvAttr SolvAttr::repositoryKeywords ( REPOSITORY_KEYWORDS );
 
 } // namespace sat
   /////////////////////////////////////////////////////////////////
index 7c3ad11..4dc6940 100644 (file)
@@ -134,6 +134,8 @@ namespace sat
       static const SolvAttr productRegisterRelease;
       static const SolvAttr productUrl;
       static const SolvAttr productUrlType;
+      static const SolvAttr productCpeName;
+
       //@}
 
       /** \name repository */
@@ -141,6 +143,9 @@ namespace sat
       static const SolvAttr repositoryTimestamp;
       static const SolvAttr repositoryExpire;
       static const SolvAttr repositoryUpdates;
+      static const SolvAttr repositoryKeywords;
+      static const SolvAttr repositoryProducts;
+
       //@}
 
       //@}