From 5162733b07341c5e3f53ae7c6339d4f38973130e Mon Sep 17 00:00:00 2001 From: Michael Andres Date: Mon, 21 Jul 2008 14:20:29 +0000 Subject: [PATCH] backup --- libzypp-bindings.spec.cmake | 44 +++--- swig/Arch.i | 4 +- swig/Capabilities.i | 7 +- swig/Capability.i | 138 +---------------- swig/Dep.i | 2 +- swig/Edition.i | 63 ++------ swig/Pathname.i | 11 +- swig/PoolItem.i | 4 +- swig/ResObject.i | 1 - swig/ResStatus.i | 355 +------------------------------------------- swig/Resolvable.i | 34 +---- swig/Url.i | 29 ---- swig/ZYppCommitResult.i | 2 +- swig/perl5/CMakeLists.txt | 6 +- swig/python/CMakeLists.txt | 6 +- swig/ruby/CMakeLists.txt | 6 +- swig/zypp.i | 7 +- 17 files changed, 88 insertions(+), 631 deletions(-) diff --git a/libzypp-bindings.spec.cmake b/libzypp-bindings.spec.cmake index d541590..c6bd1a8 100644 --- a/libzypp-bindings.spec.cmake +++ b/libzypp-bindings.spec.cmake @@ -58,27 +58,27 @@ Group: Development/Languages/Ruby %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 -#%description -n python-zypp -#- -# -#%files -n python-zypp -#%defattr(-,root,root,-) -#%{_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 +%package -n python-zypp +Summary: Python bindings for libzypp +Group: Development/Languages/Python +%description -n python-zypp +- + +%files -n python-zypp +%defattr(-,root,root,-) +%{_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 --git a/swig/Arch.i b/swig/Arch.i index ce22358..58b3dd8 100644 --- a/swig/Arch.i +++ b/swig/Arch.i @@ -1,7 +1,7 @@ +// Ignore static versions shadowed by member functions +%ignore zypp::Arch::compare(const Arch &, const Arch &); typedef std::set > CompatSet; -%ignore Arch::compare(const Arch &, const Arch &); - %include diff --git a/swig/Capabilities.i b/swig/Capabilities.i index ace282b..83dd370 100644 --- a/swig/Capabilities.i +++ b/swig/Capabilities.i @@ -1,6 +1,8 @@ - -// I don't think this is correct: ctor and dtor are not taken into account +#if 1 +%include +#else +// I dont think this is correct: ctor and dtor are not taken into account class Capabilities { @@ -35,3 +37,4 @@ iter3(Capabilities, Capability*); #ifdef SWIGPERL5 iter2(Capabilities, Capability); #endif +#endif \ No newline at end of file diff --git a/swig/Capability.i b/swig/Capability.i index b23aa75..4d574b5 100644 --- a/swig/Capability.i +++ b/swig/Capability.i @@ -1,135 +1,12 @@ +// Ignore member functions shadowed by static versions +%ignore zypp::Capability::matches(Capability const &) const; +%ignore zypp::Capability::matches(IdString const &) const; +%ignore zypp::Capability::matches(std::string const &) const; +%ignore zypp::Capability::matches(char const *) const; - class Capability: protected sat::detail::PoolMember, - private base::SafeBool - { - public: - enum CtorFlag { PARSED, UNPARSED }; +%include - public: - /** Default ctor, \ref Empty capability. */ - Capability() : _id( sat::detail::emptyId ) {} - - /** Ctor from id. */ - explicit Capability( sat::detail::IdType id_r ) : _id( id_r ) {} - - /** Ctor from string. - * \a str_r is parsed to check whether it contains an [op edition] part, - * unless the \ref PARSED flag is passed to the ctor. - */ - explicit Capability( const char * str_r, const ResKind & prefix_r = ResKind(), CtorFlag flag_r = UNPARSED ); - /** \overload */ - explicit Capability( const std::string & str_r, const ResKind & prefix_r = ResKind(), CtorFlag flag_r = UNPARSED ); - /** \overload Convenience for parsed (name only) packages. */ - Capability( const char * str_r, CtorFlag flag_r, const ResKind & prefix_r = ResKind() ); - /** \overload */ - Capability( const std::string & str_r, CtorFlag flag_r, const ResKind & prefix_r = ResKind() ); - - /** Ctor from name op edition. */ - Capability( const std::string & name_r, const std::string & op_r, const std::string & ed_r, const ResKind & prefix_r = ResKind() ); - /** \overload */ - Capability( const std::string & name_r, Rel op_r, const std::string & ed_r, const ResKind & prefix_r = ResKind() ); - /** \overload */ - Capability( const std::string & name_r, Rel op_r, const Edition & ed_r, const ResKind & prefix_r = ResKind() ); - - public: - /** No or Null \ref Capability ( Id \c 0 ). */ - static const Capability Null; - - /** Empty Capability. */ - static const Capability Empty; - - public: - /** Evaluate in a boolean context ( ! empty() ). */ - //using base::SafeBool::operator bool_type; - - /** Whether the \ref Capability is empty. - * This is true for \ref Null and \ref Empty. - */ - bool empty() const - { return( _id == sat::detail::emptyId || _id == sat::detail::noId ); } - - public: - /** Conversion to const char * */ - const char * c_str() const; - - /** \overload */ - std::string asString() const - { return c_str(); } - - public: - /** Helper providing more detailed information about a \ref Capability. */ - CapDetail detail() const; - - public: - /** \name Match two simple capabilities. - * - * Two simple capabilities match if they have the same \c name - * and their \c edition ranges overlap. Where no edition matches - * ANY edition. \see \ref Edition::match. - * - * If a capability expression is involved, \ref matches returns - * \ref CapMatch::irrelevant. - * - * \todo check whether we must promote string to Capability in order to match. - */ - //@{ - static CapMatch matches( const Capability & lhs, const Capability & rhs ) { return _doMatch( lhs.id(), rhs.id() ); } - static CapMatch matches( const Capability & lhs, const IdString & rhs ) { return _doMatch( lhs.id(), rhs.id() ); } - static CapMatch matches( const Capability & lhs, const std::string & rhs ) { return _doMatch( lhs.id(), Capability(rhs).id() ); } - static CapMatch matches( const Capability & lhs, const char * rhs ) { return _doMatch( lhs.id(), Capability(rhs).id() );} - - static CapMatch matches( const IdString & lhs, const Capability & rhs ) { return _doMatch( lhs.id(), rhs.id() ); } - static CapMatch matches( const IdString & lhs, const IdString & rhs ) { return _doMatch( lhs.id(), rhs.id() ); } - static CapMatch matches( const IdString & lhs, const std::string & rhs ) { return _doMatch( lhs.id(), Capability(rhs).id() ); } - static CapMatch matches( const IdString & lhs, const char * rhs ) { return _doMatch( lhs.id(), Capability(rhs).id() ); } - - static CapMatch matches( const std::string & lhs, const Capability & rhs ) { return _doMatch( Capability(lhs).id(), rhs.id() );} - static CapMatch matches( const std::string & lhs, const IdString & rhs ) { return _doMatch( Capability(lhs).id(), rhs.id() ); } - static CapMatch matches( const std::string & lhs, const std::string & rhs ) { return _doMatch( Capability(lhs).id(), Capability(rhs).id() ); } - static CapMatch matches( const std::string & lhs, const char * rhs ) { return _doMatch( Capability(lhs).id(), Capability(rhs).id() ); } - - static CapMatch matches( const char * lhs, const Capability & rhs ) { return _doMatch( Capability(lhs).id(), rhs.id() );} - static CapMatch matches( const char * lhs, const IdString & rhs ) { return _doMatch( Capability(lhs).id(), rhs.id() ); } - static CapMatch matches( const char * lhs, const std::string & rhs ) { return _doMatch( Capability(lhs).id(), Capability(rhs).id() ); } - static CapMatch matches( const char * lhs, const char * rhs ) { return _doMatch( Capability(lhs).id(), Capability(rhs).id() ); } - - CapMatch matches( const Capability & rhs ) const { return _doMatch( id(), rhs.id() ); } - CapMatch matches( const IdString & rhs ) const { return _doMatch( id(), rhs.id() ); } - CapMatch matches( const std::string & rhs ) const { return _doMatch( id(), Capability(rhs).id() ); } - CapMatch matches( const char * rhs ) const { return _doMatch( id(), Capability(rhs).id() ); } - //@} - - /** \ref matches functor. - */ - struct Matches: public std::binary_function - { - CapMatch operator()( const Capability & lhs, const Capability & rhs ) const - { return Capability::matches( lhs, rhs ); } - }; - - public: - /** Test for a filename that is likely being REQUIRED. - * Files below \c /bin , \c /sbin , \c /lib etc. Scanning a - * packages filelist, an \e interesting filename might be worth - * being remembered in PROVIDES. - */ - static bool isInterestingFileSpec( const IdString & name_r ) { return isInterestingFileSpec( name_r.c_str() ); } - static bool isInterestingFileSpec( const std::string & name_r ) { return isInterestingFileSpec( name_r.c_str() ); } - static bool isInterestingFileSpec( const char * name_r ); - - public: - /** Expert backdoor. */ - sat::detail::IdType id() const - { return _id; } - private: - /** Match two Capabilities */ - static CapMatch _doMatch( sat::detail::IdType lhs, sat::detail::IdType rhs ); - private: - }; - - - -%extend Capability +%extend zypp::Capability { int __cmp__(const Capability& other) { @@ -142,3 +19,4 @@ } } + diff --git a/swig/Dep.i b/swig/Dep.i index 533021c..9fce196 100644 --- a/swig/Dep.i +++ b/swig/Dep.i @@ -1,3 +1,3 @@ %nodefault Dep; -%include "zypp/Dep.h" \ No newline at end of file +%include "zypp/Dep.h" diff --git a/swig/Edition.i b/swig/Edition.i index 2530aff..74e8c40 100644 --- a/swig/Edition.i +++ b/swig/Edition.i @@ -1,52 +1,15 @@ +// Ignore member functions shadowed by static versions +%ignore zypp::Edition::match(Edition const &) const; +%ignore zypp::Edition::match(IdString const &) const; +%ignore zypp::Edition::match(std::string const &) const; +%ignore zypp::Edition::match(char const *) const; + +// ma@: Why do we need this? +//namespace zypp +//{ +// %rename Edition::compare(const Edition& lhs, const Edition& rhs) compare2; +// %rename Edition::match(const Edition& lhs, const Edition& rhs) match2; +//} -// example for including the original header file - -#if 1 - -namespace zypp -{ - %rename Edition::compare(const Edition& lhs, const Edition& rhs) compare2; - %rename Edition::match(const Edition& lhs, const Edition& rhs) match2; -} - -// TODO: tell make about dependencies %include - -#else - -namespace zypp -{ - class Edition - { - public: - typedef unsigned epoch_t; - static const epoch_t noepoch = 0; - static const Edition noedition; - public: - Edition(); - Edition( const std::string & edition_r ); - Edition( const std::string & version_r, - const std::string & release_r, - epoch_t epoch_r = noepoch ); - Edition( const std::string & version_r, - const std::string & release_r, - const std::string & epoch_r ); - ~Edition(); - public: - epoch_t epoch() const; - const std::string & version() const; - const std::string & release() const; - std::string asString() const; - public: - static int compare( const Edition & lhs, const Edition & rhs ); - int compare( const Edition & rhs ) const; - typedef Compare Compare; - typedef Range CompareRange; - public: - static int match( const Edition & lhs, const Edition & rhs ); - int match( const Edition & rhs ) const; - }; - -} - -#endif +%ignore zypp::Edition::match(Edition const &); \ No newline at end of file diff --git a/swig/Pathname.i b/swig/Pathname.i index cfb1488..4478149 100644 --- a/swig/Pathname.i +++ b/swig/Pathname.i @@ -1 +1,10 @@ -%include \ No newline at end of file +// Ignore static versions shadowed by member functions +%ignore zypp::filesystem::Pathname::dirname(Pathname const &); +%ignore zypp::filesystem::Pathname::basename(Pathname const &); +%ignore zypp::filesystem::Pathname::extension(Pathname const &); +%ignore zypp::filesystem::Pathname::absolutename(Pathname const &); +%ignore zypp::filesystem::Pathname::relativename(Pathname const &); +%ignore zypp::filesystem::Pathname::cat(Pathname const &,Pathname const &); +%ignore zypp::filesystem::Pathname::extend(Pathname const &,std::string const &); + +%include diff --git a/swig/PoolItem.i b/swig/PoolItem.i index 3877b29..7377ea5 100644 --- a/swig/PoolItem.i +++ b/swig/PoolItem.i @@ -1,8 +1,8 @@ %include -typedef PoolItem PoolItem; +//typedef PoolItem PoolItem; -%extend PoolItem +%extend zypp::PoolItem { std::string asString() const { diff --git a/swig/ResObject.i b/swig/ResObject.i index 669824c..8a7db5a 100644 --- a/swig/ResObject.i +++ b/swig/ResObject.i @@ -1,7 +1,6 @@ %include - %extend intrusive_ptr { int __cmp__(intrusive_ptr& other) diff --git a/swig/ResStatus.i b/swig/ResStatus.i index de546fd..73510c8 100644 --- a/swig/ResStatus.i +++ b/swig/ResStatus.i @@ -1,358 +1,5 @@ -class ResStatus -{ - public: - - /** Default ctor. */ - ResStatus(); - - /** Ctor setting the initial . */ - ResStatus( bool isInstalled_r ); - - /** Dtor. */ - ~ResStatus(); - - public: - /** \name BitField range definitions. - * - * \note Enlarge FieldType if more bit's needed. It's not yet - * checked by the compiler. - */ - //@{ - typedef uint16_t FieldType; - typedef bit::BitField BitFieldType; - // Bit Ranges within FieldType defined by 1st bit and size: - typedef bit::Range StateField; - typedef bit::Range ValidateField; - typedef bit::Range TransactField; - typedef bit::Range TransactByField; - typedef bit::Range TransactDetailField; - typedef bit::Range SolverStateField; - typedef bit::Range LicenceConfirmedField; - typedef bit::Range WeakField; - - // enlarge FieldType if more bit's needed. It's not yet - // checked by the compiler. - //@} - public: - - /** \name Status values. - * - * Each enum corresponds to a BitField range. - * \note Take care that enumerator values actually fit into - * the corresponding field. It's not yet checked by the compiler. - */ - //@{ - enum StateValue - { - UNINSTALLED = bit::RangeValue::value, - INSTALLED = bit::RangeValue::value - }; - enum ValidateValue - { - UNDETERMINED = bit::RangeValue::value, - BROKEN = bit::RangeValue::value, - SATISFIED = bit::RangeValue::value, - NONRELEVANT = bit::RangeValue::value - }; - enum TransactValue - { - KEEP_STATE = bit::RangeValue::value, - LOCKED = bit::RangeValue::value, // locked, must not transact - TRANSACT = bit::RangeValue::value // transact according to state - }; - enum TransactByValue - { - SOLVER = bit::RangeValue::value, - APPL_LOW = bit::RangeValue::value, - APPL_HIGH = bit::RangeValue::value, - USER = bit::RangeValue::value - }; - - enum DetailValue - { - /** Detail for no transact, i.e. reset any Install/RemoveDetailValue. */ - NO_DETAIL = bit::RangeValue::value, - }; - - enum InstallDetailValue - { - EXPLICIT_INSTALL = bit::RangeValue::value, - SOFT_INSTALL = bit::RangeValue::value - }; - enum RemoveDetailValue - { - EXPLICIT_REMOVE = bit::RangeValue::value, - SOFT_REMOVE = bit::RangeValue::value, - DUE_TO_OBSOLETE = bit::RangeValue::value, - DUE_TO_UPGRADE = bit::RangeValue::value - }; - enum SolverStateValue - { - NORMAL = bit::RangeValue::value, // default, notthing special - SEEN = bit::RangeValue::value // already seen during ResolverUpgrade - }; - - enum LicenceConfirmedValue - { - LICENCE_UNCONFIRMED = bit::RangeValue::value, - LICENCE_CONFIRMED = bit::RangeValue::value - }; - - enum WeakValue - { - NO_WEAK = bit::RangeValue::value, - SUGGESTED = bit::RangeValue::value, - RECOMMENDED = bit::RangeValue::value, - SUGGESTED_AND_RECOMMENDED = bit::RangeValue::value - }; - - //@} - - public: - - /** 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 - * transition rules. - */ - BitFieldType bitfield() const - { return _bitfield; } - - public: - - bool isLicenceConfirmed() const - { return fieldValueIs( LICENCE_CONFIRMED ); } - - void setLicenceConfirmed( bool toVal_r = true ) - { fieldValueAssign( toVal_r ? LICENCE_CONFIRMED : LICENCE_UNCONFIRMED ); } - - public: - // These two are IMMUTABLE! - - bool isInstalled() const - { return fieldValueIs( INSTALLED ); } - - bool isUninstalled() const - { return fieldValueIs( UNINSTALLED ); } - - public: - - bool staysInstalled() const - { return isInstalled() && !transacts(); } - - bool wasInstalled() const { return staysInstalled(); } //for old status - - bool isToBeInstalled() const - { return isUninstalled() && transacts(); } - - bool staysUninstalled() const - { return isUninstalled() && !transacts(); } - - bool wasUninstalled() const { return staysUninstalled(); } // for old status - - bool isToBeUninstalled() const - { return isInstalled() && transacts(); } - - bool isLocked() const - { return fieldValueIs( LOCKED ); } - - bool isKept() const - { return fieldValueIs( KEEP_STATE ); } - - bool isUndetermined() const - { return fieldValueIs( UNDETERMINED ); } - - ValidateValue validate() const - { return (ValidateValue)_bitfield.value(); } - - bool isSatisfied() const - { return fieldValueIs( SATISFIED ); } - - bool isBroken() const - { return fieldValueIs( BROKEN ); } - - bool isNonRelevant() const - { return fieldValueIs( NONRELEVANT ); } - - bool transacts() const - { return fieldValueIs( TRANSACT ); } - - TransactValue getTransactValue() const - { return (TransactValue)_bitfield.value(); } - - bool isBySolver() const - { return fieldValueIs( SOLVER ); } - - bool isByApplLow() const - { return fieldValueIs( APPL_LOW ); } - - bool isByApplHigh() const - { return fieldValueIs( APPL_HIGH ); } - - bool isByUser() const - { return fieldValueIs( USER ); } - - TransactByValue getTransactByValue() const - { return (TransactByValue)_bitfield.value(); } - - bool isToBeUninstalledDueToObsolete () const - { return isToBeUninstalled() && fieldValueIs( DUE_TO_OBSOLETE ); } - - bool isToBeUninstalledDueToUpgrade() const - { return isToBeUninstalled() && fieldValueIs( DUE_TO_UPGRADE ); } - - bool isToBeInstalledSoft () const - { return isToBeInstalled() && fieldValueIs( SOFT_INSTALL ); } - - bool isToBeInstalledNotSoft () const - { return isToBeInstalled() && !fieldValueIs( SOFT_INSTALL ); } - - - bool isToBeUninstalledSoft () const - { return isToBeUninstalled() && fieldValueIs( SOFT_REMOVE ); } - - public: - - bool setTransactValue( TransactValue newVal_r, TransactByValue causer_r ); - bool setLock( bool toLock_r, TransactByValue causer_r ); - bool maySetLock( bool to_r, TransactByValue causer_r ); - bool setTransact( bool toTansact_r, TransactByValue causer_r ); - bool maySetTransact( bool val_r, TransactByValue causer ); - bool setSoftLock( TransactByValue causer_r ); - bool resetTransact( TransactByValue causer_r ); - bool setSoftTransact( bool toTansact_r, TransactByValue causer_r, - TransactByValue causerLimit_r ); - bool setSoftTransact( bool toTansact_r, TransactByValue causer_r ); - bool maySetSoftTransact( bool val_r, TransactByValue causer, - TransactByValue causerLimit_r ); - bool maySetSoftTransact( bool val_r, TransactByValue causer ); - bool setToBeInstalled (TransactByValue causer); - bool maySetToBeInstalled (TransactByValue causer); - bool setToBeUninstalled (TransactByValue causer); - bool maySetToBeUninstalled (TransactByValue causer); - bool setToBeUninstalledDueToObsolete ( ); - bool setToBeUninstalledDueToUpgrade ( TransactByValue causer ); - bool setToBeInstalledSoft ( ); - bool setToBeUninstalledSoft ( ); - bool maySetToBeUninstalledSoft (); - bool isSoftInstall () { - return fieldValueIs (SOFT_INSTALL); - } - - bool isSoftUninstall () { - return fieldValueIs (SOFT_REMOVE); - } - - bool setSoftInstall (bool flag) { - fieldValueAssign(flag?SOFT_INSTALL:0); - return true; - } - - bool setSoftUninstall (bool flag) { - fieldValueAssign(flag?SOFT_REMOVE:0); - return true; - } - - bool setUndetermined () - { - fieldValueAssign(UNDETERMINED); - return true; - } - - bool setSatisfied () - { - fieldValueAssign(SATISFIED); - return true; - } - - bool setBroken () - { - fieldValueAssign(BROKEN); - return true; - } - - bool setNonRelevant () - { - fieldValueAssign(NONRELEVANT); - return true; - } - - bool isSeen () const - { return fieldValueIs( SEEN ); } - - bool setSeen (bool value) - { - fieldValueAssign( value ? SEEN : NORMAL ); - return true; - } - - bool setStatus( ResStatus newStatus_r ) - { - // State field is immutable! - if ( _bitfield.value() != newStatus_r._bitfield.value() ) - return false; - // Transaction state change allowed? - if ( ! setTransactValue( newStatus_r.getTransactValue(), newStatus_r.getTransactByValue() ) ) - return false; - - // Ok, we take it all.. - _bitfield = newStatus_r._bitfield; - return true; - } - - /** \name Builtin ResStatus constants. */ - //@{ - static const ResStatus toBeInstalled; - static const ResStatus toBeInstalledSoft; - static const ResStatus toBeUninstalled; - static const ResStatus toBeUninstalledSoft; - static const ResStatus toBeUninstalledDueToUnlink; - static const ResStatus toBeUninstalledDueToObsolete; - static const ResStatus toBeUninstalledDueToUpgrade; - static const ResStatus installed; // installed, status after successful target 'install' commit - static const ResStatus uninstalled; // uninstalled, status after successful target 'uninstall' commit - static const ResStatus satisfied; // uninstalled, satisfied - static const ResStatus complete; // installed, satisfied - static const ResStatus unneeded; // uninstalled, unneeded - static const ResStatus needed; // uninstalled, incomplete - static const ResStatus incomplete; // installed, incomplete - //@} - - private: - /** Ctor for intialization of builtin constants. */ - ResStatus( StateValue s, - ValidateValue v = UNDETERMINED, - TransactValue t = KEEP_STATE, - InstallDetailValue i = EXPLICIT_INSTALL, - RemoveDetailValue r = EXPLICIT_REMOVE, - SolverStateValue ssv = NORMAL ); - - /** Return whether the corresponding Field has value \a val_r. - */ - template - bool fieldValueIs( FieldType val_r ) const - { return _bitfield.isEqual<_Field>( val_r ); } - - /** Set the corresponding Field to value \a val_r. - */ - template - void fieldValueAssign( FieldType val_r ) - { _bitfield.assign<_Field>( val_r ); } - - /** compare two values. - */ - template - bool isGreaterThan( FieldType val_r ) - { return _bitfield.value<_Field>() > val_r; } - - template - bool isLessThan( FieldType val_r ) - { return _bitfield.value<_Field>() < val_r; } - - private: - BitFieldType _bitfield; -}; +%include #ifdef SWIGPERL5 diff --git a/swig/Resolvable.i b/swig/Resolvable.i index 2fb9c1f..155cf20 100644 --- a/swig/Resolvable.i +++ b/swig/Resolvable.i @@ -1,34 +1,4 @@ -class Resolvable : protected sat::Solvable, - public base::ReferenceCounted, private base::NonCopyable - { - friend std::ostream & operator<<( std::ostream & str, const Resolvable & obj ); - public: - typedef Resolvable Self; - typedef ResTraits TraitsType; - typedef TraitsType::KindType Kind; - typedef TraitsType::PtrType Ptr; - typedef TraitsType::constPtrType constPtr; +%import +%include - public: - /** Whether this represents a valid- or no-solvable. */ - - /** \name Dependencies. */ - //@{ - /** Select by Dep. */ - //Capabilities dep( Dep which_r ) const - //{ return operator[]( which_r ); } - - //@} - - public: - const sat::Solvable & satSolvable() const { return *this; } - - protected: - /** Ctor */ - Resolvable( const sat::Solvable & solvable_r ); - /** Dtor */ - virtual ~Resolvable(); - /** Helper for stream output */ - virtual std::ostream & dumpOn( std::ostream & str ) const; - }; \ No newline at end of file diff --git a/swig/Url.i b/swig/Url.i index 2885915..e3a65b3 100644 --- a/swig/Url.i +++ b/swig/Url.i @@ -1,30 +1 @@ - -// example for including the original header file - -#if 1 - -// TODO: tell make about dependencies %include - -#else - -namespace zypp -{ - class Url - { - public: - - Url(); - ~Url(); - - Url(const Url &url); - Url(const std::string &encodedUrl); - - bool isValid() const; - - std::string asString() const; - - }; -} - -#endif diff --git a/swig/ZYppCommitResult.i b/swig/ZYppCommitResult.i index 8885124..ef5cae4 100644 --- a/swig/ZYppCommitResult.i +++ b/swig/ZYppCommitResult.i @@ -1,6 +1,6 @@ %include -%extend ZYppCommitResult +%extend zypp::ZYppCommitResult { std::string asString() const { diff --git a/swig/perl5/CMakeLists.txt b/swig/perl5/CMakeLists.txt index ec8815d..9a3046d 100644 --- a/swig/perl5/CMakeLists.txt +++ b/swig/perl5/CMakeLists.txt @@ -32,7 +32,11 @@ ADD_CUSTOM_TARGET( ${WRAP}_glue ) ADD_LIBRARY( ${WRAP}_zypp SHARED "${CMAKE_CURRENT_BINARY_DIR}/zypp_wrap.cxx" ) -SET_TARGET_PROPERTIES( ${WRAP}_zypp PROPERTIES PREFIX "" ) +SET_TARGET_PROPERTIES( ${WRAP}_zypp + PROPERTIES + PREFIX "" + OUTPUT_NAME zypp +) ADD_DEPENDENCIES( ${WRAP}_zypp ${WRAP}_glue ) INCLUDE_DIRECTORIES( ${PERL_LIB_PATH} ) diff --git a/swig/python/CMakeLists.txt b/swig/python/CMakeLists.txt index 25fe7f7..b0c52c2 100644 --- a/swig/python/CMakeLists.txt +++ b/swig/python/CMakeLists.txt @@ -29,7 +29,11 @@ ADD_CUSTOM_TARGET( ${WRAP}_glue ) ADD_LIBRARY( ${WRAP}_zypp SHARED "${CMAKE_CURRENT_BINARY_DIR}/zypp_wrap.cxx" ) -SET_TARGET_PROPERTIES( ${WRAP}_zypp PROPERTIES PREFIX "" ) +SET_TARGET_PROPERTIES( ${WRAP}_zypp + PROPERTIES + PREFIX "" + OUTPUT_NAME _zypp +) ADD_DEPENDENCIES( ${WRAP}_zypp ${WRAP}_glue ) INCLUDE_DIRECTORIES( ${PYTHON_INCLUDE_PATH} ) diff --git a/swig/ruby/CMakeLists.txt b/swig/ruby/CMakeLists.txt index b58bc63..ad45601 100644 --- a/swig/ruby/CMakeLists.txt +++ b/swig/ruby/CMakeLists.txt @@ -28,7 +28,11 @@ ADD_CUSTOM_TARGET( ${WRAP}_glue ) ADD_LIBRARY( ${WRAP}_zypp SHARED "${CMAKE_CURRENT_BINARY_DIR}/zypp_wrap.cxx" ) -SET_TARGET_PROPERTIES( ${WRAP}_zypp PROPERTIES PREFIX "" ) +SET_TARGET_PROPERTIES(${WRAP}_zypp + PROPERTIES + PREFIX "" + OUTPUT_NAME zypp +) ADD_DEPENDENCIES( ${WRAP}_zypp ${WRAP}_glue ) INCLUDE_DIRECTORIES( ${RUBY_INCLUDE_PATH} ) diff --git a/swig/zypp.i b/swig/zypp.i index e98b485..81fbb2a 100644 --- a/swig/zypp.i +++ b/swig/zypp.i @@ -66,13 +66,18 @@ typedef std::list StringList; %rename("!") "operator!"; %rename("==") "operator=="; - template < typename T > class intrusive_ptr { public: T *operator->(); }; +namespace zypp { + namespace base { + // silence 'Nothing known about class..' warning + class ReferenceCounted {}; + } +} %include "std_string.i" %include "stl.i" -- 2.7.4