From eacb7cf6060b3ee5a3ad456c020612b3d5afceaa Mon Sep 17 00:00:00 2001 From: Duncan Mac-Vicar P Date: Mon, 22 Sep 2008 13:08:14 +0000 Subject: [PATCH] add products/keywords to repository add cpename to product --- libzypp.spec.cmake | 2 +- zypp/Product.cc | 3 +++ zypp/Product.h | 8 ++++++++ zypp/Repository.cc | 6 ++++++ zypp/Repository.h | 13 +++++++++++++ zypp/sat/SolvAttr.cc | 3 +++ zypp/sat/SolvAttr.h | 5 +++++ 7 files changed, 39 insertions(+), 1 deletion(-) diff --git a/libzypp.spec.cmake b/libzypp.spec.cmake index 8ee9d1f..7089461 100644 --- a/libzypp.spec.cmake +++ b/libzypp.spec.cmake @@ -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} diff --git a/zypp/Product.cc b/zypp/Product.cc index d1e7add..44f92d9 100644 --- a/zypp/Product.cc +++ b/zypp/Product.cc @@ -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 Product::flags() const { std::list ret; diff --git a/zypp/Product.h b/zypp/Product.h index 9dfbb87..3aac0c7 100644 --- a/zypp/Product.h +++ b/zypp/Product.h @@ -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 flags() const; diff --git a/zypp/Repository.cc b/zypp/Repository.cc index 497b59f..4d9fe0d 100644 --- a/zypp/Repository.cc +++ b/zypp/Repository.cc @@ -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 diff --git a/zypp/Repository.h b/zypp/Repository.h index 932402b..da972f5 100644 --- a/zypp/Repository.h +++ b/zypp/Repository.h @@ -48,6 +48,8 @@ namespace zypp typedef sat::detail::size_type size_type; typedef sat::detail::RepoIdType IdType; typedef sat::ArrayAttr UpdateKeys; + typedef sat::ArrayAttr Keywords; + typedef sat::ArrayAttr 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 * diff --git a/zypp/sat/SolvAttr.cc b/zypp/sat/SolvAttr.cc index 303f835..67d38c5 100644 --- a/zypp/sat/SolvAttr.cc +++ b/zypp/sat/SolvAttr.cc @@ -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 ///////////////////////////////////////////////////////////////// diff --git a/zypp/sat/SolvAttr.h b/zypp/sat/SolvAttr.h index 7c3ad11..4dc6940 100644 --- a/zypp/sat/SolvAttr.h +++ b/zypp/sat/SolvAttr.h @@ -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; + //@} //@} -- 2.7.4