[yast-commit] r65026 - in /trunk/pkg-bindings: VERSION package/yast2-pkg-bindings.changes src/Resolvable_Properties.cc
Author: lslezak Date: Wed Jul 27 10:11:53 2011 New Revision: 65026 URL: http://svn.opensuse.org/viewcvs/yast?rev=65026&view=rev Log: - Pkg::ResolvableProperties() supports source packages (`srcpackage) resolvables - 2.21.5 Modified: trunk/pkg-bindings/VERSION trunk/pkg-bindings/package/yast2-pkg-bindings.changes trunk/pkg-bindings/src/Resolvable_Properties.cc Modified: trunk/pkg-bindings/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/VERSION?rev=65026&r1=65025&r2=65026&view=diff ============================================================================== --- trunk/pkg-bindings/VERSION (original) +++ trunk/pkg-bindings/VERSION Wed Jul 27 10:11:53 2011 @@ -1 +1 @@ -2.21.4 +2.21.5 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=65026&r1=65025&r2=65026&view=diff ============================================================================== --- trunk/pkg-bindings/package/yast2-pkg-bindings.changes (original) +++ trunk/pkg-bindings/package/yast2-pkg-bindings.changes Wed Jul 27 10:11:53 2011 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Wed Jul 27 08:09:42 UTC 2011 - lslezak@suse.cz + +- Pkg::ResolvableProperties() supports source packages + (`srcpackage) resolvables +- 2.21.5 + +------------------------------------------------------------------- Mon Jun 27 15:04:18 UTC 2011 - lslezak@suse.cz - ignore deleted repositories when checking uniqueness of an alias Modified: trunk/pkg-bindings/src/Resolvable_Properties.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/src/Resolvable_Properties.cc?rev=65026&r1=65025&r2=65026&view=diff ============================================================================== --- trunk/pkg-bindings/src/Resolvable_Properties.cc (original) +++ trunk/pkg-bindings/src/Resolvable_Properties.cc Wed Jul 27 10:11:53 2011 @@ -41,6 +41,7 @@ #include <zypp/Patch.h> #include <zypp/Pattern.h> #include <zypp/Package.h> +#include <zypp/SrcPackage.h> #include <zypp/ui/Status.h> #include <zypp/Dep.h> @@ -108,6 +109,10 @@ `package keys: + "path" + "location" + `srcpackage keys: + + "path" + + "location" + + "src_type" -> string : "src" or "nosrc" type `pattern keys: + "category" + "user_visible" @@ -258,6 +263,30 @@ y2error("package %s is not a package", item->name().c_str() ); } } + else if( req_kind == "srcpackage" ) + { + zypp::SrcPackage::constPtr pkg = boost::dynamic_pointer_cast<const zypp::SrcPackage>(item.resolvable()); + if (pkg) + { + std::string tmp(pkg->location().filename().asString()); + if (!tmp.empty()) + { + info->add(YCPString("path"), YCPString(tmp)); + } + + tmp = pkg->location().filename().basename(); + if (!tmp.empty()) + { + info->add(YCPString("location"), YCPString(tmp)); + } + + info->add(YCPString("src_type"), YCPString(pkg->sourcePkgType())); + } + else + { + y2error("%s is not a srcpackage", item->name().c_str() ); + } + } // product specific info else if( req_kind == "product" ) { zypp::Product::constPtr product = boost::dynamic_pointer_cast<const zypp::Product>(item.resolvable()); @@ -564,6 +593,9 @@ else if ( req_kind == "package" ) { kind = zypp::ResKind::package; } + else if ( req_kind == "srcpackage" ) { + kind = zypp::ResKind::srcpackage; + } else if ( req_kind == "pattern" ) { kind = zypp::ResKind::pattern; } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
lslezak@svn2.opensuse.org