Author: mlandres Date: Fri Aug 15 20:29:01 2008 New Revision: 10877 URL: http://svn.opensuse.org/viewcvs/zypp?rev=10877&view=rev Log: - Add Target::targetDistribution. Returns "distribution-arch" of the installed base product. Used for registration and i Service refresh. (for Fate #304915) Modified: trunk/libzypp/VERSION.cmake trunk/libzypp/devel/devel.ma/NewPool.cc trunk/libzypp/package/libzypp.changes trunk/libzypp/zypp/Target.cc trunk/libzypp/zypp/Target.h trunk/libzypp/zypp/target/TargetImpl.cc trunk/libzypp/zypp/target/TargetImpl.h Modified: trunk/libzypp/VERSION.cmake URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/VERSION.cmake?rev=10877&r1=10876&r2=10877&view=diff ============================================================================== --- trunk/libzypp/VERSION.cmake (original) +++ trunk/libzypp/VERSION.cmake Fri Aug 15 20:29:01 2008 @@ -63,6 +63,6 @@ SET(LIBZYPP_MINOR "6") SET(LIBZYPP_PATCH "0") # -# LAST RELEASED: 5.5.1 (5) +# LAST RELEASED: 5.6.0 (5) # (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?rev=10877&r1=10876&r2=10877&view=diff ============================================================================== --- trunk/libzypp/devel/devel.ma/NewPool.cc (original) +++ trunk/libzypp/devel/devel.ma/NewPool.cc Fri Aug 15 20:29:01 2008 @@ -529,13 +529,13 @@ /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// - // Pool of Selectables + // access to the Pool of Selectables ResPoolProxy selectablePool( ResPool::instance().proxy() ); // Iterate it's Products... for_( it, selectablePool.byKindBegin<Product>(), selectablePool.byKindEnd<Product>() ) { - // current Product Selectable + // The current Product Selectable ui::Selectable::Ptr prodSel( *it ); MIL << dump( prodSel ) << endl; @@ -550,7 +550,7 @@ // Iterate the replaced Products... for_( it, prodReplaces.begin(), prodReplaces.end() ) { - // current replaced Product + // The current replaced Product Product::constPtr replacedProduct( *it ); DBG << replacedProduct << endl; Modified: trunk/libzypp/package/libzypp.changes URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/package/libzypp.changes?rev=10877&r1=10876&r2=10877&view=diff ============================================================================== --- trunk/libzypp/package/libzypp.changes (original) +++ trunk/libzypp/package/libzypp.changes Fri Aug 15 20:29:01 2008 @@ -1,4 +1,13 @@ ------------------------------------------------------------------- +Fri Aug 15 20:20:07 CEST 2008 - ma@suse.de + +- Add Target::targetDistribution. Returns "distribution-arch" of + the installed base product. Used for registration and Service + refresh. (for Fate #304915) +- revision 10877 +- version 5.6.0 (5) + +------------------------------------------------------------------- Fri Aug 15 17:42:58 CEST 2008 - ma@suse.de - Add method Product::replacedProducts to identify installed Modified: trunk/libzypp/zypp/Target.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/Target.cc?rev=10877&r1=10876&r2=10877&view=diff ============================================================================== --- trunk/libzypp/zypp/Target.cc (original) +++ trunk/libzypp/zypp/Target.cc Fri Aug 15 20:29:01 2008 @@ -100,9 +100,12 @@ std::string Target::release() const { return _pimpl->release(); } + std::string Target::targetDistribution() const + { return _pimpl->targetDistribution(); } + std::string Target::anonymousUniqueId() const { return _pimpl->anonymousUniqueId(); } - + ///////////////////////////////////////////////////////////////// } // namespace zypp /////////////////////////////////////////////////////////////////// Modified: trunk/libzypp/zypp/Target.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/Target.h?rev=10877&r1=10876&r2=10877&view=diff ============================================================================== --- trunk/libzypp/zypp/Target.h (original) +++ trunk/libzypp/zypp/Target.h Fri Aug 15 20:29:01 2008 @@ -107,13 +107,18 @@ /** return the last modification date of the target */ Date timestamp() const; - /** The targets distribution release string. + /** The targets distribution release string (/etc/SuSE-release) * \code * openSUSE 10.3 (i586) * \endcode */ std::string release() const; + /** This is "distribution-arch" of the installed base product. + * Used for registration and \ref Service refresh. + */ + std::string targetDistribution() const; + /** * anonymous unique id * Modified: trunk/libzypp/zypp/target/TargetImpl.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/target/TargetImpl.cc?rev=10877&r1=10876&r2=10877&view=diff ============================================================================== --- trunk/libzypp/zypp/target/TargetImpl.cc (original) +++ trunk/libzypp/zypp/target/TargetImpl.cc Fri Aug 15 20:29:01 2008 @@ -871,6 +871,30 @@ return _("Unknown Distribution"); } + std::string TargetImpl::targetDistribution() const + { + std::ifstream baseProduct( (_root / "/etc/products.d/baseproduct").c_str() ); + for( iostr::EachLine in( baseProduct ); in; in.next() ) + { + std::string line( str::trim( *in ) ); + if ( str::hasPrefix( line, "distribution" ) ) + { + std::string::size_type pos( line.find( '=', 12 ) ); + if ( pos == std::string::npos ) + continue; // no '=' on line + pos = line.find_first_not_of( " \t", pos+1 ); + if ( pos == std::string::npos ) + continue; // empty value + line.erase( 0, pos ); + line += "-"; + line += ZConfig::instance().systemArchitecture().asString(); + return line; + } + } + WAR << "No distribution in " << PathInfo(_root / "/etc/products.d/baseproduct") << endl; + return std::string(); + } + std::string TargetImpl::anonymousUniqueId() const { std::ifstream idfile( ( home() / "AnonymousUniqueId" ).c_str() ); Modified: trunk/libzypp/zypp/target/TargetImpl.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/target/TargetImpl.h?rev=10877&r1=10876&r2=10877&view=diff ============================================================================== --- trunk/libzypp/zypp/target/TargetImpl.h (original) +++ trunk/libzypp/zypp/target/TargetImpl.h Fri Aug 15 20:29:01 2008 @@ -148,6 +148,11 @@ */ std::string release() const; + /** This is "distribution-arch" of the installed base product. + * Used for registration and \ref Service refresh. + */ + std::string targetDistribution() const; + protected: /** Path to the target */ Pathname _root; -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org