Author: mlandres Date: Fri Sep 26 15:39:39 2008 New Revision: 11182 URL: http://svn.opensuse.org/viewcvs/zypp?rev=11182&view=rev Log: - Fix computation of Product::flavor. - Add Product::productLine. A vendor specific string denoting the product line. Modified: trunk/libzypp/VERSION.cmake trunk/libzypp/devel/devel.ma/NewPool.cc trunk/libzypp/package/libzypp.changes trunk/libzypp/zypp/Product.cc trunk/libzypp/zypp/Product.h trunk/libzypp/zypp/sat/SolvAttr.cc trunk/libzypp/zypp/sat/SolvAttr.h Modified: trunk/libzypp/VERSION.cmake URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/VERSION.cmake?rev=11182&a... ============================================================================== --- trunk/libzypp/VERSION.cmake (original) +++ trunk/libzypp/VERSION.cmake Fri Sep 26 15:39:39 2008 @@ -63,6 +63,6 @@ SET(LIBZYPP_MINOR "13") SET(LIBZYPP_PATCH "0") # -# LAST RELEASED: 5.12.0 (12) +# LAST RELEASED: 5.13.0 (13) # (The number in parenthesis is LIBZYPP_COMPATMINOR) #======= Modified: trunk/libzypp/devel/devel.ma/NewPool.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.ma/NewPool.cc... ============================================================================== --- trunk/libzypp/devel/devel.ma/NewPool.cc (original) +++ trunk/libzypp/devel/devel.ma/NewPool.cc Fri Sep 26 15:39:39 2008 @@ -443,6 +443,23 @@ INT << "===[START]==========================================" << endl; ZConfig::instance(); + { + Capability cap("flavor(dvd9)"); + DBG << cap.detail().isSimple() << endl; + DBG << cap.detail().isNamed() << endl; + DBG << cap.detail().name() << endl; + std::string capstr = str::stripPrefix( cap.asString(), "flavor(" ); + DBG << capstr << endl; + capstr.erase(capstr.size()-1); + DBG << capstr << endl; + } + + + /////////////////////////////////////////////////////////////////// + INT << "===[END]============================================" << endl << endl; + zypp::base::LogControl::instance().logNothing(); + return 0; + #if 0 RepoManager repoManager( makeRepoManager( sysRoot ) ); @@ -504,7 +521,6 @@ getZYpp()->target()->load(); USR << getZYpp()->target()->targetDistribution() << endl; USR << getZYpp()->target()->targetDistributionRelease() << endl; - USR << getZYpp()->target()->targetDistributionFlavor() << endl; } } @@ -616,10 +632,10 @@ PoolItem pi ( getPi<Package>("amarok") ); MIL << pi << endl; - MIL << pi->as<Package>() << endl; - MIL << pi->as<Product>() << endl; + MIL << pi->asKind<Package>() << endl; + MIL << pi->asKind<Product>() << endl; if ( pi->isKind<Package>() ) - SEC << pi->as<Package>() << endl; + SEC << pi->asKind<Package>() << endl; ////////////////////////////////////////////////////////////////// INT << "===[END]============================================" << endl << endl; Modified: trunk/libzypp/package/libzypp.changes URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/package/libzypp.changes?r... ============================================================================== --- trunk/libzypp/package/libzypp.changes (original) +++ trunk/libzypp/package/libzypp.changes Fri Sep 26 15:39:39 2008 @@ -1,4 +1,13 @@ ------------------------------------------------------------------- +Fri Sep 26 15:37:50 CEST 2008 - ma@suse.de + +- Fix computation of Product::flavor. +- Add Product::productLine. A vendor specific string denoting the + product line. +- revision 11182 +- version 5.13.0 (13) + +------------------------------------------------------------------- Thu Sep 25 23:19:55 CEST 2008 - jkupec@suse.cz - ZConfig::credentialsGlobal{File,Dir}() added Modified: trunk/libzypp/zypp/Product.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/Product.cc?rev=11182... ============================================================================== --- trunk/libzypp/zypp/Product.cc (original) +++ trunk/libzypp/zypp/Product.cc Fri Sep 26 15:39:39 2008 @@ -114,17 +114,48 @@ if ( (*it).buddy().isKind( ResKind::product ) ) ret.push_back( make<Product>( (*it).buddy() ) ); } - return ret; } + std::string Product::productLine() const + { +#warning productLine needs to be implemented. + return std::string(); + } + /////////////////////////////////////////////////////////////////// std::string Product::shortName() const { return lookupStrAttribute( sat::SolvAttr::productShortlabel ); } std::string Product::flavor() const - { return lookupStrAttribute( sat::SolvAttr::productFlavor ); } + { + // Look for a provider of 'product_flavor(name) = version' + // within the same repo. Unlike the reference package, we + // can be relaxed and ignore the architecture. + Capability identCap( str::form( "product_flavor(%s) = %s", name().c_str(), edition().c_str() ) ); + + sat::WhatProvides providers( identCap ); + for_( it, providers.begin(), providers.end() ) + { + if ( it->repository() == repository() ) + { + // Got the package now try to get the provided 'flavor(...)' + Capabilities provides( it->provides() ); + for_( cap, provides.begin(), provides.end() ) + { + std::string capstr( cap.asString() ); + if ( str::hasPrefix( capstr, "flavor(" ) ) + { + capstr = str::stripPrefix( capstr, "flavor(" ); + capstr.erase( capstr.size()-1 ); // trailing ')' + return capstr; + } + } + } + } + return std::string(); + } std::string Product::type() const { return lookupStrAttribute( sat::SolvAttr::productType ); } @@ -162,7 +193,6 @@ /* safety checks, shouldn't happen (tm) */ if (url_type_it == url_type.end()) { - /* FIXME: Raise exception ?! */ ERR << *this << " : The thing that should not happen, happened." << endl; break; } Modified: trunk/libzypp/zypp/Product.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/Product.h?rev=11182&... ============================================================================== --- trunk/libzypp/zypp/Product.h (original) +++ trunk/libzypp/zypp/Product.h Fri Sep 26 15:39:39 2008 @@ -52,6 +52,9 @@ */ ReplacedProducts replacedProducts() const; + /** Vendor specific string denoting the product line. */ + std::string productLine() const; + public: /** Untranslated short name like <tt>SLES 10</tt>*/ std::string shortName() const; Modified: trunk/libzypp/zypp/sat/SolvAttr.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/SolvAttr.cc?rev=... ============================================================================== --- trunk/libzypp/zypp/sat/SolvAttr.cc (original) +++ trunk/libzypp/zypp/sat/SolvAttr.cc Fri Sep 26 15:39:39 2008 @@ -103,19 +103,18 @@ const SolvAttr SolvAttr::productDistversion ( PRODUCT_DISTVERSION ); const SolvAttr SolvAttr::productType ( PRODUCT_TYPE ); const SolvAttr SolvAttr::productFlags ( PRODUCT_FLAGS ); - const SolvAttr SolvAttr::productFlavor ( PRODUCT_FLAVOR ); const SolvAttr SolvAttr::productUpdaterepoKey ( PRODUCT_UPDATEREPOKEY ); const SolvAttr SolvAttr::productRegisterTarget ( PRODUCT_REGISTER_TARGET ); const SolvAttr SolvAttr::productRegisterRelease( PRODUCT_REGISTER_RELEASE ); - const SolvAttr SolvAttr::productUrl( PRODUCT_URL ); - const SolvAttr SolvAttr::productUrlType( PRODUCT_URL_TYPE ); + const SolvAttr SolvAttr::productUrl ( PRODUCT_URL ); + const SolvAttr SolvAttr::productUrlType ( PRODUCT_URL_TYPE ); // 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 ); + 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 ///////////////////////////////////////////////////////////////// Modified: trunk/libzypp/zypp/sat/SolvAttr.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/SolvAttr.h?rev=1... ============================================================================== --- trunk/libzypp/zypp/sat/SolvAttr.h (original) +++ trunk/libzypp/zypp/sat/SolvAttr.h Fri Sep 26 15:39:39 2008 @@ -128,7 +128,6 @@ static const SolvAttr productDistversion; static const SolvAttr productType; static const SolvAttr productFlags; - static const SolvAttr productFlavor; static const SolvAttr productUpdaterepoKey; static const SolvAttr productRegisterTarget; static const SolvAttr productRegisterRelease; -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org