Imported Upstream version 0.7.2 03/109503/1
authorDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 10 Jan 2017 07:53:43 +0000 (16:53 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 10 Jan 2017 07:53:43 +0000 (16:53 +0900)
Change-Id: Idb5a245e89eff6094ed5484d1a466682abb3bb22
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
VERSION.cmake
libzypp-bindings.spec.cmake
package/libzypp-bindings.changes
swig/Arch.i
swig/CMakeLists.txt
swig/Capabilities.i
swig/PoolQuery.i [new file with mode: 0644]
swig/ResPool.i
swig/Resolver.i
swig/SolvAttr.i [new file with mode: 0644]
swig/zypp.i

index 9b57953..9845770 100644 (file)
@@ -1,4 +1,4 @@
 # on maintenance branch add a 2nd level to patch (p.1, p.2, ...)
 SET(VERSION_MAJOR "0")
 SET(VERSION_MINOR "7")
-SET(VERSION_PATCH "1")
+SET(VERSION_PATCH "2")
index 591100d..af0774b 100644 (file)
@@ -26,7 +26,7 @@ Group:          Development/Sources
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 BuildRequires:  cmake
 BuildRequires:  gcc-c++ >= 4.5
-BuildRequires:  libzypp-devel >= 15.1.0
+BuildRequires:  libzypp-devel >= 15.10.0
 BuildRequires:  python-devel < 3
 BuildRequires:  ruby-devel
 BuildRequires:  swig >= 2
index 9cbb466..150323e 100644 (file)
@@ -1,4 +1,10 @@
 -------------------------------------------------------------------
+Mon Jul 20 13:44:19 CEST 2015 - ma@suse.de
+
+- Don't expose resolver internals (due to FATE#318099)
+- 0.7.2
+
+-------------------------------------------------------------------
 Thu May 21 13:09:43 CEST 2015 - ma@suse.de
 
 - Fix test to run with ruby-2.2
@@ -7,7 +13,7 @@ Thu May 21 13:09:43 CEST 2015 - ma@suse.de
 -------------------------------------------------------------------
 Mon May  4 10:17:32 CEST 2015 - ma@suse.de
 
-- Adapt to libzypp-15.x
+- Adapt to libzypp-15.x (bnc#899755)
 - 0.7.0
 
 -------------------------------------------------------------------
index 1129197..09ada80 100644 (file)
@@ -100,6 +100,22 @@ class Arch {
    * builtin: armv7hl
    */
   static Arch armv7hl() { return zypp::Arch_armv7hl; }
+  /*
+   * builtin: armv7tnhl
+   */
+  static Arch armv7tnhl() { return zypp::Arch_armv7tnhl; }
+  /*
+   * builtin: armv7thl
+   */
+  static Arch armv7thl() { return zypp::Arch_armv7thl; }
+  /*
+   * builtin: armv7nhl
+   */
+  static Arch armv7nhl() { return zypp::Arch_armv7nhl; }
+  /*
+   * builtin: armv7hl
+   */
+  static Arch armv7hl() { return zypp::Arch_armv7hl; }
 
   /*
    * builtin: armv7l
index 7ab74db..400c894 100644 (file)
@@ -8,25 +8,37 @@ ENABLE_TESTING()
 SET( SWIG_INPUT "${CMAKE_CURRENT_SOURCE_DIR}/zypp.i" )
 
 #
+# Allow to build only a subset of language bindings via options
+#
+
+OPTION(BUILD_RUBY_BINDINGS "Build Ruby bindings" ON)
+OPTION(BUILD_PYTHON2_BINDINGS "Build Python 2 bindings" ON)
+OPTION(BUILD_PERL5_BINDINGS "Build Perl 5 bindings" ON)
+
+#
 # Let's see which target languages are available
 #
 
-FIND_PACKAGE(Ruby)
-# Enforce Python 2.7, libzypp-bindings does not yet work with Python3
-set(PythonLibs_FIND_VERSION 2.7)
-set(PythonLibs_FIND_VERSION_MAJOR 2)
-FIND_PACKAGE(PythonLibs)
-FIND_PACKAGE(Perl)
-
-
-IF (RUBY_LIBRARY AND RUBY_INCLUDE_PATH)
-  ADD_SUBDIRECTORY(ruby)
-ENDIF(RUBY_LIBRARY AND RUBY_INCLUDE_PATH)
-    
-IF (PYTHON_LIBRARY)
-  ADD_SUBDIRECTORY(python)
-ENDIF(PYTHON_LIBRARY)
-      
-IF (PERL_EXECUTABLE)
-  ADD_SUBDIRECTORY(perl5)
-ENDIF (PERL_EXECUTABLE)
+IF(BUILD_RUBY_BINDINGS)
+  FIND_PACKAGE(Ruby)
+  IF(RUBY_LIBRARY AND RUBY_INCLUDE_PATH)
+    ADD_SUBDIRECTORY(ruby)
+  ENDIF()
+ENDIF()
+
+IF(BUILD_PYTHON2_BINDINGS)
+  # Enforce Python 2.7, libzypp-bindings does not yet work with Python3
+  set(PythonLibs_FIND_VERSION 2.7)
+  set(PythonLibs_FIND_VERSION_MAJOR 2)
+  FIND_PACKAGE(PythonLibs)
+  IF(PYTHON_LIBRARY)
+    ADD_SUBDIRECTORY(python)
+  ENDIF()
+ENDIF()
+
+IF(BUILD_PERL5_BINDINGS)
+  FIND_PACKAGE(Perl)
+  IF(PERL_EXECUTABLE)
+    ADD_SUBDIRECTORY(perl5)
+  ENDIF()
+ENDIF()
index 88e5c30..624b921 100644 (file)
@@ -8,3 +8,21 @@ by_value_iterator(zypp::Capabilities);
 #ifdef SWIGPERL5
 forwarditer(zypp::Capabilities, zypp::Capability);
 #endif
+
+#ifdef SWIGPYTHON
+%include "std_vector.i"
+%include "std_string.i"
+
+%template(StringVector) std::vector<std::string>;
+
+%extend  zypp::Capabilities {
+    std::vector<std::string> CapNames()
+    {
+        std::vector<std::string> caps;
+        for (zypp::Capabilities::const_iterator it = self->begin(); it != self->end(); ++it) {
+            caps.push_back((*it).asString());
+        }
+        return caps;
+    }
+}
+#endif
diff --git a/swig/PoolQuery.i b/swig/PoolQuery.i
new file mode 100644 (file)
index 0000000..05ff584
--- /dev/null
@@ -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
+
index 8c1c45f..77a9659 100644 (file)
@@ -16,6 +16,28 @@ namespace zypp
 
 namespace zypp
 {
+
+#ifdef SWIGPYTHON
+namespace sat
+{
+%extend  Pool {
+  std::string loadSolvFile(std::string _solv, std::string _alias)
+  {
+    RepoInfo tmpRepo;
+    tmpRepo.setAlias(_alias);
+
+    try {
+      addRepoSolv(_solv, tmpRepo);
+    } catch ( const Exception & e ) {
+      return e.msg();
+    }
+
+    return std::string();
+  }
+}
+}
+#endif
+
 %extend ResPool {
   pool::GetResolvablesToInsDel getTransaction()
   {
index 127d70f..d6842dd 100644 (file)
@@ -2,6 +2,12 @@
    %template(StringList) std::list<std::string>;
 #endif
 
+/* don't wrap legacy ItemCapKind stuff */
+%ignore zypp::Resolver::isInstalledBy( const PoolItem & item );
+%ignore zypp::Resolver::installs( const PoolItem & item );
+%ignore zypp::Resolver::satifiedByInstalled (const PoolItem & item );
+%ignore zypp::Resolver::installedSatisfied( const PoolItem & item );
+
 %include <zypp/ProblemTypes.h>
 %include <zypp/ResolverProblem.h>
 %include <zypp/ProblemSolution.h>
@@ -17,10 +23,6 @@ typedef std::list<zypp::ProblemSolution_Ptr> ProblemSolutionList;
 typedef boost::intrusive_ptr< zypp::ProblemSolution > ProblemSolution_Ptr;
 %template(ProblemSolution_Ptr) boost::intrusive_ptr< zypp::ProblemSolution >;
 
-
-typedef std::list< zypp::solver::detail::SolutionAction_constPtr > CSolutionActionList;
-%template(CSolutionActionList) std::list< zypp::solver::detail::SolutionAction_constPtr >;
-
 namespace zypp
 {
 
diff --git a/swig/SolvAttr.i b/swig/SolvAttr.i
new file mode 100644 (file)
index 0000000..5c77ba8
--- /dev/null
@@ -0,0 +1,2 @@
+%ignore zypp::sat::SolvAttr::repositoryRevision;
+%include <zypp/sat/SolvAttr.h>
index bd3df23..37f9a0f 100644 (file)
@@ -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;
@@ -262,6 +264,8 @@ namespace zypp {
 %include "TmpPath.i"
 %include "Resolver.i"
 %include "ZConfig.i"
+%include "SolvAttr.i"
+%include "PoolQuery.i"
 
 //just simple files, where we need default ctor
 %include <zypp/repo/RepoProvideFile.h>