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)
#=======
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
- // 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;
// Iterate the replaced Products...
for_( it, prodReplaces.begin(), prodReplaces.end() )
{
- // current replaced Product
+ // The current replaced Product
Product::constPtr replacedProduct( *it );
DBG << replacedProduct << endl;
-------------------------------------------------------------------
+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
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
///////////////////////////////////////////////////////////////////
/** 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
*
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() );
*/
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;