Hello community, here is the log from the commit of package libzypp-bindings for openSUSE:Factory checked in at 2012-03-06 13:39:02 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libzypp-bindings (Old) and /work/SRC/openSUSE:Factory/.libzypp-bindings.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libzypp-bindings", Maintainer is "dmacvi...@suse.com" Changes: -------- --- /work/SRC/openSUSE:Factory/libzypp-bindings/libzypp-bindings.changes 2011-10-19 14:07:59.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.libzypp-bindings.new/libzypp-bindings.changes 2012-03-06 13:39:14.000000000 +0100 @@ -1,0 +2,9 @@ +Tue Feb 28 13:16:22 UTC 2012 - jreidin...@suse.com + +- fix iteration over pool in ruby (bnc#746439) +- add ability to use PackageProvider via bindings +- predefine class for ZyppException in ruby so it can be used after + require of zypp +- version 0.5.11 + +------------------------------------------------------------------- Old: ---- libzypp-bindings-0.5.10.tar.bz2 New: ---- libzypp-bindings-0.5.11.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libzypp-bindings.spec ++++++ --- /var/tmp/diff_new_pack.Npyu73/_old 2012-03-06 13:39:16.000000000 +0100 +++ /var/tmp/diff_new_pack.Npyu73/_new 2012-03-06 13:39:16.000000000 +0100 @@ -18,9 +18,9 @@ # nodebuginfo Name: libzypp-bindings -Version: 0.5.10 +Version: 0.5.11 Release: 0 -License: GPLv2+ +License: GPL-2.0+ Summary: Bindings for libzypp Group: Development/Sources BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -63,7 +63,7 @@ %{__rm} -rf %{buildroot} %package -n ruby-zypp -License: GPLv2+ +License: GPL-2.0+ Summary: Ruby bindings for libzypp Group: Development/Languages/Ruby @@ -80,7 +80,7 @@ %endif %package -n python-zypp -License: GPLv2+ +License: GPL-2.0+ Summary: Python bindings for libzypp Group: Development/Languages/Python %description -n python-zypp @@ -92,7 +92,7 @@ %{py_sitedir}/zypp.py %package -n perl-zypp -License: GPLv2+ +License: GPL-2.0+ Requires: perl = %{perl_version} Summary: Perl bindings for libzypp Group: Development/Languages/Perl ++++++ libzypp-bindings-0.5.10.tar.bz2 -> libzypp-bindings-0.5.11.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-bindings-0.5.10/VERSION.cmake new/libzypp-bindings-0.5.11/VERSION.cmake --- old/libzypp-bindings-0.5.10/VERSION.cmake 2011-10-18 18:35:54.000000000 +0200 +++ new/libzypp-bindings-0.5.11/VERSION.cmake 2012-03-02 11:41:30.000000000 +0100 @@ -1,3 +1,3 @@ SET(VERSION_MAJOR "0") SET(VERSION_MINOR "5") -SET(VERSION_PATCH "10") +SET(VERSION_PATCH "11") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-bindings-0.5.10/examples/ruby/download_rpms.rb new/libzypp-bindings-0.5.11/examples/ruby/download_rpms.rb --- old/libzypp-bindings-0.5.10/examples/ruby/download_rpms.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/libzypp-bindings-0.5.11/examples/ruby/download_rpms.rb 2012-03-02 11:41:30.000000000 +0100 @@ -0,0 +1,43 @@ +#!/usr/bin/ruby + +require 'tmpdir' +require 'zypp' +include Zypp + +def initialize_repo dir + rm_opts = RepoManagerOptions.new Pathname.new(dir) + repo_manager = RepoManager.new rm_opts + #ignore certificate issues + KeyRing.setDefaultAccept( KeyRing::ACCEPT_UNKNOWNKEY | + KeyRing::ACCEPT_VERIFICATION_FAILED | KeyRing::ACCEPT_UNSIGNED_FILE | + KeyRing::TRUST_KEY_TEMPORARILY ) + repo_info = RepoInfo.new + url = Zypp::Url.new "http://download.opensuse.org/distribution/openSUSE-stable/repo/oss" + repo_info.setBaseUrl(url) + repo_info.setKeepPackages(true) + repo_alias = "repo" + repo_info.setAlias repo_alias + repo_manager.addRepository repo_info + repo_manager.refreshMetadata repo_info + repo_manager.buildCache repo_info + repo_manager.loadFromCache repo_info + return repo_manager +end + +Dir.mktmpdir do |dir| + #do not lock global zypp + ENV["ZYPP_LOCKFILE_ROOT"] = dir + zypp = ZYppFactory.instance.getZYpp + zypp.initializeTarget Pathname.new dir + puts "initialize repository. It can take serious amount of time" + repo_manager = initialize_repo dir + rma = RepoMediaAccess.new + zypp.pool.each_by_name("libzypp") do |pi| + r = pi.resolvable + puts "downloading rpm for #{r.name}-#{r.edition}" + path = PackageProvider.provide(rma,asKindPackage(pi)) + FileUtils.cp path.to_s,dir + end + puts "downloaded files:" + puts `ls -l #{dir}/*.rpm` +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-bindings-0.5.10/libzypp-bindings.spec.cmake new/libzypp-bindings-0.5.11/libzypp-bindings.spec.cmake --- old/libzypp-bindings-0.5.10/libzypp-bindings.spec.cmake 2011-10-18 18:35:54.000000000 +0200 +++ new/libzypp-bindings-0.5.11/libzypp-bindings.spec.cmake 2012-03-02 11:41:30.000000000 +0100 @@ -20,7 +20,7 @@ Name: @PACKAGE@ Version: @VERSION@ Release: 0 -License: GPLv2+ +License: GPL-2.0+ Summary: Bindings for libzypp Group: Development/Sources BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -63,7 +63,7 @@ %{__rm} -rf %{buildroot} %package -n ruby-zypp -License: GPLv2+ +License: GPL-2.0+ Summary: Ruby bindings for libzypp Group: Development/Languages/Ruby @@ -80,7 +80,7 @@ %endif %package -n python-zypp -License: GPLv2+ +License: GPL-2.0+ Summary: Python bindings for libzypp Group: Development/Languages/Python %description -n python-zypp @@ -92,7 +92,7 @@ %{py_sitedir}/zypp.py %package -n perl-zypp -License: GPLv2+ +License: GPL-2.0+ Requires: perl = %{perl_version} Summary: Perl bindings for libzypp Group: Development/Languages/Perl diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-bindings-0.5.10/package/libzypp-bindings.changes new/libzypp-bindings-0.5.11/package/libzypp-bindings.changes --- old/libzypp-bindings-0.5.10/package/libzypp-bindings.changes 2011-10-18 18:35:54.000000000 +0200 +++ new/libzypp-bindings-0.5.11/package/libzypp-bindings.changes 2012-03-02 11:41:30.000000000 +0100 @@ -1,4 +1,13 @@ ------------------------------------------------------------------- +Tue Feb 28 13:16:22 UTC 2012 - jreidin...@suse.com + +- fix iteration over pool in ruby (bnc#746439) +- add ability to use PackageProvider via bindings +- predefine class for ZyppException in ruby so it can be used after + require of zypp +- version 0.5.11 + +------------------------------------------------------------------- Tue Oct 18 16:54:42 CEST 2011 - m...@suse.de - Add arch armv7hl, armv7nhl, armv7thl, armv7tnhl diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-bindings-0.5.10/swig/Callbacks.i new/libzypp-bindings-0.5.11/swig/Callbacks.i --- old/libzypp-bindings-0.5.10/swig/Callbacks.i 2011-10-18 18:35:54.000000000 +0200 +++ new/libzypp-bindings-0.5.11/swig/Callbacks.i 2012-03-02 11:41:30.000000000 +0100 @@ -34,6 +34,8 @@ if (value == Qnil) value = ID2SYM(rb_intern("abort")); return value; +#else + return Target_String("abort"); #endif return 0; // fallback } @@ -45,6 +47,8 @@ if (value == Qnil) value = ID2SYM(rb_intern("retry")); return value; +#else + return Target_String("retry"); #endif return 0; // fallback } @@ -56,6 +60,8 @@ if (value == Qnil) value = ID2SYM(rb_intern("ignore")); return value; +#else + return Target_String("ignore"); #endif return 0; // fallback } @@ -73,8 +79,7 @@ if (value == Qnil) value = ID2SYM(rb_intern("no_error")); return value; -#endif -#if defined(SWIGPYTHON) +#else return Target_String("no_error"); #endif return 0; // fallback @@ -87,8 +92,7 @@ if (value == Qnil) value = ID2SYM(rb_intern("not_found")); return value; -#endif -#if defined(SWIGPYTHON) +#else return Target_String("not_found"); #endif return 0; // fallback @@ -101,8 +105,7 @@ if (value == Qnil) value = ID2SYM(rb_intern("io")); return value; -#endif -#if defined(SWIGPYTHON) +#else return Target_String("io"); #endif return 0; // fallback @@ -115,8 +118,7 @@ if (value == Qnil) value = ID2SYM(rb_intern("invalid")); return value; -#endif -#if defined(SWIGPYTHON) +#else return Target_String("invalid"); #endif return 0; // fallback diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-bindings-0.5.10/swig/PackageProvider.i new/libzypp-bindings-0.5.11/swig/PackageProvider.i --- old/libzypp-bindings-0.5.10/swig/PackageProvider.i 1970-01-01 01:00:00.000000000 +0100 +++ new/libzypp-bindings-0.5.11/swig/PackageProvider.i 2012-03-02 11:41:30.000000000 +0100 @@ -0,0 +1,26 @@ +%inline +{ + namespace zypp + { + class WrappedManagedFile + { + public: + WrappedManagedFile(ManagedFile managed_file){ mf = managed_file; } + const std::string & asString(){ return mf->asString();} + private: + ManagedFile mf; + }; + } +} +%include "zypp/repo/PackageProvider.h" +%extend zypp::repo::PackageProvider { + static zypp::WrappedManagedFile* 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); + zypp::ManagedFile mf = pp.providePackage(); + zypp::WrappedManagedFile* res = new zypp::WrappedManagedFile(mf); + return res; + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-bindings-0.5.10/swig/ResPool.i new/libzypp-bindings-0.5.11/swig/ResPool.i --- old/libzypp-bindings-0.5.10/swig/ResPool.i 2011-10-18 18:35:54.000000000 +0200 +++ new/libzypp-bindings-0.5.11/swig/ResPool.i 2012-03-02 11:41:30.000000000 +0100 @@ -25,25 +25,25 @@ #ifdef SWIGRUBY -iter3(ResPool, PoolItem*); +iter3(ResPool, zypp::PoolItem*); // %extend ResPool { // void each() // { // ResPool::const_iterator i = self->begin(); // while ( i != self->end() ) { -// rb_yield( SWIG_NewPointerObj( (void *) &*i, SWIGTYPE_p_PoolItem, 0)); +// rb_yield( SWIG_NewPointerObj( (void *) &*i, SWIGTYPE_p_zypp__PoolItem, 0)); // ++i; // } // } // } %extend ResPool { - void each_by_kind( const ResObject::Kind & kind_r ) + void each_by_kind( const ResKind & kind_r ) { ResPool::byKind_iterator i = self->byKindBegin( kind_r ); while ( i != self->byKindEnd( kind_r ) ) { - rb_yield( SWIG_NewPointerObj( (void *) &*i, SWIGTYPE_p_PoolItem, 0)); + rb_yield( SWIG_NewPointerObj( (void *) &*i, SWIGTYPE_p_zypp__PoolItem, 0)); ++i; } } @@ -54,7 +54,7 @@ { ResPool::byName_iterator i = self->byNameBegin( name ); while ( i != self->byNameEnd( name ) ) { - rb_yield( SWIG_NewPointerObj( (void *) &*i, $descriptor(PoolItem), 0)); + rb_yield( SWIG_NewPointerObj( (void *) &*i, SWIGTYPE_p_zypp__PoolItem, 0)); ++i; } } @@ -65,17 +65,29 @@ #ifdef SWIGPYTHON %newobject ResPool::const_iterator(PyObject **PYTHON_SELF); %extend ResPool { +#if SWIG_VERSION > 0x010336 swig::SwigPyIterator* iterator(PyObject **PYTHON_SELF) +#else + swig::PySwigIterator* iterator(PyObject **PYTHON_SELF) +#endif { return swig::make_output_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); } +#if SWIG_VERSION > 0x010336 swig::SwigPyIterator* kinditerator(PyObject **PYTHON_SELF, const ResObject::Kind & kind_r) +#else + swig::PySwigIterator* kinditerator(PyObject **PYTHON_SELF, const ResObject::Kind & kind_r) +#endif { return swig::make_output_iterator(self->byKindBegin( kind_r ), self->byKindBegin( kind_r ), self->byKindEnd( kind_r ), *PYTHON_SELF); } +#if SWIG_VERSION > 0x010336 swig::SwigPyIterator* nameiterator(PyObject **PYTHON_SELF, const std::string &name) +#else + swig::PySwigIterator* nameiterator(PyObject **PYTHON_SELF, const std::string &name) +#endif { return swig::make_output_iterator(self->byNameBegin( name ), self->byNameBegin( name ), self->byNameEnd( name ), *PYTHON_SELF); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-bindings-0.5.10/swig/Target.i new/libzypp-bindings-0.5.11/swig/Target.i --- old/libzypp-bindings-0.5.10/swig/Target.i 2011-10-18 18:35:54.000000000 +0200 +++ new/libzypp-bindings-0.5.11/swig/Target.i 2012-03-02 11:41:30.000000000 +0100 @@ -1,18 +1,15 @@ %ignore zypp::Target::reset; -#if ZYPP_VERSION > 631 namespace zypp { // Redefine nested class in global scope for SWIG struct DistributionLabel {}; } -#endif %include <zypp/Target.h> namespace zypp { typedef intrusive_ptr<Target> Target_Ptr; %template(Target_Ptr) intrusive_ptr<Target>; } -#if ZYPP_VERSION > 631 %{ namespace zypp { @@ -20,4 +17,3 @@ typedef Target::DistributionLabel DistributionLabel; } %} -#endif \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-bindings-0.5.10/swig/python/tests/callbacks.py new/libzypp-bindings-0.5.11/swig/python/tests/callbacks.py --- old/libzypp-bindings-0.5.10/swig/python/tests/callbacks.py 1970-01-01 01:00:00.000000000 +0100 +++ new/libzypp-bindings-0.5.11/swig/python/tests/callbacks.py 2012-03-02 11:41:30.000000000 +0100 @@ -0,0 +1,54 @@ +import os +cwd = os.path.abspath(os.path.dirname(__file__)) + +import sys +sys.path.insert(0, cwd + "/../../../build/swig/python") +import zypp + +class CommitReceiver: + def removal_start(self, resolvable): + print "Starting to remove ", resolvable.name() + + def removal_progress(self, resolvable, percentage): + print "Remove of ", resolvable.name(), " at ", percentage, "%" + return True + + def removal_finish(self, resolvable, error, reason): + print "Remove of ", resolvable.name(), " finished with problem ", error, ": ", reason + + def removal_problem(self, resolvable, error, description): + print "Remove of ", resolvable.name(), " has problem ", error, ": ", description + return "ignore" + +Z = zypp.ZYppFactory_instance().getZYpp() +Z.initializeTarget( zypp.Pathname("/") ) +Z.target().load(); + +commit_callbacks = zypp.CommitCallbacks() +commit_receiver = CommitReceiver() +commit_callbacks.connect(commit_receiver) + +for item in Z.pool(): + if item.resolvable().name() == "gedit": + print "Emitting removal of ", item.resolvable().name() + item.status().setToBeUninstalled(zypp.ResStatus.USER) + resolvable = item.resolvable() + if not Z.resolver().resolvePool(): + print "Problem count: %d" % Z.resolver().problems().size() + policy = zypp.ZYppCommitPolicy() + policy.downloadMode(zypp.DownloadInAdvance) + policy.dryRun( False ) + policy.syncPoolAfterCommit( False ) + print "Committing" + try: + result = Z.commit( policy ) + print "Done:", result + except: + print "Oops" + break + +# raise + +print "disconnecting" +commit_callbacks.disconnect() +print "disconnected" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-bindings-0.5.10/swig/python/tests/repoinfo.py new/libzypp-bindings-0.5.11/swig/python/tests/repoinfo.py --- old/libzypp-bindings-0.5.10/swig/python/tests/repoinfo.py 2011-10-18 18:35:54.000000000 +0200 +++ new/libzypp-bindings-0.5.11/swig/python/tests/repoinfo.py 2012-03-02 11:41:30.000000000 +0100 @@ -56,7 +56,7 @@ def testDump(self): out = self.info.dump() - assert len(out) == 396, 'Invalid output length %d' % len(out) + assert len(out) > 300, 'Invalid output length %d' % len(out) def testDumpIni(self): out = self.info.dumpAsIni() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-bindings-0.5.10/swig/ruby/ruby.i new/libzypp-bindings-0.5.11/swig/ruby/ruby.i --- old/libzypp-bindings-0.5.10/swig/ruby/ruby.i 2011-10-18 18:35:54.000000000 +0200 +++ new/libzypp-bindings-0.5.11/swig/ruby/ruby.i 2012-03-02 11:41:30.000000000 +0100 @@ -111,13 +111,16 @@ } \ } +%wrapper { + static VALUE zyppexception = rb_define_class("ZYppException", rb_eStandardError); +} + %exception { try { $action } catch (const Exception& e) { - static VALUE zyppexception = rb_define_class("ZYppException", rb_eStandardError); std::string tmp = e.historyAsString() + e.asUserString(); rb_raise(zyppexception, tmp.c_str()); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-bindings-0.5.10/swig/ruby/tests/target.rb new/libzypp-bindings-0.5.11/swig/ruby/tests/target.rb --- old/libzypp-bindings-0.5.10/swig/ruby/tests/target.rb 2011-10-18 18:35:54.000000000 +0200 +++ new/libzypp-bindings-0.5.11/swig/ruby/tests/target.rb 2012-03-02 11:41:30.000000000 +0100 @@ -33,10 +33,30 @@ p.each do | pi | i = i + 1 break if i > 10 - puts pi # PoolItems have status and a resolvable -# r = pi.resolvable -# puts "#{r.name}-#{r.edition}" + r = pi.resolvable + assert pi.is_a? PoolItem + end + #try iterate with kind + i = 0 + p.each_by_kind(ResKind.package) do |pi| + + i = i + 1 + break if i > 10 + assert pi.is_a? PoolItem + r = pi.resolvable + assert isKindPackage(pi) + end + + i = 0 + puts "search for libzypp ..." + p.each_by_name("libzypp") do |pi| + i = i + 1 + break if i > 10 + assert pi.is_a? PoolItem + r = pi.resolvable + # broken in current SWIG assert_equal "libzypp",r.name + #try to download it end assert true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-bindings-0.5.10/swig/zypp.i new/libzypp-bindings-0.5.11/swig/zypp.i --- old/libzypp-bindings-0.5.10/swig/zypp.i 2011-10-18 18:35:54.000000000 +0200 +++ new/libzypp-bindings-0.5.11/swig/zypp.i 2012-03-02 11:41:30.000000000 +0100 @@ -127,6 +127,7 @@ #include "zypp/ServiceInfo.h" #include "zypp/RepoManager.h" #include "zypp/repo/RepoType.h" +#include "zypp/repo/PackageProvider.h" #include "zypp/TmpPath.h" #include "zypp/Resolver.h" #include "zypp/pool/GetResolvablesToInsDel.h" @@ -230,6 +231,7 @@ %include "ResStatus.i" %include "ResObject.i" %include "Package.i" +%include "PackageProvider.i" %include "Patch.i" %include "Pattern.i" %include "Product.i" @@ -249,6 +251,10 @@ %include "Resolver.i" %include "ZConfig.i" +//just simple files, where we need default ctor +%include <zypp/repo/RepoProvideFile.h> +%include <zypp/repo/DeltaCandidates.h> + %ignore zypp::ZYpp::setTextLocale; %ignore zypp::ZYpp::getTextLocale; %ignore zypp::ZYpp::setRequestedLocales; -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org