Fix basic resolvabe attributes as needed by list_resolvables.py example.
authorMichael Andres <ma@suse.de>
Fri, 5 Sep 2008 16:43:40 +0000 (16:43 +0000)
committerMichael Andres <ma@suse.de>
Fri, 5 Sep 2008 16:43:40 +0000 (16:43 +0000)
examples/python/list_resolvables.py
libzypp-bindings.spec.cmake
package/libzypp-bindings.changes
swig/Arch.i
swig/ResObject.i
swig/ResTraits.i
swig/zypp.i

index 69c3b7e..7654737 100755 (executable)
@@ -2,7 +2,6 @@
 import zypp
 
 Z = zypp.ZYppFactory_instance().getZYpp()
-
 Z.initializeTarget( zypp.Pathname("/") )
 Z.target().load();
 
@@ -16,7 +15,6 @@ for repo in repos:
         repoManager.buildCache( repo )
     repoManager.loadFromCache( repo );
 
-
 print "Items: %d" % ( Z.pool().size() )
 
 for item in Z.pool():
@@ -24,9 +22,9 @@ for item in Z.pool():
       t = "i"
     else:
       t = "*"
-    print "%s %s" % ( t , item.resolvable())
-    #print "%s %s:%s-%s.%s\t(%s)" % ( t,
-     #                                item.resolvable().kind(),
-      ##                              item.resolvable().edition(),
-        #                             item.resolvable().arch(),
-         #                            item.resolvable().repository().info().alias() )
+    print "%s %s:%s-%s.%s\t(%s)" % ( t,
+                                     item.kind(),
+                                     item.name(),
+                                     item.edition(),
+                                     item.arch(),
+                                     item.repoInfo().alias() )
index 6531e71..74149c2 100644 (file)
@@ -18,7 +18,7 @@ Summary:        Bindings for libzypp
 Group:          Development/Sources
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 BuildRequires:  cmake gcc-c++ python-devel ruby-devel swig
-BuildRequires:  libzypp-devel >= 5.2.1
+BuildRequires:  libzypp-devel >= 5.8.0
 Source:         %{name}-%{version}.tar.bz2
 
 %description
index f15d01d..275f4db 100644 (file)
@@ -1,4 +1,11 @@
 -------------------------------------------------------------------
+Fri Sep  5 18:41:31 CEST 2008 - ma@suse.de
+
+- Fix basic resolvabe attributes as needed by list_resolvables.py
+  example.
+- revision 10952
+
+-------------------------------------------------------------------
 Thu Sep  4 11:42:50 CEST 2008 - ma@suse.de
 
 - Added lost RepoInfo and ServiceInfo.
index 320c7f8..417ecdf 100644 (file)
@@ -1,5 +1,6 @@
 // Ignore static versions shadowed by member functions
 %ignore zypp::Arch::compare(const Arch &, const Arch &);
+%ignore zypp::Arch::asString( const CompatSet & cset );
 
 template<class A, class B> class std::unary_function {};
 %template(ArchCompatFun) std::unary_function<zypp::Arch, bool>;
index e179e9a..d25b6ef 100644 (file)
@@ -8,7 +8,6 @@
 {
     int __cmp__(intrusive_ptr<const ResObject>& other)
     {
-       return compareByNVRA(*self, other);
+        return *self == other;
     }
 }
-
index fcd6519..0b24cac 100644 (file)
@@ -5,18 +5,25 @@
     typedef KindOf<Resolvable>  KindType;
 };*/
 
-/** ResTraits. Defines common types and the Kind value. */
-template<typename _Res>
+namespace zypp
+{
+  /** ResTraits. Defines common types and the Kind value. */
+  template<typename _Res>
   struct ResTraits
   {
-      typedef intrusive_ptr<_Res>       PtrType;
-      typedef intrusive_ptr<const _Res> constPtrType;
+      typedef zypp::intrusive_ptr<_Res>       PtrType;
+      typedef zypp::intrusive_ptr<const _Res> constPtrType;
   };
 
-%template(ResTraitsResolvable) ResTraits<Resolvable>;
+   typedef intrusive_ptr<const ResObject> ResObject_constPtr;
+   typedef intrusive_ptr<ResObject>       ResObject_Ptr;
+   %template(ResObject_constPtr)          intrusive_ptr<const zypp::ResObject>;
+   %template(ResObject_Ptr)               intrusive_ptr<zypp::ResObject>;
+
+}
 
-%template(ResObject_constPtr) intrusive_ptr<const ResObject>;
-%template(ResObject_Ptr) intrusive_ptr<ResObject>;
+%template(ResTraitsResolvable) zypp::ResTraits<zypp::Resolvable>;
+%template(ResTraitsResObject)  zypp::ResTraits<zypp::ResObject>;
 
 // Common definitions for all Resolvable types
 // - *_Ptr and *_constPtr
@@ -28,8 +35,8 @@ template<typename _Res>
 typedef intrusive_ptr<const X> X##_constPtr;
 typedef intrusive_ptr<X> X##_Ptr;
 
-%template(X##_constPtr) intrusive_ptr<const X>;
-%template(X##_Ptr) intrusive_ptr<X>;
+%template(X##_constPtr) zypp::intrusive_ptr<const X>;
+%template(X##_Ptr)      zypp::intrusive_ptr<X>;
 
 bool isKind##X( const Resolvable::constPtr & p );
 bool isKind##X( const PoolItem & p );
index 06fe86d..4dbd47a 100644 (file)
@@ -54,8 +54,6 @@ typedef std::list<std::string> StringList;
 %}
 
 %nodefault ByKind;
-%define DEFINE_PTR_TYPE(name)
-%enddef
 
 %rename("+") "operator+";
 %rename("<<") "operator<<";
@@ -63,12 +61,6 @@ typedef std::list<std::string> StringList;
 %rename("!") "operator!";
 %rename("==") "operator==";
 
-template < typename T >
-class intrusive_ptr {
-  public:
-    T *operator->();
-};
-
 namespace zypp {
   namespace base {
     // silence 'Nothing known about class..' warning
@@ -97,6 +89,12 @@ namespace zypp {
 %include "perl5/perl.i"
 #endif
 
+%import <boost/scoped_ptr.hpp>
+%import <boost/shared_ptr.hpp>
+%import <boost/weak_ptr.hpp>
+%import <boost/intrusive_ptr.hpp>
+%import <zypp/base/PtrTypes.h>
+
 %include "IdStringType.i"
 %include "Pathname.i"
 %include "ByteCount.i"
@@ -111,6 +109,9 @@ namespace zypp {
 %include "Capability.i"
 %include "Capabilities.i"
 %include "CapMatch.i"
+%include "RepoType.i"
+%include "RepoInfo.i"
+%include "ServiceInfo.i"
 %include "ResTraits.i"
 %include "ResStatus.i"
 %include "Resolvable.i"
@@ -120,9 +121,6 @@ namespace zypp {
 %include "Pattern.i"
 %include "Product.i"
 %include "SrcPackage.i"
-%include "RepoType.i"
-%include "RepoInfo.i"
-%include "ServiceInfo.i"
 %include "Repository.i"
 %include "RepoStatus.i"
 %include "RepoManager.i"