summaryrefslogtreecommitdiff
path: root/swig
diff options
context:
space:
mode:
Diffstat (limited to 'swig')
-rw-r--r--swig/CMakeLists.txt6
-rw-r--r--swig/PoolQuery.i39
-rw-r--r--swig/RepoManager.i18
-rw-r--r--swig/RepoType.i3
-rw-r--r--swig/SolvAttr.i2
-rw-r--r--swig/zypp.i9
6 files changed, 72 insertions, 5 deletions
diff --git a/swig/CMakeLists.txt b/swig/CMakeLists.txt
index efa48c4..ea807f6 100644
--- a/swig/CMakeLists.txt
+++ b/swig/CMakeLists.txt
@@ -24,6 +24,6 @@ IF (PYTHON_LIBRARY)
ADD_SUBDIRECTORY(python)
ENDIF(PYTHON_LIBRARY)
-IF (PERL_EXECUTABLE)
- ADD_SUBDIRECTORY(perl5)
-ENDIF (PERL_EXECUTABLE)
+#IF (PERL_EXECUTABLE)
+# ADD_SUBDIRECTORY(perl5)
+#ENDIF (PERL_EXECUTABLE)
diff --git a/swig/PoolQuery.i b/swig/PoolQuery.i
new file mode 100644
index 0000000..05ff584
--- /dev/null
+++ b/swig/PoolQuery.i
@@ -0,0 +1,39 @@
+%ignore zypp::PoolQuery::operator<<;
+%ignore zypp::detail::operator<<;
+%ignore zypp::dumpOn;
+%ignore zypp::detail::dumpOn;
+%ignore operator<<;
+%include <zypp/PoolQuery.h>
+%include "std_vector.i"
+namespace std {
+ %template(PoolItemVector) vector<zypp::PoolItem>;
+}
+namespace zypp
+{
+ namespace detail
+ {
+ %ignore operator<<;
+ }
+}
+%{
+#include <vector>
+using std::vector;
+%}
+
+#ifdef SWIGPYTHON
+%extend zypp::PoolQuery {
+std::vector<zypp::PoolItem> queryResults (zypp::ResPool pool)
+{
+#define for_(IT,BEG,END) for ( decltype(BEG) IT = BEG; IT != END; ++IT )
+ std::vector<zypp::PoolItem> items;
+ for_(it, self->begin(), self->end())
+ {
+ PoolItem pi(*it);
+ items.push_back(pi);
+ }
+
+ return items;
+}
+}
+#endif
+
diff --git a/swig/RepoManager.i b/swig/RepoManager.i
index 8f7870d..a150d32 100644
--- a/swig/RepoManager.i
+++ b/swig/RepoManager.i
@@ -1 +1,19 @@
%include <zypp/RepoManager.h>
+
+#ifdef SWIGPYTHON
+%extend zypp::RepoManager{
+ std::string loadSolvFile(std::string _solv, std::string _alias)
+ {
+ RepoInfo tmpRepo;
+ tmpRepo.setAlias(_alias);
+ try {
+ sat::Pool::instance().addRepoSolv(_solv, tmpRepo);
+ } catch ( const Exception & e ){
+ return e.msg();
+ }
+
+ return std::string();
+ }
+}
+#endif
+
diff --git a/swig/RepoType.i b/swig/RepoType.i
index d9f1164..3907371 100644
--- a/swig/RepoType.i
+++ b/swig/RepoType.i
@@ -1 +1,2 @@
-%include <zypp/repo/RepoType.h> \ No newline at end of file
+%ignore zypp::operator<<;
+%include <zypp/repo/RepoType.h>
diff --git a/swig/SolvAttr.i b/swig/SolvAttr.i
new file mode 100644
index 0000000..5c77ba8
--- /dev/null
+++ b/swig/SolvAttr.i
@@ -0,0 +1,2 @@
+%ignore zypp::sat::SolvAttr::repositoryRevision;
+%include <zypp/sat/SolvAttr.h>
diff --git a/swig/zypp.i b/swig/zypp.i
index 53b781d..9935197 100644
--- a/swig/zypp.i
+++ b/swig/zypp.i
@@ -139,6 +139,8 @@ SWIGINTERNINLINE SV *SWIG_From_double SWIG_PERL_DECL_ARGS_1(double value);
#include "zypp/Resolver.h"
#include "legacy/GetResolvablesToInsDel.h"
+#include "zypp/sat/SolvAttr.h"
+#include "zypp/PoolQuery.h"
#include "zypp/Product.h"
using namespace boost;
@@ -151,6 +153,9 @@ typedef std::list<std::string> StringList;
%}
+/* swig does not understand the __attribute__ extension */
+#define __attribute__(x)
+
/* prevent swig from creating a type called 'Target_Type' */
#if defined(SWIGRUBY)
#define Target_Type VALUE
@@ -233,6 +238,7 @@ namespace zypp {
%include "OnMediaLocation.i"
%include "Resolvable.i"
%include "RepoType.i"
+%include "TmpPath.i"
%include "RepoInfo.i"
%include "Repository.i"
%include "ServiceInfo.i"
@@ -256,9 +262,10 @@ namespace zypp {
%include "ResPool.i"
%include "ZYppCommitPolicy.i"
%include "ZYppCommitResult.i"
-%include "TmpPath.i"
%include "Resolver.i"
%include "ZConfig.i"
+%include "PoolQuery.i"
+%include "SolvAttr.i"
//just simple files, where we need default ctor
%include <zypp/repo/RepoProvideFile.h>