Author: lslezak Date: Fri Aug 24 08:58:32 2007 New Revision: 40441 URL: http://svn.opensuse.org/viewcvs/yast?rev=40441&view=rev Log: - Pkg::PkgMediaNames() - return repository names instead of product names (#304152) Modified: trunk/pkg-bindings/package/yast2-pkg-bindings.changes trunk/pkg-bindings/src/Package.cc Modified: trunk/pkg-bindings/package/yast2-pkg-bindings.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/package/yast2-pkg-bindings.changes?rev=40441&r1=40440&r2=40441&view=diff ============================================================================== --- trunk/pkg-bindings/package/yast2-pkg-bindings.changes (original) +++ trunk/pkg-bindings/package/yast2-pkg-bindings.changes Fri Aug 24 08:58:32 2007 @@ -1,8 +1,10 @@ ------------------------------------------------------------------- Thu Aug 23 14:03:19 CEST 2007 - lslezak@suse.cz -- load resolvables from all working repositories even when some of - them fails (#302432) +- Pkg::SourceLoad() - load resolvables from all working + repositories even when some of them fails (#302432) +- Pkg::PkgMediaNames() - return repository names instead of + product names (#304152) ------------------------------------------------------------------- Mon Aug 20 17:27:57 CEST 2007 - lslezak@suse.cz Modified: trunk/pkg-bindings/src/Package.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/src/Package.cc?rev=40441&r1=40440&r2=40441&view=diff ============================================================================== --- trunk/pkg-bindings/src/Package.cc (original) +++ trunk/pkg-bindings/src/Package.cc Fri Aug 24 08:58:32 2007 @@ -202,42 +202,12 @@ { try { - // find a product for the given source - zypp::ResPool::byKind_iterator it = zypp_ptr()->pool().byKindBegin(zypp::ResTraitszypp::Product::kind); + std::string repo_name = (*repoit)->repoInfo().name(); + YCPList src_desc; - for( ; it != zypp_ptr()->pool().byKindEnd(zypp::ResTraitszypp::Product::kind) - ; ++it) { - zypp::Product::constPtr product = boost::dynamic_pointer_cast<const zypp::Product>( it->resolvable() ); - - y2debug ("Checking product: %s", product->summary().c_str()); - if( product->repository().info().alias() == (*repoit)->repoInfo().alias()) - { - y2debug ("Found"); - - YCPList src_desc; - - // use name if the summary is empty - std::string product_name = product->summary(); - if (product_name.empty()) - { - product_name = product->name(); - } - - src_desc->add( YCPString( product_name ) ); - src_desc->add( YCPInteger( index ) ); - - res->add( src_desc ); - break; - } - } - - // the product hasn't been found, resolvables are probably not loaded - // use URL as the product name in such case - if( it == zypp_ptr()->pool().byKindEnd(zypp::ResTraitszypp::Product::kind) ) + if (repo_name.empty()) { - y2warning("Product for source '%d' not found", index); - - YCPList src_desc; + y2warning("Name of repository '%d' is empty, using URL", index); // use URL as the product name std::string name; @@ -257,6 +227,13 @@ res->add( src_desc ); } + else + { + src_desc->add( YCPString( repo_name )); + src_desc->add( YCPInteger( index ) ); + + res->add( src_desc ); + } } catch (...) { -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org