Mailinglist Archive: opensuse-commit (2092 mails)

< Previous Next >
commit libzypp-bindings
  • From: root@xxxxxxxxxxxxxxx (h_root)
  • Date: Fri, 17 Aug 2007 18:56:57 +0200
  • Message-id: <20070817165657.A617867832C@xxxxxxxxxxxxxxx>

Hello community,

here is the log from the commit of package libzypp-bindings
checked in at Fri Aug 17 18:56:57 CEST 2007.

--------
--- libzypp-bindings/libzypp-bindings.changes   2007-07-31 18:06:55.000000000 +0200
+++ /mounts/work_src_done/STABLE/libzypp-bindings/libzypp-bindings.changes      2007-08-17 14:48:40.425066000 +0200
@@ -1,0 +2,10 @@
+Fri Aug 17 14:37:06 CEST 2007 - aschnell@xxxxxxx
+
+- moved ruby files to vendor_ruby (bug #301127)
+
+-------------------------------------------------------------------
+Mon Aug 13 20:46:35 CEST 2007 - aschnell@xxxxxxx
+
+- added exceptions
+
+-------------------------------------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libzypp-bindings.spec ++++++
--- /var/tmp/diff_new_pack.T15804/_old  2007-08-17 18:56:53.000000000 +0200
+++ /var/tmp/diff_new_pack.T15804/_new  2007-08-17 18:56:53.000000000 +0200
@@ -11,7 +11,7 @@
 
 Name:           libzypp-bindings
 Version:        0.4.1
-Release:        1
+Release:        2
 License:        GPL v2 or later
 Summary:        Bindings for libzypp
 Group:          Development/Sources
@@ -72,13 +72,13 @@
 
 %files -n ruby-zypp
 %defattr(-,root,root,-)
-%{_libdir}/ruby/%{rb_ver}/%{rb_arch}/rzypp.so
+%{_libdir}/ruby/vendor_ruby/%{rb_ver}/%{rb_arch}/rzypp.so
 %package -n python-zypp
-Summary:        Python bindings for libzypp
+Summary:        Python Bindings for libzypp
 Group:          Development/Languages/Python
 
 %description -n python-zypp
-This package provides python bindings for libzypp, the library for
+This package provides Python bindings for libzypp, the library for
 package management.
 
 
@@ -96,6 +96,10 @@
 %{_libdir}/python2.5/site-packages/zypp.py
 
 %changelog
+* Fri Aug 17 2007 - aschnell@xxxxxxx
+- moved ruby files to vendor_ruby (bug #301127)
+* Mon Aug 13 2007 - aschnell@xxxxxxx
+- added exceptions
 * Tue Jul 31 2007 - aschnell@xxxxxxx
 - improved bindings for various classes
 - adoptions to libzypp changes

++++++ libzypp-bindings-0.4.1.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.1/examples/ruby/exception.rb new/libzypp-bindings-0.4.1/examples/ruby/exception.rb
--- old/libzypp-bindings-0.4.1/examples/ruby/exception.rb       1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-bindings-0.4.1/examples/ruby/exception.rb       2007-08-17 14:51:33.000000000 +0200
@@ -0,0 +1,34 @@
+
+require 'rzypp'
+include Rzypp
+
+tmp_cache_path = TmpDir.new()
+tmp_raw_cache_path = TmpDir.new()
+tmp_known_repos_path = TmpDir.new()
+
+opts = RepoManagerOptions.new()
+opts.repoCachePath = tmp_cache_path.path()
+opts.repoRawCachePath = tmp_raw_cache_path.path()
+opts.knownReposPath = tmp_known_repos_path.path()
+
+repo_manager = RepoManager.new(opts)
+
+repo_info = RepoInfo.new()
+
+repo_info.set_alias("factorytest")
+repo_info.set_name("Test Repo for Factory.")
+repo_info.set_enabled(true)
+repo_info.set_autorefresh(false)
+repo_info.add_base_url("file:///tmp/does-not-exist")
+
+begin
+  repo_manager.add_repository(repo_info)
+  repo_manager.refresh_metadata(repo_info)
+  repo_manager.build_cache(repo_info)
+rescue ZYppException => e
+  puts "ZYppException caught"
+  puts e.to_s
+else
+  puts "Oh, no exception"
+end
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.1/examples/ruby/parse1.rb new/libzypp-bindings-0.4.1/examples/ruby/parse1.rb
--- old/libzypp-bindings-0.4.1/examples/ruby/parse1.rb  2007-07-31 21:10:25.000000000 +0200
+++ new/libzypp-bindings-0.4.1/examples/ruby/parse1.rb  2007-08-17 14:51:33.000000000 +0200
@@ -19,9 +19,9 @@
 repo_info.set_name("Test Repo for Factory.")
 repo_info.set_enabled(true)
 repo_info.set_autorefresh(false)
-repo_info.add_base_url("ftp://dist.suse.de/install/stable-x86/";)
+# repo_info.add_base_url("ftp://dist.suse.de/install/stable-x86/";)
 # repo_info.add_base_url("http://software.opensuse.org/download/home:/Arvin42/openSUSE_Factory/";)
-# repo_info.add_base_url("file:///ARVIN/zypp/trunk/repotools/")
+repo_info.add_base_url("file:///ARVIN/zypp/trunk/repotools/tmp")
 
 repo_manager.add_repository(repo_info)
 
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.1/examples/ruby/parse2.rb new/libzypp-bindings-0.4.1/examples/ruby/parse2.rb
--- old/libzypp-bindings-0.4.1/examples/ruby/parse2.rb  1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-bindings-0.4.1/examples/ruby/parse2.rb  2007-08-17 14:51:33.000000000 +0200
@@ -0,0 +1,63 @@
+
+require 'rzypp'
+include Rzypp
+
+tmp_cache_path = TmpDir.new()
+tmp_raw_cache_path = TmpDir.new()
+tmp_known_repos_path = TmpDir.new()
+
+opts = RepoManagerOptions.new()
+opts.repoCachePath = tmp_cache_path.path()
+opts.repoRawCachePath = tmp_raw_cache_path.path()
+opts.knownReposPath = tmp_known_repos_path.path()
+
+repo_manager = RepoManager.new(opts)
+
+repo_info = RepoInfo.new()
+
+repo_info.set_alias("factorytest")
+repo_info.set_name("Test Repo for Factory.")
+repo_info.set_enabled(true)
+repo_info.set_autorefresh(false)
+# repo_info.add_base_url("ftp://dist.suse.de/install/stable-x86/";)
+# repo_info.add_base_url("http://software.opensuse.org/download/home:/Arvin42/openSUSE_Factory/";)
+repo_info.add_base_url("file:///ARVIN/zypp/trunk/repotools/tmp/")
+
+repo_manager.add_repository(repo_info)
+
+res_pool_manager = ResPoolManager.new()
+
+repos = repo_manager.known_repositories()
+repos.each do | repo |
+    repo_manager.refresh_metadata(repo)
+    repo_manager.build_cache(repo)
+    rep = repo_manager.create_from_cache(repo)
+    store = rep.resolvables()
+    res_pool_manager.insert(store)
+end
+
+pool = res_pool_manager.accessor()
+# puts pool.class
+
+pool.each do | p |
+
+    # puts p.class
+    r = p.resolvable
+    # puts r.class
+    puts "#{r.kind_to_s} #{r.name} #{r.edition.to_s} #{r.arch.to_s}"
+    puts "  Summary: #{r.summary}"
+    puts "  Size: #{r.size}"
+    puts "  Vendor: #{r.vendor}"
+    puts "  Buildtime: #{r.buildtime}"
+
+    d = r.dep(Dep.PROVIDES)
+    # puts d.class
+    d.each do | x |
+       # puts y.class
+       puts "  Provides: #{x.to_s}"
+    end
+
+    puts
+
+end
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.1/libzypp-bindings.spec.cmake new/libzypp-bindings-0.4.1/libzypp-bindings.spec.cmake
--- old/libzypp-bindings-0.4.1/libzypp-bindings.spec.cmake      2007-07-31 21:10:25.000000000 +0200
+++ new/libzypp-bindings-0.4.1/libzypp-bindings.spec.cmake      2007-08-17 14:51:33.000000000 +0200
@@ -53,7 +53,7 @@
 
 %files -n ruby-zypp
 %defattr(-,root,root,-)
-%{_libdir}/ruby/%{rb_ver}/%{rb_arch}/rzypp.so
+%{_libdir}/ruby/vendor_ruby/%{rb_ver}/%{rb_arch}/rzypp.so
 
 %package -n python-zypp
 Summary:        Python bindings for libzypp
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.1/swig/ResPoolManager.i new/libzypp-bindings-0.4.1/swig/ResPoolManager.i
--- old/libzypp-bindings-0.4.1/swig/ResPoolManager.i    1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-bindings-0.4.1/swig/ResPoolManager.i    2007-08-17 14:51:33.000000000 +0200
@@ -0,0 +1,35 @@
+
+class ResPoolManager
+{
+
+public:
+    typedef pool::PoolTraits::Item           Item;
+    typedef pool::PoolTraits::size_type      size_type;
+    typedef pool::PoolTraits::iterator       iterator;
+    typedef pool::PoolTraits::const_iterator const_iterator;
+
+public:
+
+    ResPoolManager();
+
+    ~ResPoolManager();
+
+    ResPool accessor() const;
+
+    ResPoolProxy proxy() const;
+
+public:
+
+    void insert(const ResStore& store, bool installed = false);
+
+    void clear();
+
+private:
+
+    typedef pool::PoolTraits::ItemContainerT  ContainerT;
+    typedef pool::PoolTraits::Impl        Impl;
+    typedef pool::PoolTraits::Inserter    Inserter;
+    typedef pool::PoolTraits::Deleter     Deleter;
+
+};
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.1/swig/ruby/CMakeLists.txt new/libzypp-bindings-0.4.1/swig/ruby/CMakeLists.txt
--- old/libzypp-bindings-0.4.1/swig/ruby/CMakeLists.txt 2007-07-31 21:10:25.000000000 +0200
+++ new/libzypp-bindings-0.4.1/swig/ruby/CMakeLists.txt 2007-08-17 14:51:33.000000000 +0200
@@ -2,7 +2,10 @@
 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing")
 
 FIND_PACKAGE(Ruby REQUIRED)
-MESSAGE( STATUS "Ruby arch dir: ${RUBY_ARCH_DIR}" )
+EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "puts Config::CONFIG['vendorarchdir']"
+   OUTPUT_VARIABLE RUBY_VENDOR_ARCH_DIR)
+STRING(REPLACE "\n" "" RUBY_VENDOR_ARCH_DIR "${RUBY_VENDOR_ARCH_DIR}")
+MESSAGE( STATUS "Ruby vendor arch dir: ${RUBY_VENDOR_ARCH_DIR}" )
 MESSAGE( STATUS "Ruby include path: ${RUBY_INCLUDE_PATH}" )
 
 SET( SWIG_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/zypp_wrap.cxx" )
@@ -30,5 +33,5 @@
 TARGET_LINK_LIBRARIES( rzypp ${ZYPP_LIBRARY} )
 TARGET_LINK_LIBRARIES( rzypp ${RUBY_LIBRARY} )
 
-INSTALL(TARGETS rzypp LIBRARY DESTINATION ${RUBY_ARCH_DIR} )
+INSTALL(TARGETS rzypp LIBRARY DESTINATION ${RUBY_VENDOR_ARCH_DIR} )
 
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.1/swig/ruby/ruby.i new/libzypp-bindings-0.4.1/swig/ruby/ruby.i
--- old/libzypp-bindings-0.4.1/swig/ruby/ruby.i 2007-07-31 21:10:25.000000000 +0200
+++ new/libzypp-bindings-0.4.1/swig/ruby/ruby.i 2007-08-17 14:51:33.000000000 +0200
@@ -46,3 +46,14 @@
     } \
 }
 
+
+%exception {
+  try {
+    $action
+  }
+  catch (const Exception& e) {
+    static VALUE zyppexception = rb_define_class("ZYppException", rb_eStandardError);
+    rb_raise(zyppexception, e.asString().c_str());
+  }
+}
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.1/swig/zypp.i new/libzypp-bindings-0.4.1/swig/zypp.i
--- old/libzypp-bindings-0.4.1/swig/zypp.i      2007-07-31 21:10:25.000000000 +0200
+++ new/libzypp-bindings-0.4.1/swig/zypp.i      2007-08-17 14:51:33.000000000 +0200
@@ -16,6 +16,7 @@
 #include <zypp/Pathname.h>
 #include "zypp/base/ReferenceCounted.h"
 #include "zypp/ResObject.h"
+#include "zypp/ResPoolManager.h"
 #include "zypp/Target.h"
 #include "zypp/target/TargetImpl.h"
 #include "zypp/TranslatedText.h"
@@ -102,6 +103,7 @@
 %include "ResStatus.i"
 %include "PoolItem.i"
 %include "ResPool.i"
+%include "ResPoolManager.i"
 %include "ZYppCommitPolicy.i"
 %include "ZYppCommitResult.i"
 %include "MediaSetAccess.i"


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Remember to have fun...

---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-commit+help@xxxxxxxxxxxx

< Previous Next >