Mailinglist Archive: zypp-commit (325 mails)

< Previous Next >
[zypp-commit] r7152 - in /trunk/libzypp-bindings: examples/perl/list_target_resolvables.pl swig/ResStore.i swig/zypp.i
  • From: haass@xxxxxxxxxxxxxxxx
  • Date: Fri, 07 Sep 2007 14:25:46 -0000
  • Message-id: <20070907142546.C5AA62B025@xxxxxxxxxxxxxxxx>
Author: haass
Date: Fri Sep  7 16:25:46 2007
New Revision: 7152

URL: http://svn.opensuse.org/viewcvs/zypp?rev=7152&view=rev
Log:
changes for perl-bindings

Added:
    trunk/libzypp-bindings/examples/perl/list_target_resolvables.pl
Modified:
    trunk/libzypp-bindings/swig/ResStore.i
    trunk/libzypp-bindings/swig/zypp.i

Added: trunk/libzypp-bindings/examples/perl/list_target_resolvables.pl
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/examples/perl/list_target_resolvables.pl?rev=7152&view=auto
==============================================================================
--- trunk/libzypp-bindings/examples/perl/list_target_resolvables.pl (added)
+++ trunk/libzypp-bindings/examples/perl/list_target_resolvables.pl Fri Sep  7 16:25:46 2007
@@ -0,0 +1,22 @@
+use zypp;
+
+$z = zyppc::ZYppFactory_instance();
+$zypp = $z->getZYpp;
+
+$t = $zypp->initializeTarget(zypp::Pathname->new("/"));
+
+$repo = $zypp->target;
+$store = $repo->resolvables;
+
+$it_b = $store->begin;
+
+while ($store->iterator_equal($it_b, $store->end) ne 1){
+   $pkg = $store->iterator_value($it_b);
+   print $pkg->kindToS, " ", $pkg->name, " ", $pkg->edition->asString;
+   print $pkg->arch->asString, "\n";
+   print "  Summary: ", $pkg->summary, "\n";
+   print "  Size: ", $pkg->size, "\n";
+   print "  Vendor: ", $pkg->vendor, "\n";
+   print "  BuildTime: ", $pkg->buildtime->asString, "\n";
+   $it_b = $store->iterator_incr($it_b);
+}

Modified: trunk/libzypp-bindings/swig/ResStore.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/ResStore.i?rev=7152&r1=7151&r2=7152&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/ResStore.i (original)
+++ trunk/libzypp-bindings/swig/ResStore.i Fri Sep  7 16:25:46 2007
@@ -34,3 +34,27 @@
     }
 }
 #endif
+
+#ifdef SWIGPERL5
+
+%extend ResStore {
+   
+   ResStore::iterator begin() {
+      return self->begin();
+   }
+   ResStore::iterator end() {
+      return self->end();
+   }
+   ResStore::iterator iterator_incr(ResStore::iterator *it) {
+      (*it)++;
+      return *it;
+   }
+   const ResObject* iterator_value(ResStore::iterator it) {
+      return (&**it);
+   }
+   bool iterator_equal(ResStore::iterator it1, ResStore::iterator it2) {
+      return (it1 == it2);
+   }
+};
+
+#endif

Modified: trunk/libzypp-bindings/swig/zypp.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/zypp.i?rev=7152&r1=7151&r2=7152&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/zypp.i (original)
+++ trunk/libzypp-bindings/swig/zypp.i Fri Sep  7 16:25:46 2007
@@ -110,10 +110,8 @@
 %include "Package.i"
 %include "PublicKey.i"
 %include "KeyRing.i"
-#ifndef SWIGPERL5
-   %include "Target.i"
-   %include "MediaSetAccess.i"
-#endif
+%include "Target.i"
+%include "MediaSetAccess.i"
 %include "PoolItem.i"
 %include "ResPool.i"
 %include "ResPoolManager.i"

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

< Previous Next >
This Thread
  • No further messages