Author: lslezak
Date: Tue Apr 15 15:24:46 2008
New Revision: 46675
URL: http://svn.opensuse.org/viewcvs/yast?rev=46675&view=rev
Log:
- added support for `languages in ResolvableProperties()
Modified:
trunk/pkg-bindings/package/yast2-pkg-bindings.changes
trunk/pkg-bindings/src/Resolvable_Properties.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=46675&r1=46674&r2=46675&view=diff
==============================================================================
--- trunk/pkg-bindings/package/yast2-pkg-bindings.changes (original)
+++ trunk/pkg-bindings/package/yast2-pkg-bindings.changes Tue Apr 15 15:24:46 2008
@@ -1,4 +1,9 @@
-------------------------------------------------------------------
+Tue Apr 15 15:15:08 CEST 2008 - lslezak@suse.cz
+
+- added support for `languages in ResolvableProperties()
+
+-------------------------------------------------------------------
Fri Apr 11 15:13:53 CEST 2008 - ma@suse.de
- Fix TargetProducts to return the satisfies products. Is satisfied
Modified: trunk/pkg-bindings/src/Resolvable_Properties.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/src/Resolvable_Properties.cc?rev=46675&r1=46674&r2=46675&view=diff
==============================================================================
--- trunk/pkg-bindings/src/Resolvable_Properties.cc (original)
+++ trunk/pkg-bindings/src/Resolvable_Properties.cc Tue Apr 15 15:24:46 2008
@@ -34,6 +34,7 @@
#include
#include
#include
+#include
#include
#include
@@ -41,6 +42,7 @@
#include
#include
+#include
/**
@builtin ResolvableProperties
@@ -105,7 +107,15 @@
YCPList ret;
if( req_kind == "product" ) {
- kind = zypp::ResTraitszypp::Product::kind;
+ kind = zypp::ResTraitszypp::Product::kind;
+/*
+ zypp::ResPool pool( zypp::ResPool::instance() );
+
+ for_( it, pool.satisfiedProductsBegin(), pool.satisfiedProductsEnd() )
+ {
+ zypp::Product_constPtr p( asKind<Product>(*it) );
+ }
+*/
}
else if ( req_kind == "patch" ) {
kind = zypp::ResTraitszypp::Patch::kind;
@@ -116,7 +126,35 @@
else if ( req_kind == "pattern" ) {
kind = zypp::ResTraitszypp::Pattern::kind;
}
-# warning add language support
+ else if ( req_kind == "language" )
+ {
+ try
+ {
+ const zypp::LocaleSet &avlocales( zypp::ResPool::instance().getAvailableLocales() );
+
+ for_( it, avlocales.begin(), avlocales.end() )
+ {
+ zypp::sat::LocaleSupport myLocale( *it );
+
+ YCPMap lang_map;
+
+ lang_map->add(YCPString("name"), YCPString(myLocale.locale().name()));
+ lang_map->add(YCPString("code"), YCPString(myLocale.locale().code()));
+ lang_map->add(YCPString("packages"), YCPBoolean(myLocale.isAvailable()));
+ lang_map->add(YCPString("requested"), YCPBoolean(myLocale.isRequested()));
+
+ ret->add(lang_map);
+ }
+ }
+ catch(const zypp::Exception &expt)
+ {
+ y2error("Caught exception: %s", expt.asString().c_str());
+ _last_error.setLastError(ExceptionAsString(expt));
+ return YCPVoid();
+ }
+
+ return ret;
+ }
else
{
y2error("Pkg::ResolvableProperties: unknown symbol: %s", req_kind.c_str());
@@ -347,7 +385,7 @@
/**
@builtin IsAnyResolvable
@short Is there any resolvable in the requried state?
- @param symbol kind_r kind of resolvable, can be `product, `patch, `package, `pattern, `language or `any for any kind of resolvable
+ @param symbol kind_r kind of resolvable, can be `product, `patch, `package, `pattern or `any for any kind of resolvable
@param symbol status status of resolvable, can be `to_install or `to_remove
@return boolean true if a resolvable with the requested status was found
*/
@@ -371,7 +409,6 @@
else if ( req_kind == "pattern" ) {
kind = zypp::ResTraitszypp::Pattern::kind;
}
-# warning add language support
else if ( req_kind == "any" ) {
try
{
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org