summaryrefslogtreecommitdiff
path: root/swig
diff options
context:
space:
mode:
authortux <tux@linux-hmt5.(none)>2012-02-14 19:20:21 +0100
committertux <tux@linux-hmt5.(none)>2012-02-14 19:20:21 +0100
commitade6ccba2ac96a5f2f933a69af0705e641a41f95 (patch)
treeda2dfb1f0da8b7f4116eed2bf44b739d066a4ee3 /swig
parente2f908f0180b0296910e484da10e33e90c97f0aa (diff)
downloadlibzypp-bindings-ade6ccba2ac96a5f2f933a69af0705e641a41f95.tar.gz
libzypp-bindings-ade6ccba2ac96a5f2f933a69af0705e641a41f95.tar.bz2
libzypp-bindings-ade6ccba2ac96a5f2f933a69af0705e641a41f95.zip
provide correctly provision for file. response is still not usable
Diffstat (limited to 'swig')
-rw-r--r--swig/PackageProvider.i11
-rw-r--r--swig/ruby/tests/target.rb7
2 files changed, 11 insertions, 7 deletions
diff --git a/swig/PackageProvider.i b/swig/PackageProvider.i
index 4d290dd..ac1c657 100644
--- a/swig/PackageProvider.i
+++ b/swig/PackageProvider.i
@@ -1 +1,10 @@
-%include <zypp/repo/PackageProvider.h>
+%include "zypp/repo/PackageProvider.h"
+%extend zypp::repo::PackageProvider {
+ static zypp::ManagedFile provide( zypp::repo::RepoMediaAccess & rm, const zypp::Package_constPtr pkg )
+ {
+ zypp::Package::constPtr pkg_type(pkg);
+ zypp::repo::DeltaCandidates dc;
+ zypp::repo::PackageProvider pp(rm,pkg_type,dc);
+ return pp.providePackage();
+ }
+}
diff --git a/swig/ruby/tests/target.rb b/swig/ruby/tests/target.rb
index 31b4396..40c9305 100644
--- a/swig/ruby/tests/target.rb
+++ b/swig/ruby/tests/target.rb
@@ -49,6 +49,7 @@ class LoadTest < Test::Unit::TestCase
end
i = 0
+ puts "search for libzypp ..."
p.each_by_name("libzypp") do |pi|
i = i + 1
break if i > 10
@@ -56,12 +57,6 @@ class LoadTest < Test::Unit::TestCase
r = pi.resolvable
assert_equal "libzypp",r.name
#try to download it
- pkg = asKindPackage(pi)
- puts RepoMediaAccess.new().class
- puts pkg.class
- puts DeltaCandidates.new().class
- puts pkg.distribution
- path = PackageProvider.new(RepoMediaAccess.new(),asKindPackage(pi),DeltaCandidates.new()).providePackage
end
assert true