{
filesystem::TmpDir tmp;
-
+
ZYpp::Ptr z = getZYpp();
// create the products.d directory
// make it the base product
BOOST_CHECK( symlink(tmp.path() / "/etc/products.d/product.prod", tmp.path() / "/etc/products.d/baseproduct" ) == 0 );
-
+
z->initializeTarget( tmp.path() );
-
+
BOOST_CHECK( ! z->target()->anonymousUniqueId().empty() );
BOOST_CHECK( PathInfo( tmp.path() / "/var/lib/zypp/AnonymousUniqueId").isExist() );
BOOST_CHECK( PathInfo( tmp.path() / "/var/lib/zypp/AnonymousUniqueId").size() > 0 );
BOOST_CHECK_EQUAL( z->target()->targetDistributionRelease(), "special_edition");
BOOST_CHECK_EQUAL( z->target()->distributionVersion(), "10");
+ Target::DistributionLabel dlabel( z->target()->distributionLabel() );
+ BOOST_CHECK_EQUAL( dlabel.summary, "A cool distribution" );
+ BOOST_CHECK_EQUAL( dlabel.shortName, "" );
}
("release", MANDTAORY, xml::parseDefAssign( _release ) )
("arch", MANDTAORY, xml::parseDefAssign( _pdata._arch ) )
("shortsummary", OPTIONAL, xml::parseDefAssign( _pdata._shortName ) )
- ("summary", OPTIONAL, xml::parseDefAssign( _pdata._summary ) )
+ ("summary", MULTIPLE_OPTIONAL, xml::parseDefAssign( _ttext )( "lang", _tlocale )
+ >>bind( &ProductNode::doneLocalizedDefault, this, _1, ref(_pdata._summary) ))
("productline", OPTIONAL, xml::parseDefAssign( _pdata._productline ) )
("register", OPTIONAL)
("updaterepokey", OPTIONAL, xml::parseDefAssign( _pdata._updaterepokey ) )
_pdata._upgrades.push_back( cdata );
_upgrade = ProductFileData::Upgrade::Impl();
}
+ /** collect localized data */
+ void doneLocalizedDefault( const xml::Node & _node, std::string & store_r )
+ {
+ // take 1st or default
+ if ( store_r.empty() || _tlocale.empty() )
+ store_r = _ttext;
+ }
/** finaly */
void done( const xml::Node & _node )
std::string _version;
std::string _release;
+ std::string _ttext;
+ std::string _tlocale;
+
ProductFileData::Upgrade::Impl _upgrade;
};