diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2017-01-10 16:53:43 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2017-01-10 16:53:43 +0900 |
commit | 85b1b81f2d4c67148de2ca47d5f77dca1c1b6fa0 (patch) | |
tree | 79fc5c4c1d4b247f29afdbb17172b93dd3158b0c | |
parent | bc07cc788d0d5d0fda06dddc8b05a01678896162 (diff) | |
download | libzypp-bindings-85b1b81f2d4c67148de2ca47d5f77dca1c1b6fa0.tar.gz libzypp-bindings-85b1b81f2d4c67148de2ca47d5f77dca1c1b6fa0.tar.bz2 libzypp-bindings-85b1b81f2d4c67148de2ca47d5f77dca1c1b6fa0.zip |
Imported Upstream version 0.7.2
Change-Id: Idb5a245e89eff6094ed5484d1a466682abb3bb22
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
-rw-r--r-- | VERSION.cmake | 2 | ||||
-rw-r--r-- | libzypp-bindings.spec.cmake | 2 | ||||
-rw-r--r-- | package/libzypp-bindings.changes | 8 | ||||
-rw-r--r-- | swig/Arch.i | 16 | ||||
-rw-r--r-- | swig/CMakeLists.txt | 50 | ||||
-rw-r--r-- | swig/Capabilities.i | 18 | ||||
-rw-r--r-- | swig/PoolQuery.i | 39 | ||||
-rw-r--r-- | swig/ResPool.i | 22 | ||||
-rw-r--r-- | swig/Resolver.i | 10 | ||||
-rw-r--r-- | swig/SolvAttr.i | 2 | ||||
-rw-r--r-- | swig/zypp.i | 4 |
11 files changed, 147 insertions, 26 deletions
diff --git a/VERSION.cmake b/VERSION.cmake index 9b57953..9845770 100644 --- a/VERSION.cmake +++ b/VERSION.cmake @@ -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") diff --git a/libzypp-bindings.spec.cmake b/libzypp-bindings.spec.cmake index 591100d..af0774b 100644 --- a/libzypp-bindings.spec.cmake +++ b/libzypp-bindings.spec.cmake @@ -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 diff --git a/package/libzypp-bindings.changes b/package/libzypp-bindings.changes index 9cbb466..150323e 100644 --- a/package/libzypp-bindings.changes +++ b/package/libzypp-bindings.changes @@ -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 ------------------------------------------------------------------- diff --git a/swig/Arch.i b/swig/Arch.i index 1129197..09ada80 100644 --- a/swig/Arch.i +++ b/swig/Arch.i @@ -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 diff --git a/swig/CMakeLists.txt b/swig/CMakeLists.txt index 7ab74db..400c894 100644 --- a/swig/CMakeLists.txt +++ b/swig/CMakeLists.txt @@ -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() diff --git a/swig/Capabilities.i b/swig/Capabilities.i index 88e5c30..624b921 100644 --- a/swig/Capabilities.i +++ b/swig/Capabilities.i @@ -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 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/ResPool.i b/swig/ResPool.i index 8c1c45f..77a9659 100644 --- a/swig/ResPool.i +++ b/swig/ResPool.i @@ -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() { diff --git a/swig/Resolver.i b/swig/Resolver.i index 127d70f..d6842dd 100644 --- a/swig/Resolver.i +++ b/swig/Resolver.i @@ -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 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 bd3df23..37f9a0f 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; @@ -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> |