Mailinglist Archive: zypp-commit (223 mails)

< Previous Next >
[zypp-commit] r10666 - in /trunk/libzypp-bindings: ./ package/ swig/ swig/perl5/ swig/ruby/
  • From: mlandres@xxxxxxxxxxxxxxxx
  • Date: Fri, 25 Jul 2008 18:07:37 -0000
  • Message-id: <20080725180737.BFD9D56FE5@xxxxxxxxxxxxxxxx>
Author: mlandres
Date: Fri Jul 25 20:07:37 2008
New Revision: 10666

URL: http://svn.opensuse.org/viewcvs/zypp?rev=10666&view=rev
Log:
- Removed almost all local copies of zypp header files. This also
removed some old classes no longer present in libzypp.
- Re-enabled building of python and perl bindings. (bnc #391831)

Modified:
trunk/libzypp-bindings/libzypp-bindings.spec.cmake
trunk/libzypp-bindings/package/libzypp-bindings.changes
trunk/libzypp-bindings/swig/Capabilities.i
trunk/libzypp-bindings/swig/Edition.i
trunk/libzypp-bindings/swig/IdStringType.i
trunk/libzypp-bindings/swig/KeyRing.i
trunk/libzypp-bindings/swig/perl5/perl.i
trunk/libzypp-bindings/swig/ruby/ruby.i

Modified: trunk/libzypp-bindings/libzypp-bindings.spec.cmake
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/libzypp-bindings.spec.cmake?rev=10666&r1=10665&r2=10666&view=diff
==============================================================================
--- trunk/libzypp-bindings/libzypp-bindings.spec.cmake (original)
+++ trunk/libzypp-bindings/libzypp-bindings.spec.cmake Fri Jul 25 20:07:37 2008
@@ -18,7 +18,7 @@
Group: Development/Sources
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: cmake gcc-c++ python-devel ruby-devel swig
-BuildRequires: libzypp-devel >= 3.0.0
+BuildRequires: libzypp-devel >= 5.2.1
Source: %{name}-%{version}.tar.bz2

%description

Modified: trunk/libzypp-bindings/package/libzypp-bindings.changes
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/package/libzypp-bindings.changes?rev=10666&r1=10665&r2=10666&view=diff
==============================================================================
--- trunk/libzypp-bindings/package/libzypp-bindings.changes (original)
+++ trunk/libzypp-bindings/package/libzypp-bindings.changes Fri Jul 25 20:07:37
2008
@@ -1,7 +1,16 @@
-------------------------------------------------------------------
+Fri Jul 25 19:29:11 CEST 2008 - ma@xxxxxxx
+
+- Removed almost all local copies of zypp header files. This also
+ removed some old classes no longer present in libzypp.
+- Re-enabled building of python and perl bindings. (bnc #391831)
+- revision 10666
+- version 0.4.6
+
+-------------------------------------------------------------------
Mon Jul 14 15:07:46 CEST 2008 - ma@xxxxxxx

-- Remove obsolete references to Script/Message/Atom.
+- Remove obsolete references to Script/Message/Atom.
- Remove obsolete references to Dependencies.

-------------------------------------------------------------------
@@ -32,7 +41,7 @@
-------------------------------------------------------------------
Mon Mar 3 13:46:25 CET 2008 - schubi@xxxxxxx

-- sat/repo moved to repository
+- sat/repo moved to repository
- Revision 8981
- version 0.4.5


Modified: trunk/libzypp-bindings/swig/Capabilities.i
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Capabilities.i?rev=10666&r1=10665&r2=10666&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/Capabilities.i (original)
+++ trunk/libzypp-bindings/swig/Capabilities.i Fri Jul 25 20:07:37 2008
@@ -1,16 +1,8 @@

-#if 1
%include <zypp/Capabilities.h>
-#else
-// I dont think this is correct: ctor and dtor are not taken into account
-class Capabilities
-{
-
-};
-

#ifdef SWIGRUBY
-iter3(Capabilities, Capability*);
+by_value_iterator(zypp::Capabilities);
#endif


@@ -22,19 +14,18 @@
// #endif

#ifdef SWIGPYTHON
-%extend Capabilities
+%extend zypp::Capabilities
{
- // just a test
- const Capability* haha()
- {
- Capabilities::iterator i = self->begin();
- const Capability* tmp = &*i;
- return tmp;
- }
+ // just a test
+ const Capability* haha()
+ {
+ Capabilities::const_iterator i = self->begin();
+ const Capability* tmp = &*i;
+ return tmp;
+ }
}
#endif

#ifdef SWIGPERL5
-iter2(Capabilities, Capability);
+forwarditer(zypp::Capabilities, zypp::Capability);
#endif
-#endif
\ No newline at end of file

Modified: trunk/libzypp-bindings/swig/Edition.i
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Edition.i?rev=10666&r1=10665&r2=10666&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/Edition.i (original)
+++ trunk/libzypp-bindings/swig/Edition.i Fri Jul 25 20:07:37 2008
@@ -1,4 +1,5 @@
// Ignore member functions shadowed by static versions
+// ma@: maybe one should ignore the statics and keep the members?
%ignore zypp::Edition::match(Edition const &) const;
%ignore zypp::Edition::match(IdString const &) const;
%ignore zypp::Edition::match(std::string const &) const;
@@ -11,7 +12,7 @@
// %rename Edition::match(const Edition& lhs, const Edition& rhs) match2;
//}

-%ignore zypp::Edition::compare(const Edition &, const Edition &);
+//%ignore zypp::Edition::compare(const Edition &, const Edition &);

%template(IdStringEdition) zypp::IdStringType<zypp::Edition>;
%include <zypp/Edition.h>

Modified: trunk/libzypp-bindings/swig/IdStringType.i
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/IdStringType.i?rev=10666&r1=10665&r2=10666&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/IdStringType.i (original)
+++ trunk/libzypp-bindings/swig/IdStringType.i Fri Jul 25 20:07:37 2008
@@ -1,2 +1,2 @@
-
+%include <zypp/IdString.h>
%include <zypp/IdStringType.h>

Modified: trunk/libzypp-bindings/swig/KeyRing.i
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/KeyRing.i?rev=10666&r1=10665&r2=10666&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/KeyRing.i (original)
+++ trunk/libzypp-bindings/swig/KeyRing.i Fri Jul 25 20:07:37 2008
@@ -3,9 +3,10 @@
%ignore zypp::KeyRingSignals;

%include <zypp/KeyRing.h>
-nakespcae zypp
+
+namespace zypp
{
-typedef intrusive_ptr<KeyRing> KeyRing_Ptr;
-%template(KeyRing_Ptr) intrusive_ptr<KeyRing>;
+ typedef intrusive_ptr<KeyRing> KeyRing_Ptr;
+ %template(KeyRing_Ptr) intrusive_ptr<KeyRing>;
}
%template(List_PublicKey) std::list<zypp::PublicKey>;

Modified: trunk/libzypp-bindings/swig/perl5/perl.i
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/perl5/perl.i?rev=10666&r1=10665&r2=10666&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/perl5/perl.i (original)
+++ trunk/libzypp-bindings/swig/perl5/perl.i Fri Jul 25 20:07:37 2008
@@ -46,11 +46,33 @@
%define iter2(cls, storetype)
%extend cls {
cls::const_iterator iterator_incr(cls::const_iterator *it){
- (*it)++;
+ ++(*it);
return *it;
}
cls::const_iterator iterator_decr(cls::const_iterator *it){
- (*it)--;
+ --(*it);
+ return *it;
+ }
+ bool iterator_equal(cls::const_iterator it1, cls::const_iterator it2) {
+ return (it1 == it2);
+ }
+ storetype iterator_value(cls::const_iterator it) {
+ return (*it);
+ }
+ cls::const_iterator cBegin() {
+ return self->begin();
+ }
+ cls::const_iterator cEnd() {
+ return self->end();
+ }
+};
+%enddef
+
+// no operator--
+%define forwarditer(cls, storetype)
+%extend cls {
+ cls::const_iterator iterator_incr(cls::const_iterator *it){
+ ++(*it);
return *it;
}
bool iterator_equal(cls::const_iterator it1, cls::const_iterator it2) {

Modified: trunk/libzypp-bindings/swig/ruby/ruby.i
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/ruby/ruby.i?rev=10666&r1=10665&r2=10666&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/ruby/ruby.i (original)
+++ trunk/libzypp-bindings/swig/ruby/ruby.i Fri Jul 25 20:07:37 2008
@@ -19,8 +19,8 @@
%ignore operator!=;
%ignore operator<<;
}
-}

+}

/*
* Extend cls with an ruby-like each iterator and a to_a method. Yields
@@ -80,6 +80,36 @@
} \
}

+/*
+ * This is for an iterator whichs operator* returns by value (i.e. a
temporary).
+ * Like e.g. the Capabilities::const_iterator does. If the compiler warns you
are
+ * taking the address of a temporary when using iter3, you most probaly need
this one.
+ *
+ */
+#define by_value_iterator(cls) \
+%mixin cls "Enumerable"; \
+%extend cls \
+{ \
+ void each() { \
+ cls::const_iterator i = self->begin(); \
+ while (i != self->end()) { \
+ const cls::value_type* tmp = new cls::value_type( *i ); \
+ rb_yield(SWIG_NewPointerObj((void*) tmp,
$descriptor(cls::value_type*), 1)); \
+ i++; \
+ } \
+ } \
+\
+ VALUE to_a() { \
+ VALUE ary = rb_ary_new(); \
+ cls::const_iterator i = self->begin(); \
+ while (i != self->end()) { \
+ const cls::value_type* tmp = new cls::value_type( *i ); \
+ rb_ary_push(ary, SWIG_NewPointerObj((void*) tmp,
$descriptor(cls::value_type*), 1)); \
+ i++; \
+ } \
+ return ary; \
+ } \
+}

%exception
{

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

< Previous Next >
This Thread
  • No further messages