Hello community,
here is the log from the commit of package libzypp-bindings
checked in at Mon Sep 17 19:33:51 CEST 2007.
--------
--- libzypp-bindings/libzypp-bindings.changes 2007-09-03 16:49:14.000000000 +0200
+++ /mounts/work_src_done/STABLE/libzypp-bindings/libzypp-bindings.changes 2007-09-17 19:19:27.494774000 +0200
@@ -1,0 +2,6 @@
+Mon Sep 17 18:58:53 CEST 2007 - aschnell@suse.de
+
+- generate Perl bindings
+- use ZYpp Url class
+
+-------------------------------------------------------------------
@@ -6,0 +13 @@
+
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libzypp-bindings.spec ++++++
--- /var/tmp/diff_new_pack.p15605/_old 2007-09-17 19:33:42.000000000 +0200
+++ /var/tmp/diff_new_pack.p15605/_new 2007-09-17 19:33:42.000000000 +0200
@@ -11,7 +11,7 @@
Name: libzypp-bindings
Version: 0.4.2
-Release: 4
+Release: 5
License: GPL v2 or later
Summary: Bindings for libzypp
Group: Development/Sources
@@ -54,6 +54,7 @@
%clean
%{__rm} -rf %{buildroot}
+
%package -n ruby-zypp
Summary: Ruby bindings for libzypp
Group: Development/Languages/Ruby
@@ -74,6 +75,7 @@
%files -n ruby-zypp
%defattr(-,root,root,-)
%{_libdir}/ruby/vendor_ruby/%{rb_ver}/%{rb_arch}/zypp.so
+
%package -n python-zypp
Summary: Python Bindings for libzypp
Group: Development/Languages/Python
@@ -96,7 +98,32 @@
%{_libdir}/python2.5/site-packages/_zypp.so
%{_libdir}/python2.5/site-packages/zypp.py
+%package -n perl-zypp
+Summary: Perl bindings for libzypp
+Group: Development/Languages/Perl
+
+%description -n perl-zypp
+This package provides Perl bindings for libzypp, the library for
+package management.
+
+
+
+Authors:
+--------
+ Duncan Mac-Vicar
+ Klaus K�mpf
+ Arvin Schnell
+
+
+%files -n perl-zypp
+%defattr(-,root,root,-)
+/usr/lib/perl5/*/*/zypp.pm
+/usr/lib/perl5/*/*/zypp.so
+
%changelog
+* Mon Sep 17 2007 - aschnell@suse.de
+- generate Perl bindings
+- use ZYpp Url class
* Mon Sep 03 2007 - schwab@suse.de
- Fix broken compiler flags.
* Thu Aug 30 2007 - aschnell@suse.de
++++++ libzypp-bindings-0.4.2.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/examples/perl/list_target_resolvables.pl new/libzypp-bindings-0.4.2/examples/perl/list_target_resolvables.pl
--- old/libzypp-bindings-0.4.2/examples/perl/list_target_resolvables.pl 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-bindings-0.4.2/examples/perl/list_target_resolvables.pl 2007-09-17 19:09:25.000000000 +0200
@@ -0,0 +1,34 @@
+use zypp;
+
+$z = zyppc::ZYppFactory_instance();
+$zypp = $z->getZYpp;
+
+$t = $zypp->initializeTarget(zypp::Pathname->new("/"));
+
+$repo = $zypp->target;
+$store = $repo->resolvables;
+
+$it_b = $store->cBegin;
+
+while ($store->iterator_equal($it_b, $store->cEnd) ne 1){
+ $pkg = $store->iterator_value($it_b);
+ print $pkg->kindToS, " ", $pkg->name, " ", $pkg->edition->asString;
+ print $pkg->arch->asString, "\n";
+ print " Summary: ", $pkg->summary, "\n";
+ print " Size: ", $pkg->size, "\n";
+ print " Vendor: ", $pkg->vendor, "\n";
+ print " BuildTime: ", $pkg->buildtime->asString, "\n";
+ $it_b = $store->iterator_incr($it_b);
+
+ $deps = $pkg->dep($zyppc::Dep_PROVIDES);
+
+ $it_b2 = $deps->cBegin;
+
+ while($deps->iterator_equal($it_b2, $deps->cEnd) ne 1){
+ $dep = $deps->iterator_value($it_b2);
+ print "Provides: ", $dep->asString, "\n";
+ $it_b2 = $deps->iterator_incr($it_b2);
+ }
+ print "\n";
+
+}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/examples/perl/test.pl new/libzypp-bindings-0.4.2/examples/perl/test.pl
--- old/libzypp-bindings-0.4.2/examples/perl/test.pl 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-bindings-0.4.2/examples/perl/test.pl 2007-09-17 19:09:25.000000000 +0200
@@ -0,0 +1,64 @@
+use zypp;
+use rpdbtozypp;
+
+$z = zyppc::ZYppFactory_instance();
+$zypp = $z->getZYpp;
+$pdb = rpdbtozypp::PdbToZypp->new;
+print "Package to install: ";
+$ipkg = <STDIN>;
+chomp($ipkg);
+print "Importing packages from pdb!\n\n";
+print "This may take a while, please be patient!\n";
+if($pdb->readOut ne 1){
+ exit;
+}
+$store = $pdb->getStore;
+$zypp->addResolvables($store);
+
+$pool = $zypp->pool;
+$it_b = $pool->cBegin;
+$it_e = $pool->cEnd;
+
+$checker = 0;
+
+print "Looking for package...!\n";
+while ($pool->iterator_equal($it_b, $pool->cEnd) ne 1){
+ $pkg = $pool->iterator_value($it_b);
+ $test = $pkg->resolvable;
+ $it_b = $pool->iterator_incr($it_b);
+ if($test->name eq $ipkg){
+ print "Package found!\n";
+ $tmp = $pkg->status;
+ $tmp->setToBeInstalledUser;
+ $checker = 1;
+ $it_b = $it_e;
+ }
+}
+if($checker eq 0){
+ print "Package not in pdb!\n";
+ print "Check spelling!\n";
+ exit;
+}
+
+$resolver = zypp::Resolver->new($pool);
+
+$it_b = $pool->cBegin;
+if($resolver->resolvePool ne 1){
+ print "Unable to solve the pool!!!\n";
+ print "Problem Description: ";
+ $problems = $resolver->problemDescription;
+ foreach $problem (@$problems){
+ print $problem, "\n";
+ }
+}else{
+ print "These packages has to be installed: \n";
+# while ($it_b ne $pool->end){
+ while ($pool->iterator_equal($it_b, $pool->cEnd) ne 1){
+ $pkg = $pool->iterator_value($it_b);
+ $it_b = $pool->iterator_incr($it_b);
+ $test = $pkg->resolvable;
+ if($pkg->status->isToBeInstalled eq 1){
+ print $test->name, "\n";
+ }
+ }
+}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/examples/python/date.py new/libzypp-bindings-0.4.2/examples/python/date.py
--- old/libzypp-bindings-0.4.2/examples/python/date.py 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-bindings-0.4.2/examples/python/date.py 2007-09-17 19:09:25.000000000 +0200
@@ -0,0 +1,10 @@
+#!/usr/bin/python
+
+from zypp import Date
+
+print Date()
+
+d = Date.now()
+print d
+print d.form("%F %T")
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/libzypp-bindings.spec.cmake new/libzypp-bindings-0.4.2/libzypp-bindings.spec.cmake
--- old/libzypp-bindings-0.4.2/libzypp-bindings.spec.cmake 2007-08-30 17:36:55.000000000 +0200
+++ new/libzypp-bindings-0.4.2/libzypp-bindings.spec.cmake 2007-09-17 19:09:25.000000000 +0200
@@ -30,8 +30,9 @@
cd build
cmake -DCMAKE_INSTALL_PREFIX=%{prefix} \
-DLIB=%{_lib} \
- -DCMAKE_C_FLAGS="%{optflags}" \
- -DCMAKE_CXX_FLAGS="%{optflags}" \
+ -DCMAKE_VERBOSE_MAKEFILE=TRUE \
+ -DCMAKE_C_FLAGS_RELEASE:STRING="%{optflags}" \
+ -DCMAKE_CXX_FLAGS_RELEASE:STRING="%{optflags}" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_SKIP_RPATH=1 \
..
@@ -67,4 +68,16 @@
%{_libdir}/python2.5/site-packages/_zypp.so
%{_libdir}/python2.5/site-packages/zypp.py
+%package -n perl-zypp
+Summary: Perl bindings for libzypp
+Group: Development/Languages/Perl
+
+%description -n perl-zypp
+-
+
+%files -n perl-zypp
+%defattr(-,root,root,-)
+/usr/lib/perl5/*/*/zypp.pm
+/usr/lib/perl5/*/*/zypp.so
+
%changelog
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/README new/libzypp-bindings-0.4.2/README
--- old/libzypp-bindings-0.4.2/README 2007-08-30 17:36:55.000000000 +0200
+++ new/libzypp-bindings-0.4.2/README 2007-09-17 19:09:25.000000000 +0200
@@ -2,27 +2,18 @@
Attempt to create generated bindings for
libzypp. Not restricted to one language.
-Author: dmacvicar@suse.de
-
-Notes:
-
-- Some classes are not wrapped but converted to
- equivalents:
-
-Usage:
-
-Requires swig and ruby installed.
+Authors: dmacvicar@suse.de
+ aschnell@suse.de
Ruby Notes
==========
* API tries to follow ruby standards:
-* zypp::Pathname -> std Pathname in ruby
-* zypp::Date -> std Time in ruby
-* ResStore does not implement iterators but:
+* Containers do not implement iterators but:
* each
- * each_by_name
+ * to_a
* etc
* lower case methods, ie: ZYppFactory::instance.get_zypp
instead of ZYppFactory::instance()->getZYpp()
z.initialize_target("/") for z.initializeTarget("/")
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/swig/ByteCount.i new/libzypp-bindings-0.4.2/swig/ByteCount.i
--- old/libzypp-bindings-0.4.2/swig/ByteCount.i 2007-08-30 17:36:55.000000000 +0200
+++ new/libzypp-bindings-0.4.2/swig/ByteCount.i 2007-09-17 19:09:25.000000000 +0200
@@ -13,3 +13,12 @@
#endif
+#ifdef SWIGPERL5
+
+%typemap(out) ByteCount {
+ $result = sv_newmortal();
+ sv_setiv($result, (IV) (ByteCount::SizeType) $1 );
+ argvi++;
+}
+
+#endif
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/swig/CapSet.i new/libzypp-bindings-0.4.2/swig/CapSet.i
--- old/libzypp-bindings-0.4.2/swig/CapSet.i 2007-08-30 17:36:55.000000000 +0200
+++ new/libzypp-bindings-0.4.2/swig/CapSet.i 2007-09-17 19:09:25.000000000 +0200
@@ -31,3 +31,7 @@
}
}
#endif
+
+#ifdef SWIGPERL5
+iter2(CapSet, Capability);
+#endif
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/swig/CMakeLists.txt new/libzypp-bindings-0.4.2/swig/CMakeLists.txt
--- old/libzypp-bindings-0.4.2/swig/CMakeLists.txt 2007-08-30 17:36:55.000000000 +0200
+++ new/libzypp-bindings-0.4.2/swig/CMakeLists.txt 2007-09-17 19:09:25.000000000 +0200
@@ -3,3 +3,5 @@
ADD_SUBDIRECTORY(python)
+ADD_SUBDIRECTORY(perl5)
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/swig/Date.i new/libzypp-bindings-0.4.2/swig/Date.i
--- old/libzypp-bindings-0.4.2/swig/Date.i 2007-08-30 17:36:55.000000000 +0200
+++ new/libzypp-bindings-0.4.2/swig/Date.i 2007-09-17 19:09:25.000000000 +0200
@@ -1,17 +1,20 @@
-#ifdef SWIGRUBY
+#if defined(SWIGPYTHON) || defined(SWIGRUBY)
+%rename Date::asString "__str__";
+#endif
-%typemap(in) Date {
- Date::ValueType seconds = (Date::ValueType) NUM2INT( rb_funcall( $input, rb_intern("to_i"), 0, 0) );
- $1 = Date(seconds);
-}
-
-%typemap(out) Date {
- // Time works without require
- VALUE klass = rb_const_get( rb_cObject, rb_intern("Time"));
- VALUE rbtimenum = INT2NUM( (Date::ValueType) $1 );
- $result = rb_funcall( klass, rb_intern("at"), 1, rbtimenum);
-}
+class Date
+{
+public:
-#endif
+ Date();
+ Date(const std::string & seconds_r);
+
+ static Date now();
+
+ std::string form(const std::string & format_r) const;
+ std::string asString() const;
+ std::string asSeconds() const;
+
+};
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/swig/Dep.i new/libzypp-bindings-0.4.2/swig/Dep.i
--- old/libzypp-bindings-0.4.2/swig/Dep.i 2007-08-30 17:36:55.000000000 +0200
+++ new/libzypp-bindings-0.4.2/swig/Dep.i 2007-09-17 19:09:25.000000000 +0200
@@ -1,6 +1,10 @@
+#if defined(SWIGPYTHON) || defined(SWIGRUBY)
+%rename Dep::asString "__str__";
+#endif
+
struct Dep
- {
+{
/** \name Dependency types
* These are the \em real dependency type contants to
* use. Don't mind that it's not an enum.
@@ -61,4 +65,4 @@
{}
/** The operator. */
for_use_in_switch _type;
- };
\ No newline at end of file
+};
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/swig/ItemCapKind.i new/libzypp-bindings-0.4.2/swig/ItemCapKind.i
--- old/libzypp-bindings-0.4.2/swig/ItemCapKind.i 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-bindings-0.4.2/swig/ItemCapKind.i 2007-09-17 19:09:25.000000000 +0200
@@ -0,0 +1,59 @@
+/*%{
+
+struct solver::detail::ItemCapKind
+{
+ public:
+ Capability cap; //Capability which has triggerd this selection
+ Dep capKind; //Kind of that capability
+ PoolItem_Ref item; //Item which has triggered this selection
+ bool initialInstallation; //This item has triggered the installation
+ //Not already fullfilled requierement only.
+
+ ItemCapKind( PoolItem i, Capability c, Dep k, bool initial)
+ : cap( c )
+ , capKind( k )
+ , item( i )
+ , initialInstallation( initial )
+ { }
+};
+//typedef std::listsolver::detail::ItemCapKind solver::detail::ItemCapKindList;
+%}
+*/
+
+namespace zypp
+{
+ namespace solver
+ {
+ namespace detail
+ {
+
+ struct ItemCapKind
+ {
+ public:
+ Capability cap;
+ Dep capKind;
+ PoolItem_Ref item;
+ bool initialInstallation;
+
+ /*%extend {
+ ItemCapKind(){};
+ }*/
+
+ //ItemCapKind();
+ ItemCapKind( PoolItem i, Capability c, Dep k, bool initial)
+ : cap( c )
+ , capKind( k )
+ , item( i )
+ , initialInstallation( initial )
+ { }
+ };
+ }
+ }
+}
+typedef std::listsolver::detail::ItemCapKind solver::detail::ItemCapKindList;
+%template(ItemCapKindList) std::listsolver::detail::ItemCapKind;
+
+#ifdef SWIGRUBY
+ auto_iterator(std::listsolver::detail::ItemCapKind, solver::detail::ItemCapKind);
+#endif
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/swig/KeyRing.i new/libzypp-bindings-0.4.2/swig/KeyRing.i
--- old/libzypp-bindings-0.4.2/swig/KeyRing.i 2007-08-30 17:36:55.000000000 +0200
+++ new/libzypp-bindings-0.4.2/swig/KeyRing.i 2007-09-17 19:09:25.000000000 +0200
@@ -23,5 +23,5 @@
%template(KeyRing_Ptr) intrusive_ptr<KeyRing>;
-%template(list_PublicKey) std::list<PublicKey>;
+%template(List_PublicKey) std::list<PublicKey>;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/swig/perl5/CMakeLists.txt new/libzypp-bindings-0.4.2/swig/perl5/CMakeLists.txt
--- old/libzypp-bindings-0.4.2/swig/perl5/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-bindings-0.4.2/swig/perl5/CMakeLists.txt 2007-09-17 19:09:25.000000000 +0200
@@ -0,0 +1,41 @@
+FIND_PACKAGE(Perl REQUIRED)
+
+EXECUTE_PROCESS(COMMAND ${PERL_EXECUTABLE} -e "use Config; print \$Config{cppflags}" OUTPUT_VARIABLE PERL_CXX_FLAGS)
+
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PERL_CXX_FLAGS}")
+
+EXECUTE_PROCESS(COMMAND ${PERL_EXECUTABLE} -e "use Config; print \$Config{archlibexp}" OUTPUT_VARIABLE PERL_LIB_PATH)
+SET( PERL_INS_PATH "${PERL_LIB_PATH}" )
+SET( PERL_LIB_PATH "${PERL_LIB_PATH}/CORE" )
+
+MESSAGE(STATUS "Perl executable: ${PERL_EXECUTABLE}")
+MESSAGE(STATUS "Perl cpp-flags: ${PERL_CXX_FLAGS}")
+MESSAGE(STATUS "Perl lib path: ${PERL_LIB_PATH}")
+
+SET( SWIG_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/zypp_wrap.cxx" )
+SET( SWIG_INPUT "${CMAKE_CURRENT_SOURCE_DIR}/zypp.i" )
+
+ADD_CUSTOM_COMMAND (
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/zypp_wrap.cxx
+ COMMAND ${CMAKE_COMMAND} -E echo_append "Creating wrapper code for perl..."
+ COMMAND ${SWIG_EXECUTABLE} -c++ -perl5 -xmlout ${CMAKE_CURRENT_BINARY_DIR}/parse.xml -o ${CMAKE_CURRENT_BINARY_DIR}/zypp_wrap.cxx -I${ZYPP_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../zypp.i
+ COMMAND ${CMAKE_COMMAND} -E echo "Done."
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../*.i ${CMAKE_CURRENT_SOURCE_DIR}/*.i
+)
+
+ADD_CUSTOM_TARGET( glue
+ DEPENDS ${SWIG_OUTPUT}
+)
+
+ADD_LIBRARY( zypp SHARED "${CMAKE_CURRENT_BINARY_DIR}/zypp_wrap.cxx" )
+SET_TARGET_PROPERTIES( zypp PROPERTIES PREFIX "" )
+ADD_DEPENDENCIES( zypp glue )
+
+INCLUDE_DIRECTORIES( ${PERL_LIB_PATH} )
+INCLUDE_DIRECTORIES( ${ZYPP_INCLUDE_DIR} )
+TARGET_LINK_LIBRARIES( zypp ${ZYPP_LIBRARY} )
+
+INSTALL(TARGETS zypp LIBRARY DESTINATION ${PERL_INS_PATH})
+INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/zypp.pm DESTINATION ${PERL_INS_PATH})
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/swig/perl5/perl.i new/libzypp-bindings-0.4.2/swig/perl5/perl.i
--- old/libzypp-bindings-0.4.2/swig/perl5/perl.i 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-bindings-0.4.2/swig/perl5/perl.i 2007-09-17 19:09:25.000000000 +0200
@@ -0,0 +1,49 @@
+%define iter(cls, storetype)
+%extend cls {
+ cls::const_iterator iterator_incr(cls::const_iterator *it){
+ (*it)++;
+ return *it;
+ }
+ cls::const_iterator iterator_decr(cls::const_iterator *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
+
+%define iter2(cls, storetype)
+%extend cls {
+ cls::const_iterator iterator_incr(cls::const_iterator *it){
+ (*it)++;
+ return *it;
+ }
+ cls::const_iterator iterator_decr(cls::const_iterator *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
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/swig/RepoInfo.i new/libzypp-bindings-0.4.2/swig/RepoInfo.i
--- old/libzypp-bindings-0.4.2/swig/RepoInfo.i 2007-08-30 17:36:55.000000000 +0200
+++ new/libzypp-bindings-0.4.2/swig/RepoInfo.i 2007-09-17 19:09:25.000000000 +0200
@@ -1,5 +1,7 @@
-
-%template(UrlSet) std::set<Url>;
+#ifdef SWIGPERL5
+#else
+ %template(UrlSet) std::set<Url>;
+#endif
class RepoInfo
{
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/swig/Resolver.i new/libzypp-bindings-0.4.2/swig/Resolver.i
--- old/libzypp-bindings-0.4.2/swig/Resolver.i 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-bindings-0.4.2/swig/Resolver.i 2007-09-17 19:09:25.000000000 +0200
@@ -0,0 +1,50 @@
+#ifdef SWIGPERL5
+ %template(StringList) std::liststd::string;
+#endif
+
+class Resolver
+{
+ public:
+ Resolver( const ResPool & pool);
+ virtual ~Resolver();
+ bool verifySystem ();
+ bool verifySystem (bool considerNewHardware);
+ bool establishPool (void);
+ bool freshenPool (void);
+ bool resolvePool (void);
+ bool resolvePool (bool tryAllPossibilities);
+ bool resolveDependencies( void );
+ void undo( void );
+ solver::detail::ResolverContext_Ptr context (void) const;
+ void doUpgrade( UpgradeStatistics & opt_stats_r );
+ std::list problematicUpdateItems( void ) const;
+ ResolverProblemList problems();
+ std::liststd::string problemDescription( void ) const;
+ void applySolutions( const ProblemSolutionList & solutions );
+
+ Arch architecture() const;
+ void setArchitecture( const Arch & arch);
+ void setForceResolve (const bool force);
+ const bool forceResolve();
+ void setPreferHighestVersion (const bool highestVersion);
+ const bool preferHighestVersion();
+ bool transactResObject( ResObject::constPtr robj, bool install = true);
+ //bool transactResKind( Resolvable::Kind kind );
+ void transactReset( ResStatus::TransactByValue causer );
+ void addRequire (const Capability & capability);
+ void addConflict (const Capability & capability);
+ void setTimeout( int seconds );
+ int timeout();
+ void setMaxSolverPasses (int count);
+ int maxSolverPasses ();
+ bool createSolverTestcase (const std::string & dumpPath = "/var/log/YaST2/solverTestcase");
+ const solver::detail::ItemCapKindList isInstalledBy (const PoolItem_Ref item);
+ const std::listsolver::detail::ItemCapKind installs (const PoolItem_Ref item);
+ //const solver::detail::ItemCapKindList installs (const PoolItem_Ref item);
+
+ protected:
+
+ private:
+ solver::detail::Resolver_Ptr _pimpl;
+};
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/swig/ResPool.i new/libzypp-bindings-0.4.2/swig/ResPool.i
--- old/libzypp-bindings-0.4.2/swig/ResPool.i 2007-08-30 17:36:55.000000000 +0200
+++ new/libzypp-bindings-0.4.2/swig/ResPool.i 2007-09-17 19:09:25.000000000 +0200
@@ -27,10 +27,10 @@
/** \name Iterate through all ResObjects (all kinds). */
//@{
- /**
+ #ifdef SWIGPERL5
const_iterator begin() const;
const_iterator end() const;
- */
+ #endif
//@}
public:
@@ -150,6 +150,11 @@
};
+#ifdef SWIGPERL5
+
+iter2(ResPool, PoolItem_Ref);
+
+#endif
#ifdef SWIGRUBY
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/swig/ResStatus.i new/libzypp-bindings-0.4.2/swig/ResStatus.i
--- old/libzypp-bindings-0.4.2/swig/ResStatus.i 2007-08-30 17:36:55.000000000 +0200
+++ new/libzypp-bindings-0.4.2/swig/ResStatus.i 2007-09-17 19:09:25.000000000 +0200
@@ -1,6 +1,16 @@
class ResStatus
{
+ public:
+
+ /** Default ctor. */
+ ResStatus();
+
+ /** Ctor setting the initial . */
+ ResStatus( bool isInstalled_r );
+
+ /** Dtor. */
+ ~ResStatus();
public:
/** \name BitField range definitions.
@@ -78,9 +88,9 @@
};
enum SolverStateValue
{
- NORMAL = bit::RangeValue::value, // default, notthing special
- SEEN = bit::RangeValue::value, // already seen during ResolverUpgrade
- IMPOSSIBLE = bit::RangeValue::value // impossible to install
+ NORMAL = bit::RangeValue::value, // default, notthing special
+ SEEN = bit::RangeValue::value, // already seen during ResolverUpgrade
+ IMPOSSIBLE = bit::RangeValue::value // impossible to install
};
enum LicenceConfirmedValue
@@ -92,15 +102,6 @@
public:
- /** Default ctor. */
- ResStatus();
-
- /** Ctor setting the initial . */
- ResStatus( bool isInstalled_r );
-
- /** Dtor. */
- ~ResStatus();
-
/** Debug helper returning the bitfield.
* It's save to expose the bitfield, as it can't be used to
* recreate a ResStatus. So it is not possible to bypass
@@ -369,3 +370,14 @@
private:
BitFieldType _bitfield;
};
+
+#ifdef SWIGPERL5
+
+ %extend ResStatus {
+
+ bool setToBeInstalledUser()
+ {
+ return self->setToBeInstalled(ResStatus::USER);
+ }
+ };
+#endif
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/swig/ResStore.i new/libzypp-bindings-0.4.2/swig/ResStore.i
--- old/libzypp-bindings-0.4.2/swig/ResStore.i 2007-08-30 17:36:55.000000000 +0200
+++ new/libzypp-bindings-0.4.2/swig/ResStore.i 2007-09-17 19:09:25.000000000 +0200
@@ -34,3 +34,9 @@
}
}
#endif
+
+#ifdef SWIGPERL5
+
+iter(ResStore, ResObject*);
+
+#endif
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/swig/Url.i new/libzypp-bindings-0.4.2/swig/Url.i
--- old/libzypp-bindings-0.4.2/swig/Url.i 2007-08-30 17:36:55.000000000 +0200
+++ new/libzypp-bindings-0.4.2/swig/Url.i 2007-09-17 19:09:25.000000000 +0200
@@ -1,22 +1,20 @@
-#ifdef SWIGRUBY
+#if defined(SWIGPYTHON) || defined(SWIGRUBY)
+%rename Url::asString "__str__";
+#endif
-/* new(scheme, userinfo, host, port, registry, path, opaque, query, fragment, arg_check = false) */
+class Url
+{
+public:
-%typemap(in) const Url & {
- VALUE urlstring = rb_funcall( $input, rb_intern("to_s"), 0, 0);
- Url *u = new Url( (RSTRING(urlstring)->ptr) );
- $1 = u;
-}
-
-%typemap(freearg) const Url & {
- delete $1;
-}
-
-%typemap(out) Url {
- VALUE rburlstr = rb_str_new2($1.asString().c_str());
- $result = rburlstr ;
-}
+ Url();
+ ~Url();
-#endif
+ Url(const std::string& encodedUrl);
+
+ bool isValid() const;
+
+ std::string asString() const;
+
+};
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/swig/Url.i.new new/libzypp-bindings-0.4.2/swig/Url.i.new
--- old/libzypp-bindings-0.4.2/swig/Url.i.new 1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-bindings-0.4.2/swig/Url.i.new 2007-09-17 19:09:25.000000000 +0200
@@ -0,0 +1,20 @@
+
+#if defined(SWIGPYTHON) || defined(SWIGRUBY)
+%rename Url::asString "__str__";
+#endif
+
+class Url
+{
+public:
+
+ Url();
+ ~Url();
+
+ Url(const std::string& encodedUrl);
+
+ bool isValid() const;
+
+ std::string asString() const;
+
+};
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-bindings-0.4.2/swig/zypp.i new/libzypp-bindings-0.4.2/swig/zypp.i
--- old/libzypp-bindings-0.4.2/swig/zypp.i 2007-08-30 17:36:55.000000000 +0200
+++ new/libzypp-bindings-0.4.2/swig/zypp.i 2007-09-17 19:09:25.000000000 +0200
@@ -1,11 +1,19 @@
%module zypp
+#ifdef SWIGPERL5
+%{
+ #undef NORMAL
+ #undef readdir
+ #undef Fflush
+ #undef Mkdir
+%}
+#endif
+
%{
/* Includes the header in the wrapper code */
#include "zypp/base/PtrTypes.h"
#include
#include
-#include
#include
#include
#include
@@ -15,6 +23,7 @@
#include "zypp/ResPoolManager.h"
#include "zypp/Target.h"
#include "zypp/target/TargetImpl.h"
+#include "zypp/MediaSetAccess.h"
#include "zypp/TranslatedText.h"
#include "zypp/CapFactory.h"
#include "zypp/Package.h"
@@ -23,8 +32,8 @@
#include "zypp/Repository.h"
#include "zypp/RepoManager.h"
#include "zypp/repo/RepoType.h"
-#include "zypp/MediaSetAccess.h"
#include "zypp/TmpPath.h"
+#include "zypp/Resolver.h"
using namespace boost;
using namespace zypp;
@@ -33,6 +42,7 @@
using namespace zypp::filesystem;
typedef std::set<Url> UrlSet;
+typedef std::liststd::string StringList;
%}
%rename("+") "operator+";
@@ -65,9 +75,14 @@
%include "python/python.i"
#endif
+#ifdef SWIGPERL5
+%include "std_list.i"
+%include "perl5/perl.i"
+#endif
%include "Pathname.i"
%include "Url.i"
+%include "ResStatus.i"
%include "NeedAType.i"
%include "Arch.i"
%include "ResStore.i"
@@ -97,14 +112,15 @@
%include "PublicKey.i"
%include "KeyRing.i"
%include "Target.i"
-%include "ResStatus.i"
+%include "MediaSetAccess.i"
%include "PoolItem.i"
%include "ResPool.i"
%include "ResPoolManager.i"
%include "ZYppCommitPolicy.i"
%include "ZYppCommitResult.i"
-%include "MediaSetAccess.i"
%include "TmpPath.i"
+%include "Resolver.i"
+%include "ItemCapKind.i"
class ZYpp
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org