Mailinglist Archive: opensuse-commit (2092 mails)

< Previous Next >
commit libzypp-bindings
  • From: root@xxxxxxxxxxxxxxx (h_root)
  • Date: Wed, 29 Aug 2007 22:37:18 +0200
  • Message-id: <20070829203718.E78A96781B8@xxxxxxxxxxxxxxx>

Hello community,

here is the log from the commit of package libzypp-bindings
checked in at Wed Aug 29 22:37:18 CEST 2007.

--------
--- libzypp-bindings/libzypp-bindings.changes   2007-08-23 17:19:54.000000000 +0200
+++ /mounts/work_src_done/STABLE/libzypp-bindings/libzypp-bindings.changes      2007-08-29 00:01:22.207339000 +0200
@@ -1,0 +2,5 @@
+Tue Aug 28 23:57:36 CEST 2007 - aschnell@xxxxxxx
+
+- added KeyRing and PublicKey classes
+
+-------------------------------------------------------------------

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

Other differences:
------------------
++++++ libzypp-bindings.spec ++++++
--- /var/tmp/diff_new_pack.L26831/_old  2007-08-29 22:36:49.000000000 +0200
+++ /var/tmp/diff_new_pack.L26831/_new  2007-08-29 22:36:49.000000000 +0200
@@ -11,7 +11,7 @@
 
 Name:           libzypp-bindings
 Version:        0.4.2
-Release:        1
+Release:        2
 License:        GPL v2 or later
 Summary:        Bindings for libzypp
 Group:          Development/Sources
@@ -96,6 +96,8 @@
 %{_libdir}/python2.5/site-packages/zypp.py
 
 %changelog
+* Tue Aug 28 2007 - aschnell@xxxxxxx
+- added KeyRing and PublicKey classes
 * Thu Aug 23 2007 - aschnell@xxxxxxx
 - added to_a functions
 * Thu Aug 23 2007 - aschnell@xxxxxxx

++++++ libzypp-bindings-0.4.2.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/examples/python/list_target_resolvables.py new/libzypp-bindings-0.4.2/examples/python/list_target_resolvables.py
--- old/libzypp-bindings-0.4.2/examples/python/list_target_resolvables.py       2007-08-23 17:11:54.000000000 +0200
+++ new/libzypp-bindings-0.4.2/examples/python/list_target_resolvables.py       2007-08-29 00:01:05.000000000 +0200
@@ -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
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/examples/ruby/exception.rb new/libzypp-bindings-0.4.2/examples/ruby/exception.rb
--- old/libzypp-bindings-0.4.2/examples/ruby/exception.rb       2007-08-23 17:11:54.000000000 +0200
+++ new/libzypp-bindings-0.4.2/examples/ruby/exception.rb       2007-08-29 00:01:05.000000000 +0200
@@ -1,3 +1,4 @@
+#!/usr/bin/ruby
 
 require 'zypp'
 include Zypp
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/examples/ruby/keyring.rb new/libzypp-bindings-0.4.2/examples/ruby/keyring.rb
--- old/libzypp-bindings-0.4.2/examples/ruby/keyring.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-bindings-0.4.2/examples/ruby/keyring.rb 2007-08-29 00:01:05.000000000 +0200
@@ -0,0 +1,24 @@
+#!/usr/bin/ruby
+
+require 'zypp'
+include Zypp
+
+
+keyring = ZYppFactory::instance.get_zypp.key_ring
+
+path = Pathname.new("/suse/aschnell/tmp/repodata/repomd.xml.key")
+puts path
+
+publickey = PublicKey.new(path)
+puts publickey
+
+id = publickey.id()
+
+puts "known #{keyring.is_key_known(id)}"
+puts "trusted #{keyring.is_key_trusted(id)}"
+
+keyring.import_key(publickey, true)
+
+puts "known #{keyring.is_key_known(id)}"
+puts "trusted #{keyring.is_key_trusted(id)}"
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/examples/ruby/list_target_resolvables.rb new/libzypp-bindings-0.4.2/examples/ruby/list_target_resolvables.rb
--- old/libzypp-bindings-0.4.2/examples/ruby/list_target_resolvables.rb 2007-08-23 17:11:54.000000000 +0200
+++ new/libzypp-bindings-0.4.2/examples/ruby/list_target_resolvables.rb 2007-08-29 00:01:05.000000000 +0200
@@ -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
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/examples/ruby/mediasetaccess_example.rb new/libzypp-bindings-0.4.2/examples/ruby/mediasetaccess_example.rb
--- old/libzypp-bindings-0.4.2/examples/ruby/mediasetaccess_example.rb  2007-08-23 17:11:54.000000000 +0200
+++ new/libzypp-bindings-0.4.2/examples/ruby/mediasetaccess_example.rb  2007-08-29 00:01:05.000000000 +0200
@@ -1,3 +1,4 @@
+#!/usr/bin/ruby
 
 require 'zypp'
 include Zypp
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/examples/ruby/parse1.rb new/libzypp-bindings-0.4.2/examples/ruby/parse1.rb
--- old/libzypp-bindings-0.4.2/examples/ruby/parse1.rb  2007-08-23 17:11:54.000000000 +0200
+++ new/libzypp-bindings-0.4.2/examples/ruby/parse1.rb  2007-08-29 00:01:05.000000000 +0200
@@ -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)
 
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/examples/ruby/parse2.rb new/libzypp-bindings-0.4.2/examples/ruby/parse2.rb
--- old/libzypp-bindings-0.4.2/examples/ruby/parse2.rb  2007-08-23 17:11:54.000000000 +0200
+++ new/libzypp-bindings-0.4.2/examples/ruby/parse2.rb  2007-08-29 00:01:05.000000000 +0200
@@ -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)
 
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/examples/ruby/play_with_pool_and_target.rb new/libzypp-bindings-0.4.2/examples/ruby/play_with_pool_and_target.rb
--- old/libzypp-bindings-0.4.2/examples/ruby/play_with_pool_and_target.rb       2007-08-23 17:11:54.000000000 +0200
+++ new/libzypp-bindings-0.4.2/examples/ruby/play_with_pool_and_target.rb       2007-08-29 00:01:05.000000000 +0200
@@ -1,3 +1,4 @@
+#!/usr/bin/ruby
 
 require 'zypp'
 include Zypp
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/examples/ruby/play_with_repos.rb new/libzypp-bindings-0.4.2/examples/ruby/play_with_repos.rb
--- old/libzypp-bindings-0.4.2/examples/ruby/play_with_repos.rb 2007-08-23 17:11:54.000000000 +0200
+++ new/libzypp-bindings-0.4.2/examples/ruby/play_with_repos.rb 2007-08-29 00:01:05.000000000 +0200
@@ -1,3 +1,4 @@
+#!/usr/bin/ruby
 
 require 'zypp'
 include Zypp
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/examples/ruby/test2.rb new/libzypp-bindings-0.4.2/examples/ruby/test2.rb
--- old/libzypp-bindings-0.4.2/examples/ruby/test2.rb   2007-08-23 17:11:54.000000000 +0200
+++ new/libzypp-bindings-0.4.2/examples/ruby/test2.rb   2007-08-29 00:01:05.000000000 +0200
@@ -1,3 +1,4 @@
+#!/usr/bin/ruby
 
 require 'zypp'
 require 'pathname'
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/examples/ruby/test.rb new/libzypp-bindings-0.4.2/examples/ruby/test.rb
--- old/libzypp-bindings-0.4.2/examples/ruby/test.rb    2007-08-23 17:11:54.000000000 +0200
+++ new/libzypp-bindings-0.4.2/examples/ruby/test.rb    2007-08-29 00:01:05.000000000 +0200
@@ -1,3 +1,4 @@
+#!/usr/bin/ruby
 
 require 'zypp'
 include Zypp
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/swig/Capability.i new/libzypp-bindings-0.4.2/swig/Capability.i
--- old/libzypp-bindings-0.4.2/swig/Capability.i        2007-08-23 17:11:54.000000000 +0200
+++ new/libzypp-bindings-0.4.2/swig/Capability.i        2007-08-29 00:01:05.000000000 +0200
@@ -1,7 +1,6 @@
 
 #ifdef SWIGRUBY
 %alias Capability::asString "to_s";
-%alias Capability::cmp "<=>";
 #endif
 
 class Capability
@@ -82,11 +81,9 @@
 };
 
 
-#ifdef SWIGRUBY
-
 %extend Capability
 {
-    int cmp(const Capability& other)
+    int __cmp__(const Capability& other)
     {
        // TODO: use CapOrder::operator()?
        if(self->asString() < other.asString())
@@ -97,4 +94,3 @@
     }
 }
 
-#endif
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/swig/KeyRing.i new/libzypp-bindings-0.4.2/swig/KeyRing.i
--- old/libzypp-bindings-0.4.2/swig/KeyRing.i   2007-08-23 17:11:54.000000000 +0200
+++ new/libzypp-bindings-0.4.2/swig/KeyRing.i   2007-08-29 00:01:05.000000000 +0200
@@ -1,20 +1,22 @@
 
-  class KeyRing
-  {
-  public:
-    KeyRing(const Pathname &baseTmpDir);
-    void importKey( const PublicKey &key, bool trusted = false);
-    void dumpTrustedPublicKey( const std::string &id, std::ostream &stream );
-    void dumpUntrustedPublicKey( const std::string &id, std::ostream &stream );
-    void dumpPublicKey( const std::string &id, bool trusted, std::ostream &stream );
-    std::string readSignatureKeyId( const Pathname &signature );
-    bool isKeyTrusted( const std::string &id);
-    bool isKeyKnown( const std::string &id );
-    void deleteKey( const std::string &id, bool trusted =  false);
-    std::list<PublicKey> publicKeys();
-    std::list<PublicKey> trustedPublicKeys();
-    bool verifyFileSignatureWorkflow( const Pathname &file, const std::string filedesc, const Pathname &signature);
-    bool verifyFileSignature( const Pathname &file, const Pathname &signature);
-    bool verifyFileTrustedSignature( const Pathname &file, const Pathname &signature);
+typedef intrusive_ptr<KeyRing> KeyRing_Ptr;
+
+class KeyRing
+{
+
+public:
+
+    KeyRing(const Pathname& baseTmpDir);
     ~KeyRing();
-  };
\ No newline at end of file
+
+    void importKey(const PublicKey& key, bool trusted = false);
+
+    bool isKeyTrusted(const std::string& id);
+    bool isKeyKnown(const std::string& id);
+
+    void deleteKey(const std::string& id, bool trusted = false);
+
+};
+
+%template(KeyRing_Ptr) intrusive_ptr<KeyRing>;
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/swig/Pathname.i new/libzypp-bindings-0.4.2/swig/Pathname.i
--- old/libzypp-bindings-0.4.2/swig/Pathname.i  2007-08-23 17:11:54.000000000 +0200
+++ new/libzypp-bindings-0.4.2/swig/Pathname.i  2007-08-29 00:01:05.000000000 +0200
@@ -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
 
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/swig/PublicKey.i new/libzypp-bindings-0.4.2/swig/PublicKey.i
--- old/libzypp-bindings-0.4.2/swig/PublicKey.i 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-bindings-0.4.2/swig/PublicKey.i 2007-08-29 00:01:05.000000000 +0200
@@ -0,0 +1,25 @@
+
+#ifdef SWIGRUBY
+%alias PublicKey::asString "to_s";
+#endif
+
+class PublicKey
+{
+
+public:
+
+    PublicKey();
+    PublicKey(const Pathname& file);
+    ~PublicKey();
+
+    bool isValid() const;
+
+    std::string asString() const;
+    std::string armoredData() const;
+    std::string id() const;
+    std::string name() const;
+    std::string fingerprint() const;
+    Pathname path() const;
+
+};
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/swig/RepoInfo.i new/libzypp-bindings-0.4.2/swig/RepoInfo.i
--- old/libzypp-bindings-0.4.2/swig/RepoInfo.i  2007-08-23 17:11:54.000000000 +0200
+++ new/libzypp-bindings-0.4.2/swig/RepoInfo.i  2007-08-29 00:01:05.000000000 +0200
@@ -134,6 +134,3 @@
 typedef std::list<RepoInfo> RepoInfoList;
 %template(RepoInfoList) std::list<RepoInfo>;
 
-#ifdef SWIGRUBY
-auto_iterator(std::list<RepoInfo>, RepoInfo);
-#endif
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/swig/ResObject.i new/libzypp-bindings-0.4.2/swig/ResObject.i
--- old/libzypp-bindings-0.4.2/swig/ResObject.i 2007-08-23 17:11:54.000000000 +0200
+++ new/libzypp-bindings-0.4.2/swig/ResObject.i 2007-08-29 00:01:05.000000000 +0200
@@ -1,8 +1,4 @@
 
-#ifdef SWIGRUBY
-%alias intrusive_ptr<const ResObject>::cmp "<=>";
-#endif
-
 %template(ResObject_constPtr) intrusive_ptr<const ResObject>;
 
 class ResObject : public Resolvable
@@ -53,7 +49,7 @@
        return "unknown";
     }
 
-    int cmp(intrusive_ptr<const ResObject>& other)
+    int __cmp__(intrusive_ptr<const ResObject>& other)
     {
        return compareByNVRA(*self, other);
     }
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/swig/ruby/ruby.i new/libzypp-bindings-0.4.2/swig/ruby/ruby.i
--- old/libzypp-bindings-0.4.2/swig/ruby/ruby.i 2007-08-23 17:11:54.000000000 +0200
+++ new/libzypp-bindings-0.4.2/swig/ruby/ruby.i 2007-08-29 00:01:05.000000000 +0200
@@ -29,6 +29,7 @@
     } \
 }
 
+
 /*
  *  Like iter2, but does only one dereferencing from the iterator.
  */
@@ -58,26 +59,15 @@
 }
 
 
-#define auto_iterator( cl, storetype ) \
-%mixin cl "Enumerable"; \
-%extend cl { \
-    void each() { \
-        cl::iterator i = self->begin(); \
-        while ( i != self->end() ) { \
-            rb_yield( SWIG_NewPointerObj( (void *) &*i, $descriptor(storetype), 0)); \
-            ++i; \
-        } \
-    } \
-}
-
-
-%exception {
+%exception
+{
   try {
     $action
   }
   catch (const Exception& e) {
     static VALUE zyppexception = rb_define_class("ZYppException", rb_eStandardError);
-    rb_raise(zyppexception, e.asString().c_str());
+    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.4.2/swig/zypp.i new/libzypp-bindings-0.4.2/swig/zypp.i
--- old/libzypp-bindings-0.4.2/swig/zypp.i      2007-08-23 17:11:54.000000000 +0200
+++ new/libzypp-bindings-0.4.2/swig/zypp.i      2007-08-29 00:01:05.000000000 +0200
@@ -94,6 +94,7 @@
 %include "NVRA.i"
 %include "NVRAD.i"
 %include "Package.i"
+%include "PublicKey.i"
 %include "KeyRing.i"
 %include "Target.i"
 %include "ResStatus.i"
@@ -126,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;


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



Remember to have fun...

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

< Previous Next >