Author: aschnell Date: Tue Aug 28 23:57:03 2007 New Revision: 6951 URL: http://svn.opensuse.org/viewcvs/zypp?rev=6951&view=rev Log: - use Pathname class as defined in ZYpp Modified: trunk/libzypp-bindings/examples/python/list_target_resolvables.py trunk/libzypp-bindings/examples/ruby/exception.rb trunk/libzypp-bindings/examples/ruby/keyring.rb trunk/libzypp-bindings/examples/ruby/list_target_resolvables.rb trunk/libzypp-bindings/examples/ruby/mediasetaccess_example.rb trunk/libzypp-bindings/examples/ruby/parse1.rb trunk/libzypp-bindings/examples/ruby/parse2.rb trunk/libzypp-bindings/examples/ruby/play_with_pool_and_target.rb trunk/libzypp-bindings/examples/ruby/play_with_repos.rb trunk/libzypp-bindings/examples/ruby/test.rb trunk/libzypp-bindings/examples/ruby/test2.rb trunk/libzypp-bindings/package/libzypp-bindings.changes trunk/libzypp-bindings/swig/Pathname.i trunk/libzypp-bindings/swig/zypp.i Modified: trunk/libzypp-bindings/examples/python/list_target_resolvables.py URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/examples/python/... ============================================================================== --- trunk/libzypp-bindings/examples/python/list_target_resolvables.py (original) +++ trunk/libzypp-bindings/examples/python/list_target_resolvables.py Tue Aug 28 23:57:03 2007 @@ -1,10 +1,11 @@ +#!/usr/bin/python -from zypp import ZYppFactory, Dep +from zypp import ZYppFactory, Pathname, Dep z = ZYppFactory.instance().getZYpp() print z -z.initializeTarget("/") +z.initializeTarget(Pathname("/")) r = z.target().resolvables() print r Modified: trunk/libzypp-bindings/examples/ruby/exception.rb URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/examples/ruby/ex... ============================================================================== --- trunk/libzypp-bindings/examples/ruby/exception.rb (original) +++ trunk/libzypp-bindings/examples/ruby/exception.rb Tue Aug 28 23:57:03 2007 @@ -1,3 +1,4 @@ +#!/usr/bin/ruby require 'zypp' include Zypp Modified: trunk/libzypp-bindings/examples/ruby/keyring.rb URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/examples/ruby/ke... ============================================================================== --- trunk/libzypp-bindings/examples/ruby/keyring.rb (original) +++ trunk/libzypp-bindings/examples/ruby/keyring.rb Tue Aug 28 23:57:03 2007 @@ -1,3 +1,4 @@ +#!/usr/bin/ruby require 'zypp' include Zypp @@ -5,9 +6,11 @@ keyring = ZYppFactory::instance.get_zypp.key_ring -# FIXME path = Pathname.new("/suse/aschnell/tmp/repodata/repomd.xml.key") +puts path + publickey = PublicKey.new(path) +puts publickey id = publickey.id() Modified: trunk/libzypp-bindings/examples/ruby/list_target_resolvables.rb URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/examples/ruby/li... ============================================================================== --- trunk/libzypp-bindings/examples/ruby/list_target_resolvables.rb (original) +++ trunk/libzypp-bindings/examples/ruby/list_target_resolvables.rb Tue Aug 28 23:57:03 2007 @@ -1,3 +1,4 @@ +#!/usr/bin/ruby require 'zypp' include Zypp @@ -5,7 +6,7 @@ z = ZYppFactory::instance.get_zypp # puts z.class -t = z.initialize_target("/") +t = z.initialize_target(Pathname.new("/")) # puts t.class r = z.target.resolvables Modified: trunk/libzypp-bindings/examples/ruby/mediasetaccess_example.rb URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/examples/ruby/me... ============================================================================== --- trunk/libzypp-bindings/examples/ruby/mediasetaccess_example.rb (original) +++ trunk/libzypp-bindings/examples/ruby/mediasetaccess_example.rb Tue Aug 28 23:57:03 2007 @@ -1,3 +1,4 @@ +#!/usr/bin/ruby require 'zypp' include Zypp Modified: trunk/libzypp-bindings/examples/ruby/parse1.rb URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/examples/ruby/pa... ============================================================================== --- trunk/libzypp-bindings/examples/ruby/parse1.rb (original) +++ trunk/libzypp-bindings/examples/ruby/parse1.rb Tue Aug 28 23:57:03 2007 @@ -1,3 +1,4 @@ +#!/usr/bin/ruby require 'zypp' include Zypp @@ -21,7 +22,7 @@ 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_info.add_base_url("file:///suse/aschnell/tmp") repo_manager.add_repository(repo_info) Modified: trunk/libzypp-bindings/examples/ruby/parse2.rb URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/examples/ruby/pa... ============================================================================== --- trunk/libzypp-bindings/examples/ruby/parse2.rb (original) +++ trunk/libzypp-bindings/examples/ruby/parse2.rb Tue Aug 28 23:57:03 2007 @@ -1,3 +1,4 @@ +#!/usr/bin/ruby require 'zypp' include Zypp @@ -21,7 +22,7 @@ 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_info.add_base_url("file:///suse/aschnell/tmp") repo_manager.add_repository(repo_info) Modified: trunk/libzypp-bindings/examples/ruby/play_with_pool_and_target.rb URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/examples/ruby/pl... ============================================================================== --- trunk/libzypp-bindings/examples/ruby/play_with_pool_and_target.rb (original) +++ trunk/libzypp-bindings/examples/ruby/play_with_pool_and_target.rb Tue Aug 28 23:57:03 2007 @@ -1,3 +1,4 @@ +#!/usr/bin/ruby require 'zypp' include Zypp Modified: trunk/libzypp-bindings/examples/ruby/play_with_repos.rb URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/examples/ruby/pl... ============================================================================== --- trunk/libzypp-bindings/examples/ruby/play_with_repos.rb (original) +++ trunk/libzypp-bindings/examples/ruby/play_with_repos.rb Tue Aug 28 23:57:03 2007 @@ -1,3 +1,4 @@ +#!/usr/bin/ruby require 'zypp' include Zypp Modified: trunk/libzypp-bindings/examples/ruby/test.rb URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/examples/ruby/te... ============================================================================== --- trunk/libzypp-bindings/examples/ruby/test.rb (original) +++ trunk/libzypp-bindings/examples/ruby/test.rb Tue Aug 28 23:57:03 2007 @@ -1,3 +1,4 @@ +#!/usr/bin/ruby require 'zypp' include Zypp Modified: trunk/libzypp-bindings/examples/ruby/test2.rb URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/examples/ruby/te... ============================================================================== --- trunk/libzypp-bindings/examples/ruby/test2.rb (original) +++ trunk/libzypp-bindings/examples/ruby/test2.rb Tue Aug 28 23:57:03 2007 @@ -1,3 +1,4 @@ +#!/usr/bin/ruby require 'zypp' require 'pathname' Modified: trunk/libzypp-bindings/package/libzypp-bindings.changes URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/package/libzypp-... ============================================================================== --- trunk/libzypp-bindings/package/libzypp-bindings.changes (original) +++ trunk/libzypp-bindings/package/libzypp-bindings.changes Tue Aug 28 23:57:03 2007 @@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Tue Aug 28 23:57:36 CEST 2007 - aschnell@suse.de + +- added KeyRing and PublicKey classes + +------------------------------------------------------------------- Thu Aug 23 17:10:56 CEST 2007 - aschnell@suse.de - added to_a functions Modified: trunk/libzypp-bindings/swig/Pathname.i URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Pathname.i?... ============================================================================== --- trunk/libzypp-bindings/swig/Pathname.i (original) +++ trunk/libzypp-bindings/swig/Pathname.i Tue Aug 28 23:57:03 2007 @@ -1,38 +1,46 @@ +#ifdef SWIGRUBY +%alias Pathname::c_str "to_s"; +#endif + class Pathname { public: Pathname(); - Pathname(const std::string&); - Pathname(const char*); -}; - + const char* c_str() const; -#ifdef SWIGRUBY + bool empty() const; + bool absolute() const; + bool relative() const; -// Something like 'opts.repoCachePath = tmp_cache_path.path()' causes out and -// in transformation. Can that be avoided? +}; -%typemap(in) const Pathname&, Pathname* { - VALUE pathstring = rb_funcall( $input, rb_intern("to_s"), 0, 0); - Pathname *p = new Pathname( (RSTRING(pathstring)->ptr) ); - $1 = p; -} - -%typemap(freearg) const Pathname&, Pathname* { - delete $1; -} - -%typemap(out) Pathname { - rb_require("pathname"); - VALUE klass = rb_const_get( rb_cObject, rb_intern("Pathname")); - VALUE rbpathstr = rb_str_new2($1.asString().c_str()); - $result = rb_funcall( klass, rb_intern("new"), 1, rbpathstr); -} -#endif +// #ifdef SWIGRUBY +// +// // Something like 'opts.repoCachePath = tmp_cache_path.path()' causes out and +// // in transformation. Can that be avoided? +// +// %typemap(in) const Pathname&, Pathname* { +// VALUE pathstring = rb_funcall( $input, rb_intern("to_s"), 0, 0); +// Pathname *p = new Pathname( (RSTRING(pathstring)->ptr) ); +// $1 = p; +// } +// +// %typemap(freearg) const Pathname&, Pathname* { +// delete $1; +// } +// +// %typemap(out) Pathname { +// rb_require("pathname"); +// VALUE klass = rb_const_get( rb_cObject, rb_intern("Pathname")); +// VALUE rbpathstr = rb_str_new2($1.asString().c_str()); +// $result = rb_funcall( klass, rb_intern("new"), 1, rbpathstr); +// } +// +// #endif Modified: trunk/libzypp-bindings/swig/zypp.i URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/zypp.i?rev=... ============================================================================== --- trunk/libzypp-bindings/swig/zypp.i (original) +++ trunk/libzypp-bindings/swig/zypp.i Tue Aug 28 23:57:03 2007 @@ -127,11 +127,7 @@ void setPartitions(const DiskUsageCounter::MountPointSet &mp); */ Target_Ptr target() const; -#ifdef SWIGRUBY void initializeTarget(const Pathname & root); -#else - void initializeTarget(const std::string & root); -#endif void finishTarget(); typedef ZYppCommitResult CommitResult; -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org