Author: dmacvicar
Date: Sat Feb 16 15:56:58 2008
New Revision: 8764
URL: http://svn.opensuse.org/viewcvs/zypp?rev=8764&view=rev
Log:
- ruby bindings compile, but python makes swig go nuts...
Added:
trunk/libzypp-bindings/swig/Capabilities.i
- copied, changed from r8763, trunk/libzypp-bindings/swig/CapSet.i
Removed:
trunk/libzypp-bindings/swig/CapFactory.i
trunk/libzypp-bindings/swig/CapSet.i
trunk/libzypp-bindings/swig/ItemCapKind.i
trunk/libzypp-bindings/swig/Language.i
trunk/libzypp-bindings/swig/NVR.i
trunk/libzypp-bindings/swig/NVRA.i
trunk/libzypp-bindings/swig/NVRAD.i
trunk/libzypp-bindings/swig/ResPoolManager.i
trunk/libzypp-bindings/swig/ResStore.i
Modified:
trunk/libzypp-bindings/swig/Arch.i
trunk/libzypp-bindings/swig/Capability.i
trunk/libzypp-bindings/swig/CheckSum.i
trunk/libzypp-bindings/swig/Dep.i
trunk/libzypp-bindings/swig/Dependencies.i
trunk/libzypp-bindings/swig/KeyRing.i
trunk/libzypp-bindings/swig/MediaSetAccess.i
trunk/libzypp-bindings/swig/Message.i
trunk/libzypp-bindings/swig/OnMediaLocation.i
trunk/libzypp-bindings/swig/Package.i
trunk/libzypp-bindings/swig/Patch.i
trunk/libzypp-bindings/swig/Pathname.i
trunk/libzypp-bindings/swig/Pattern.i
trunk/libzypp-bindings/swig/PoolItem.i
trunk/libzypp-bindings/swig/Product.i
trunk/libzypp-bindings/swig/PublicKey.i
trunk/libzypp-bindings/swig/RepoInfo.i
trunk/libzypp-bindings/swig/RepoManager.i
trunk/libzypp-bindings/swig/RepoStatus.i
trunk/libzypp-bindings/swig/RepoType.i
trunk/libzypp-bindings/swig/Repository.i
trunk/libzypp-bindings/swig/ResObject.i
trunk/libzypp-bindings/swig/ResPool.i
trunk/libzypp-bindings/swig/ResTraits.i
trunk/libzypp-bindings/swig/Resolvable.i
trunk/libzypp-bindings/swig/Resolver.i
trunk/libzypp-bindings/swig/Script.i
trunk/libzypp-bindings/swig/SrcPackage.i
trunk/libzypp-bindings/swig/Target.i
trunk/libzypp-bindings/swig/TranslatedText.i
trunk/libzypp-bindings/swig/ZYppCommitPolicy.i
trunk/libzypp-bindings/swig/ZYppCommitResult.i
trunk/libzypp-bindings/swig/ZYppFactory.i
trunk/libzypp-bindings/swig/perl5/CMakeLists.txt
trunk/libzypp-bindings/swig/python/CMakeLists.txt
trunk/libzypp-bindings/swig/ruby/CMakeLists.txt
trunk/libzypp-bindings/swig/zypp.i
Modified: trunk/libzypp-bindings/swig/Arch.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Arch.i?rev=8764&r1=8763&r2=8764&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/Arch.i (original)
+++ trunk/libzypp-bindings/swig/Arch.i Sat Feb 16 15:56:58 2008
@@ -3,33 +3,5 @@
%ignore Arch::compare(const Arch &, const Arch &);
-class Arch
-{
-public:
- //Arch();
- Arch( const std::string & rhs );
- const std::string & asString() const;
- bool empty() const;
- bool compatibleWith( const Arch & targetArch_r ) const;
- int compare( const Arch & rhs ) const;
- static int compare( const Arch & lhs, const Arch & rhs );
- //static std::string asString( const CompatSet & cset );
- struct CompatEntry;
-private:
- Arch( const CompatEntry & );
- const CompatEntry * _entry;
-};
-
-extern const Arch Arch_noarch;
-extern const Arch Arch_x86_64;
-extern const Arch Arch_athlon;
-extern const Arch Arch_i686;
-extern const Arch Arch_i586;
-extern const Arch Arch_i486;
-extern const Arch Arch_i386;
-extern const Arch Arch_s390x;
-extern const Arch Arch_s390;
-extern const Arch Arch_ppc64;
-extern const Arch Arch_ppc;
-extern const Arch Arch_ia64;
+%include
Copied: trunk/libzypp-bindings/swig/Capabilities.i (from r8763, trunk/libzypp-bindings/swig/CapSet.i)
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Capabilities.i?p2=trunk/libzypp-bindings/swig/Capabilities.i&p1=trunk/libzypp-bindings/swig/CapSet.i&r1=8763&r2=8764&rev=8764&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/CapSet.i (original)
+++ trunk/libzypp-bindings/swig/Capabilities.i Sat Feb 16 15:56:58 2008
@@ -1,31 +1,31 @@
// I don't think this is correct: ctor and dtor are not taken into account
-class CapSet
+class Capabilities
{
};
#ifdef SWIGRUBY
-iter3(CapSet, Capability*);
+iter3(Capabilities, Capability*);
#endif
// The ruby std_set.i can only handle one template parameter
// #ifdef SWIGPYTHON
-// %template(CapSetTemp) std::set;
-// typedef std::set CapSetTemp;
+// %template(CapabilitiesTemp) std::set;
+// typedef std::set CapabilitiesTemp;
// #endif
#ifdef SWIGPYTHON
-%extend CapSet
+%extend Capabilities
{
// just a test
const Capability* haha()
{
- CapSet::iterator i = self->begin();
+ Capabilities::iterator i = self->begin();
const Capability* tmp = &*i;
return tmp;
}
@@ -33,5 +33,5 @@
#endif
#ifdef SWIGPERL5
-iter2(CapSet, Capability);
+iter2(Capabilities, Capability);
#endif
Modified: trunk/libzypp-bindings/swig/Capability.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Capability.i?rev=8764&r1=8763&r2=8764&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/Capability.i (original)
+++ trunk/libzypp-bindings/swig/Capability.i Sat Feb 16 15:56:58 2008
@@ -1,80 +1,136 @@
-class Capability
-{
- public:
- /** */
- typedef capability::CapabilityTraits::KindType Kind;
-
- public:
- /** DefaultCtor creating \ref noCap. */
- Capability();
-
- /** Dtor */
- virtual ~Capability();
-
- /** Constant representing no Capabiliy.
- * It refers to no kind of Resolvable, and matches returns
- * returns \c CapMatch::irrelevant.
- */
- static const Capability noCap;
-
- public:
- /** Kind of Capability. */
- const Kind & kind() const;
-
- /** Kind of Resolvable the Capability refers to. */
- const Resolvable::Kind & refers() const;
-
- /** Whether to consider this Capability.
- * Evaluates the Capabilities pre-condition (if any), and
- * returns whether the condition applies. If not, the Capability
- * is to be ignored.
- */
- bool relevant() const;
-
- /** Return whether the Capabilities match.
- * If either Capability is not \ref relevant, CapMatch::irrelevant
- * is returned.
- */
- CapMatch matches( const Capability & rhs ) const;
-
- /** More or less human readable representation as string. */
- std::string asString() const;
-
- /** accessors needed by solver/zmd */
- /** Deprecated */
- std::string index() const;
-
- private:
- typedef capability::CapabilityImpl Impl;
- typedef capability::CapabilityImpl_Ptr Impl_Ptr ;
- typedef capability::CapabilityImpl_constPtr Impl_constPtr;
-
- /** Factory */
- friend class CapFactory;
-
- /** Factory ctor */
- explicit
- Capability( Impl_Ptr impl_r );
-
- private:
- /** */
- friend class capability::CapabilityImpl;
- /** Pointer to implementation */
- RW_pointer _pimpl;
-};
-
-template<class _Cap>
-inline bool isKind( const Capability & cap )
-{ return cap.kind() == capability::CapTraits<_Cap>::kind; }
-
+ class Capability: protected sat::detail::PoolMember,
+ private base::SafeBool<Capability>
+ {
+ public:
+ // legacy
+ std::string index() const ZYPP_DEPRECATED;
+
+ public:
+ enum CtorFlag { PARSED, UNPARSED };
+
+ 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 <tt>[op edition]</tt> 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 <tt>name op edition</tt>. */
+ 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 <tt>( ! empty() )</tt>. */
+ //using base::SafeBool<Capability>::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 <tt>const char *</tt> */
+ 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:
+ };
-/** Ordering relation used by ::CapSet. */
-struct CapOrder : public std::binary_function
-{
- bool operator()( const Capability & lhs, const Capability & rhs ) const
- { return lhs._pimpl.get() < rhs._pimpl.get(); }
-};
%extend Capability
Modified: trunk/libzypp-bindings/swig/CheckSum.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/CheckSum.i?rev=8764&r1=8763&r2=8764&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/CheckSum.i (original)
+++ trunk/libzypp-bindings/swig/CheckSum.i Sat Feb 16 15:56:58 2008
@@ -1,45 +1,2 @@
+%include
-class CheckSum
- {
- public:
- /**
- * Creates a checksum for algorithm \param type
- * \throws if the checksum is invalid and can't be constructed
- */
- CheckSum( const std::string & type, const std::string & checksum);
- CheckSum( const std::string & type, std::istream & input_r );
- CheckSum();
-
- public:
- static const std::string & md5Type();
- static const std::string & shaType();
- static const std::string & sha1Type();
- static const std::string & sha256Type();
-
- static CheckSum md5( const std::string & checksum )
- { return CheckSum( md5Type(), checksum); }
- static CheckSum sha( const std::string & checksum )
- { return CheckSum( shaType(), checksum); }
- static CheckSum sha1( const std::string & checksum )
- { return CheckSum( sha1Type(), checksum); }
- static CheckSum sha256( const std::string & checksum )
- { return CheckSum( sha256Type(), checksum); }
-
- static CheckSum md5( std::istream & input_r )
- { return CheckSum( md5Type(), input_r ); }
- static CheckSum sha( std::istream & input_r )
- { return CheckSum( sha1Type(), input_r ); }
- static CheckSum sha1( std::istream & input_r )
- { return CheckSum( sha1Type(), input_r ); }
- static CheckSum sha256( std::istream & input_r )
- { return CheckSum( sha256Type(), input_r ); }
-
- public:
- std::string type() const;
- std::string checksum() const;
- bool empty() const;
-
- private:
- std::string _type;
- std::string _checksum;
- };
\ No newline at end of file
Modified: trunk/libzypp-bindings/swig/Dep.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Dep.i?rev=8764&r1=8763&r2=8764&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/Dep.i (original)
+++ trunk/libzypp-bindings/swig/Dep.i Sat Feb 16 15:56:58 2008
@@ -1,64 +1,3 @@
-struct Dep
-{
- /** \name Dependency types
- * These are the \em real dependency type contants to
- * use. Don't mind that it's not an enum.
- * \see \ref zypp::Dep::inSwitch
- */
- //@{
- static const Dep PROVIDES;
- static const Dep PREREQUIRES;
- static const Dep REQUIRES;
- static const Dep CONFLICTS;
- static const Dep OBSOLETES;
- static const Dep RECOMMENDS;
- static const Dep SUGGESTS;
- static const Dep FRESHENS;
- static const Dep ENHANCES;
- static const Dep SUPPLEMENTS;
- //@}
-
- /** Enumarators provided \b only for use \ref inSwitch statement.
- * \see inSwitch
- */
- enum for_use_in_switch {
- PROVIDES_e,
- PREREQUIRES_e,
- REQUIRES_e,
- CONFLICTS_e,
- OBSOLETES_e,
- RECOMMENDS_e,
- SUGGESTS_e,
- FRESHENS_e,
- ENHANCES_e,
- SUPPLEMENTS_e,
- };
-
- /** Ctor from string.
- * Legal values for \a strval_r are the constants names
- * (case insignificant).
- *
- * \throw PARSE if \a strval_r is not legal.
- * \todo refine exceptions and check throw.
- */
- explicit
- Dep( const std::string & strval_r );
-
- /** String representation of dependency type.
- * \return The constants names lowercased.
- */
- const std::string & asString() const;
-
- /** Enumarator provided for use in \c switch statement. */
- for_use_in_switch inSwitch() const
- { return _type; }
-
- private:
- /** Ctor to initialize the dependency type contants. */
- Dep( for_use_in_switch type_r )
- : _type( type_r )
- {}
- /** The operator. */
- for_use_in_switch _type;
-};
+%nodefault Dep;
+%include "zypp/Dep.h"
\ No newline at end of file
Modified: trunk/libzypp-bindings/swig/Dependencies.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Dependencies.i?rev=8764&r1=8763&r2=8764&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/Dependencies.i (original)
+++ trunk/libzypp-bindings/swig/Dependencies.i Sat Feb 16 15:56:58 2008
@@ -3,10 +3,10 @@
struct Dependencies
{
- CapSet & operator[]( Dep idx_r )
+ Capabilities & operator[]( Dep idx_r )
{ return _capsets[idx_r]; }
- const CapSet & operator[]( Dep idx_r ) const
- { return const_cast&>(_capsets)[idx_r]; }
+ const Capabilities & operator[]( Dep idx_r ) const
+ { return const_cast&>(_capsets)[idx_r]; }
};
Modified: trunk/libzypp-bindings/swig/KeyRing.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/KeyRing.i?rev=8764&r1=8763&r2=8764&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/KeyRing.i (original)
+++ trunk/libzypp-bindings/swig/KeyRing.i Sat Feb 16 15:56:58 2008
@@ -1,25 +1,11 @@
typedef intrusive_ptr<KeyRing> KeyRing_Ptr;
-class KeyRing
-{
+%ignore KeyRingReport;
+%ignore KeyRingSignals;
-public:
- KeyRing(const zypp::Pathname& baseTmpDir);
- ~KeyRing();
-
- void importKey(const PublicKey& key, bool trusted = false);
-
- bool isKeyTrusted(const std::string& id);
- bool isKeyKnown(const std::string& id);
-
- void deleteKey(const std::string& id, bool trusted = false);
-
- std::list<PublicKey> publicKeys();
- std::list<PublicKey> trustedPublicKeys();
-
-};
+%include
%template(KeyRing_Ptr) intrusive_ptr<KeyRing>;
Modified: trunk/libzypp-bindings/swig/MediaSetAccess.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/MediaSetAccess.i?rev=8764&r1=8763&r2=8764&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/MediaSetAccess.i (original)
+++ trunk/libzypp-bindings/swig/MediaSetAccess.i Sat Feb 16 15:56:58 2008
@@ -1,16 +1,3 @@
-class MediaSetAccess
-{
-
-public:
-
- MediaSetAccess( const Url &url, const Pathname &path );
-
- ~MediaSetAccess();
-
- void setVerifier( unsigned media_nr, media::MediaVerifierRef verifier );
-
- Pathname provideFile(const Pathname & file, unsigned media_nr );
-
-};
+%include
Modified: trunk/libzypp-bindings/swig/Message.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Message.i?rev=8764&r1=8763&r2=8764&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/Message.i (original)
+++ trunk/libzypp-bindings/swig/Message.i Sat Feb 16 15:56:58 2008
@@ -1,26 +1 @@
- class Message : public ResObject
- {
- public:
- typedef detail::MessageImplIf Impl;
- typedef Message Self;
- typedef ResTraits<Self> TraitsType;
- typedef TraitsType::PtrType Ptr;
- typedef TraitsType::constPtrType constPtr;
-
- public:
- /** Get the text of the message */
- TranslatedText text() const;
- /** Patch the message belongs to - if any */
- Patch::constPtr patch() const;
-
- protected:
- Message( const NVRAD & nvrad_r );
- /** Dtor */
- virtual ~Message();
-
- private:
- /** Access implementation */
- virtual Impl & pimpl() = 0;
- /** Access implementation */
- virtual const Impl & pimpl() const = 0;
- };
+%include
Modified: trunk/libzypp-bindings/swig/OnMediaLocation.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/OnMediaLocation.i?rev=8764&r1=8763&r2=8764&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/OnMediaLocation.i (original)
+++ trunk/libzypp-bindings/swig/OnMediaLocation.i Sat Feb 16 15:56:58 2008
@@ -1,29 +1,2 @@
- class OnMediaLocation
- {
- friend std::ostream & operator<<( std::ostream & str, const OnMediaLocation & obj );
-
- public:
- /** Ctor */
- OnMediaLocation()
- : _medianr( 1 )
- {}
-
- public:
- unsigned medianr() const { return _medianr; }
- const Pathname & filename() const { return _filename; }
- const CheckSum & checksum() const { return _checksum; }
- const ByteCount & downloadsize() const { return _downloadsize; }
-
- public:
- OnMediaLocation & medianr( unsigned val_r ) { _medianr = val_r; return *this; }
- OnMediaLocation & filename( const Pathname & val_r ) { _filename = val_r; return *this; }
- OnMediaLocation & checksum( const CheckSum & val_r ) { _checksum = val_r; return *this; }
- OnMediaLocation & downloadsize( const ByteCount & val_r ) { _downloadsize = val_r; return *this; }
-
- private:
- unsigned _medianr;
- Pathname _filename;
- CheckSum _checksum;
- ByteCount _downloadsize;
- };
\ No newline at end of file
+%include
\ No newline at end of file
Modified: trunk/libzypp-bindings/swig/Package.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Package.i?rev=8764&r1=8763&r2=8764&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/Package.i (original)
+++ trunk/libzypp-bindings/swig/Package.i Sat Feb 16 15:56:58 2008
@@ -1,57 +1,3 @@
-
-class Package : public ResObject
-{
-
- public:
- typedef detail::PackageImplIf Impl;
- typedef Package Self;
- typedef ResTraits<Self> TraitsType;
- typedef TraitsType::PtrType Ptr;
- typedef TraitsType::constPtrType constPtr;
-
- public:
-
- /** Get the package change log */
- Changelog changelog() const;
- /** */
- std::string buildhost() const;
- /** */
- std::string distribution() const;
- /** */
- Label license() const;
- /** */
- std::string packager() const;
- /** */
- PackageGroup group() const;
- /** Don't ship it as class Url, because it might be
- * in fact anything but a legal Url. */
- std::string url() const;
- /** */
- std::string os() const;
- /** */
- Text prein() const;
- /** */
- Text postin() const;
- /** */
- Text preun() const;
- /** */
- Text postun() const;
- /** */
- zypp::ByteCount sourcesize() const;
- /** */
- std::liststd::string authors() const;
- /** */
- std::liststd::string filenames() const;
-
- /** Disk usage per directory */
- //DiskUsage diskusage() const;
-
- /** location in source */
- OnMediaLocation location() const;
-
- protected:
- Package( const NVRAD & nvrad_r );
- /** Dtor */
- virtual ~Package();
-};
+%ignore Package::checksum();
+%include
Modified: trunk/libzypp-bindings/swig/Patch.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Patch.i?rev=8764&r1=8763&r2=8764&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/Patch.i (original)
+++ trunk/libzypp-bindings/swig/Patch.i Sat Feb 16 15:56:58 2008
@@ -1,41 +1,2 @@
-class Patch : public ResObject
-{
- public:
- typedef detail::PatchImplIf Impl;
- typedef Patch Self;
- typedef ResTraits<Self> TraitsType;
- typedef TraitsType::PtrType Ptr;
- typedef TraitsType::constPtrType constPtr;
- public:
- typedef Impl::AtomList AtomList;
-
- public:
- /** Patch ID */
- std::string id() const;
- /** Patch time stamp */
- Date timestamp() const;
- /** Patch category (recommended, security,...) */
- std::string category() const;
- /** Does the system need to reboot to finish the update process? */
- bool reboot_needed() const;
- /** Does the patch affect the package manager itself? */
- bool affects_pkg_manager() const;
- /** The list of all atoms building the patch */
- AtomList atoms() const;
- /** Is the patch installation interactive? (does it need user input?) */
- bool interactive() const;
-
-
- protected:
- /** Ctor */
- Patch( const NVRAD & nvrad_r );
- /** Dtor */
- virtual ~Patch();
-
- private:
- /** Access implementation */
- virtual Impl & pimpl() = 0;
- /** Access implementation */
- virtual const Impl & pimpl() const = 0;
-};
+%include
\ No newline at end of file
Modified: trunk/libzypp-bindings/swig/Pathname.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Pathname.i?rev=8764&r1=8763&r2=8764&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/Pathname.i (original)
+++ trunk/libzypp-bindings/swig/Pathname.i Sat Feb 16 15:56:58 2008
@@ -1,18 +1 @@
-
-namespace zypp
-{
- namespace filesystem
- {
- %rename Pathname::dirname(const Pathname&) dirname1;
- %rename Pathname::basename(const Pathname&) basename1;
- %rename Pathname::extension(const Pathname&) extension1;
- %rename Pathname::absolutename(const Pathname&) absolutename1;
- %rename Pathname::relativename(const Pathname&) relativename1;
- %rename Pathname::cat(const Pathname&, const Pathname&) cat2;
- %rename Pathname::extend(const Pathname&, const std::string&) extend2;
- }
-}
-
-// TODO: tell make about dependencies
-%include
-
+%include
\ No newline at end of file
Modified: trunk/libzypp-bindings/swig/Pattern.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Pattern.i?rev=8764&r1=8763&r2=8764&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/Pattern.i (original)
+++ trunk/libzypp-bindings/swig/Pattern.i Sat Feb 16 15:56:58 2008
@@ -1,43 +1 @@
- class Pattern : public ResObject
- {
- public:
- typedef detail::PatternImplIf Impl;
- typedef Pattern Self;
- typedef ResTraits<Self> TraitsType;
- typedef TraitsType::PtrType Ptr;
- typedef TraitsType::constPtrType constPtr;
-
- public:
- /** */
- bool isDefault() const;
- /** */
- bool userVisible() const;
- /** */
- std::string category() const;
- /** */
- Pathname icon() const;
- /** */
- Pathname script() const;
- /** */
- Label order() const;
-
- /** \deprecated AFAIK unused old Selection interface method. */
- std::setstd::string install_packages( const Locale & lang = Locale("") ) const;
-
- /** Ui hint. */
- const CapSet & includes() const;
- /** Ui hint. */
- const CapSet & extends() const;
-
- protected:
- /** Ctor */
- Pattern( const NVRAD & nvrad_r );
- /** Dtor */
- virtual ~Pattern();
-
- private:
- /** Access implementation */
- virtual Impl & pimpl() = 0;
- /** Access implementation */
- virtual const Impl & pimpl() const = 0;
- };
+%include
\ No newline at end of file
Modified: trunk/libzypp-bindings/swig/PoolItem.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/PoolItem.i?rev=8764&r1=8763&r2=8764&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/PoolItem.i (original)
+++ trunk/libzypp-bindings/swig/PoolItem.i Sat Feb 16 15:56:58 2008
@@ -1,62 +1,8 @@
+%include
-class PoolItem_Ref
-{
-
- public:
- /** Implementation */
- class Impl;
-
- public:
- /** Default ctor for use in std::container. */
- PoolItem_Ref();
-
- /** Ctor */
- explicit
- PoolItem_Ref( ResObject::constPtr res_r );
-
- /** Ctor */
- PoolItem_Ref( ResObject::constPtr res_r, const ResStatus & status_r );
-
- /** Dtor */
- ~PoolItem_Ref();
-
- public:
- /** Returns the current status. */
- ResStatus & status() const;
-
- /** Reset status (applies autoprotection). */
- ResStatus & statusReset() const;
-
- /** Returns the ResObject::constPtr.
- * \see \ref operator->
- */
- // ResObject::constPtr resolvable() const;
- intrusive_ptr<const ResObject> resolvable() const;
-
- public:
-
- /** Forward \c -> access to ResObject. */
- ResObject::constPtr operator->() const
- { return resolvable(); }
-
- private:
- /** Pointer to implementation */
- RW_pointer<Impl> _pimpl;
-
- private:
- /** \name tmp hack for save/restore state. */
- /** \todo get rid of it. */
- //@{
- friend class PoolItemSaver;
- void saveState() const;
- void restoreState() const;
- bool sameState() const;
- //@}
-};
-
-typedef PoolItem_Ref PoolItem;
+typedef PoolItem PoolItem;
-%extend PoolItem_Ref
+%extend PoolItem
{
std::string asString() const
{
Modified: trunk/libzypp-bindings/swig/Product.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Product.i?rev=8764&r1=8763&r2=8764&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/Product.i (original)
+++ trunk/libzypp-bindings/swig/Product.i Sat Feb 16 15:56:58 2008
@@ -1,68 +1 @@
- class Product : public ResObject
- {
- public:
- typedef detail::ProductImplIf Impl;
- typedef Product Self;
- typedef ResTraits<Self> TraitsType;
- typedef TraitsType::PtrType Ptr;
- typedef TraitsType::constPtrType constPtr;
-
- public:
- /** Get the product type (base, add-on) */
- std::string type() const;
- /** \deprecated Use \ref type. */
- std::string category() const
- { return type(); }
-
- /** Get the vendor of the product */
- Label vendor() const;
-
- /** The URL to download the release notes for this product */
- Url releaseNotesUrl() const;
-
- /**
- * Online updates for the product.
- * They are complementary, not alternatives. #163192
- */
- std::list<Url> updateUrls() const;
-
- /**
- * Additional software for the product
- * They are complementary, not alternatives.
- */
- std::list<Url> extraUrls() const;
-
- /**
- * Optional software for the product
- * (for example. Non OSS repositories)
- * They are complementary, not alternatives.
- */
- std::list<Url> optionalUrls() const;
-
- /** The product flags */
- std::liststd::string flags() const;
-
- /** */
- Label shortName() const;
-
- /** */
- Label longName() const;
-
- /** Vendor specific distribution id. */
- std::string distributionName() const;
-
- /** Vendor specific distribution version. */
- Edition distributionEdition() const;
-
- protected:
- /** Ctor */
- Product( const NVRAD & nvrad_r );
- /** Dtor */
- virtual ~Product();
-
- private:
- /** Access implementation */
- virtual Impl & pimpl() = 0;
- /** Access implementation */
- virtual const Impl & pimpl() const = 0;
- };
+%include
\ No newline at end of file
Modified: trunk/libzypp-bindings/swig/PublicKey.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/PublicKey.i?rev=8764&r1=8763&r2=8764&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/PublicKey.i (original)
+++ trunk/libzypp-bindings/swig/PublicKey.i Sat Feb 16 15:56:58 2008
@@ -1,21 +1 @@
-
-class PublicKey
-{
-
-public:
-
- PublicKey();
- PublicKey(const zypp::Pathname& file);
- ~PublicKey();
-
- bool isValid() const;
-
- std::string asString() const;
- std::string armoredData() const;
- std::string id() const;
- std::string name() const;
- std::string fingerprint() const;
- zypp::Pathname path() const;
-
-};
-
+%include
\ No newline at end of file
Modified: trunk/libzypp-bindings/swig/RepoInfo.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/RepoInfo.i?rev=8764&r1=8763&r2=8764&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/RepoInfo.i (original)
+++ trunk/libzypp-bindings/swig/RepoInfo.i Sat Feb 16 15:56:58 2008
@@ -3,135 +3,7 @@
%template(UrlSet) std::set<Url>;
#endif
-class RepoInfo
-{
-public:
- RepoInfo();
- ~RepoInfo();
-
- /**
- * unique identifier for this source. If not specified
- * It should be generated from the base url.
- *
- * Normally, in a .repo file the section name is used
- * ( [somerepo] )
- */
- std::string alias() const;
-
- /**
- * Url of a file which contains a list of Urls
- * If empty, the base url will be used.
- */
- Url mirrorListUrl() const;
-
- typedef std::set<Url> url_set;
- typedef url_set::size_type urls_size_type;
- typedef transform_iterator urls_const_iterator;
-
- /**
- * iterator that points at begin of repository urls
- */
- urls_const_iterator baseUrlsBegin() const;
-
- /**
- * iterator that points at end of repository urls
- */
- urls_const_iterator baseUrlsEnd() const;
-
- /**
- * If enabled is false, then this repository must be ignored as if does
- * not exists, except when checking for duplicate alias.
- */
- bool enabled() const;
-
- /**
- * If true, the repostory must be refreshed before creating resolvables
- * from it
- */
- bool autorefresh() const;
-
- /**
- * Type of repository,
- *
- */
- repo::RepoType type() const;
-
- /**
- * \short Repository short label
- *
- * Short label or description of the repository, to be used on
- * the user interface.
- * ie: "SUSE Linux 10.2 updates"
- */
- std::string name() const;
-
- /**
- * \short File where this repo was read from
- *
- * \note could be an empty pathname for repo
- * infos created in memory.
- */
- zypp::Pathname filepath() const;
-
- /**
- * Add a base url. \see baseUrls
- * \param url The base url for the repository.
- *
- * To edit or remove urls, create a new RepoInfo instead.
- */
- RepoInfo & addBaseUrl( const zypp::Url &url );
-
- /**
- * Set mirror list url. \see mirrorListUrl
- * \param url The base url for the list
- */
- RepoInfo & setMirrorListUrl( const zypp::Url &url );
-
- /**
- * enable or disable the repository \see enabled
- * \param enabled
- */
- RepoInfo & setEnabled( bool enabled );
-
- /**
- * enable or disable autorefresh \see autorefresh
- * \param enabled
- */
- RepoInfo & setAutorefresh( bool autorefresh );
-
- /**
- * set the repository alias \see alias
- * \param alias
- */
- RepoInfo & setAlias( const std::string &alias );
-
- /**
- * set the repository type \see type
- * \param t
- */
- RepoInfo & setType( const repo::RepoType &t );
-
- /**
- * set the repository name \see name
- * \param name
- */
- RepoInfo & setName( const std::string &name );
-
- /**
- * \short set the repository filepath
- * \param path File path
- */
- RepoInfo & setFilepath( const zypp::Pathname &filename );
-
- std::ostream & dumpOn( std::ostream & str ) const;
-
- std::ostream & dumpRepoOn( std::ostream & str ) const;
-
- class Impl;
- private:
- /** Pointer to implementation */
- RWCOW_pointer<Impl> _pimpl;
-};
+%include
typedef std::list<RepoInfo> RepoInfoList;
%template(RepoInfoList) std::list<RepoInfo>;
Modified: trunk/libzypp-bindings/swig/RepoManager.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/RepoManager.i?rev=8764&r1=8763&r2=8764&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/RepoManager.i (original)
+++ trunk/libzypp-bindings/swig/RepoManager.i Sat Feb 16 15:56:58 2008
@@ -1,59 +1 @@
-
- std::list<RepoInfo> readRepoFile(const Url & repo_file);
-
- struct RepoManagerOptions
- {
- RepoManagerOptions();
-
- zypp::Pathname repoCachePath;
- zypp::Pathname repoRawCachePath;
- zypp::Pathname knownReposPath;
- };
-
- class RepoManager
- {
- public:
- RepoManager( const RepoManagerOptions &options = RepoManagerOptions() );
- ~RepoManager();
-
- enum RawMetadataRefreshPolicy
- {
- RefreshIfNeeded,
- RefreshForced
- };
-
- enum CacheBuildPolicy
- {
- BuildIfNeeded,
- BuildForced
- };
-
- enum RepoRemovePolicy
- {
-
- };
-
- std::list<RepoInfo> knownRepositories() const;
- void refreshMetadata( const RepoInfo &info,
- RawMetadataRefreshPolicy policy = RefreshIfNeeded,
- const ProgressData::ReceiverFnc & progressrcv = ProgressData::ReceiverFnc() );
- void cleanMetadata( const RepoInfo &info,
- const ProgressData::ReceiverFnc & progressrcv = ProgressData::ReceiverFnc() );
- void buildCache( const RepoInfo &info,
- CacheBuildPolicy policy = BuildIfNeeded,
- const ProgressData::ReceiverFnc & progressrcv = ProgressData::ReceiverFnc() );
- void cleanCache( const RepoInfo &info,
- const ProgressData::ReceiverFnc & progressrcv = ProgressData::ReceiverFnc() );
- bool isCached( const RepoInfo &info ) const;
- Repository createFromCache( const RepoInfo &info,const ProgressData::ReceiverFnc & progressrcv = ProgressData::ReceiverFnc() );
- repo::RepoType probe( const Url &url );
- void addRepository( const RepoInfo &info,
- const ProgressData::ReceiverFnc & progressrcv = ProgressData::ReceiverFnc() );
- void addRepositories( const Url &url,
- const ProgressData::ReceiverFnc & progressrcv = ProgressData::ReceiverFnc() );
- void removeRepository( const RepoInfo & info,
- const ProgressData::ReceiverFnc & progressrcv = ProgressData::ReceiverFnc() );
- RepoInfo getRepositoryInfo( const std::string &alias,
- const ProgressData::ReceiverFnc & progressrcv = ProgressData::ReceiverFnc() );
-
- };
+%include
\ No newline at end of file
Modified: trunk/libzypp-bindings/swig/RepoStatus.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/RepoStatus.i?rev=8764&r1=8763&r2=8764&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/RepoStatus.i (original)
+++ trunk/libzypp-bindings/swig/RepoStatus.i Sat Feb 16 15:56:58 2008
@@ -1,57 +1 @@
-
-class RepoStatus
-{
-
- public:
-
- /**
- * Checksum of the repository.
- * Usually the checksum of the index, but any
- * checksum that changes when the repository changes
- * in any way is sufficient.
- */
- std::string checksum() const;
-
- /**
- * timestamp of the repository. If the repository
- * changes, it has to be updated as well with the
- * new timestamp.
- */
- Date timestamp() const;
-
- /**
- * set the repository checksum \see checksum
- * \param checksum
- */
- RepoStatus & setChecksum( const std::string &checksum );
-
- /**
- * set the repository timestamp \see timestamp
- * \param timestamp
- */
- RepoStatus & setTimestamp( const Date ×tamp );
-
- /** Implementation */
- class Impl;
-
- public:
- /** Default ctor */
- RepoStatus();
-
- /**
- * \short Status from a single file
- * As most repository state is represented
- * by the status of the index file, you can
- * construct the status from a file.
- */
- RepoStatus( const Pathname &file );
-
- /** Dtor */
- ~RepoStatus();
-
- public:
-
- private:
- /** Pointer to implementation */
- RWCOW_pointer<Impl> _pimpl;
-};
+%include
\ No newline at end of file
Modified: trunk/libzypp-bindings/swig/RepoType.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/RepoType.i?rev=8764&r1=8763&r2=8764&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/RepoType.i (original)
+++ trunk/libzypp-bindings/swig/RepoType.i Sat Feb 16 15:56:58 2008
@@ -1,26 +1 @@
-
-struct RepoType
-{
- static const RepoType RPMMD;
- static const RepoType YAST2;
- //static const RepoType NONE;
-
- enum Type
- {
- NONE_e,
- RPMMD_e,
- YAST2_e
- };
-
- RepoType(Type type) : _type(type) {}
-
- explicit RepoType(const std::string & strval_r);
-
- const Type toEnum() const { return _type; }
-
- RepoType::Type parse(const std::string & strval_r);
-
- const std::string & asString() const;
-
- Type _type;
-};
+%include
\ No newline at end of file
Modified: trunk/libzypp-bindings/swig/Repository.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Repository.i?rev=8764&r1=8763&r2=8764&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/Repository.i (original)
+++ trunk/libzypp-bindings/swig/Repository.i Sat Feb 16 15:56:58 2008
@@ -1,15 +1,62 @@
-class Repository : private base::SafeBool<Repository>
-{
-public:
+ class Repository : private base::SafeBool<Repository>
+ {
+ public:
+ typedef repo::RepositoryImpl Impl;
+ typedef repo::RepositoryImpl_Ptr Impl_Ptr;
+
+ public:
+
+ /**
+ * \short Default ctor: noRepository.
+ * \see RepoManager::createFromCache.
+ */
Repository();
+
+ /** \short Factory ctor taking a RepositoryImpl.
+ * This is quite low level. You usually want to use RepoManager to
+ * manage the repositories.
+ * \see RepoManager
+ */
+ explicit
+ Repository( const Impl_Ptr & impl_r );
+
+ /** \short Factory ctor taking a RepositoryImpl.
+ */
+ explicit
+ Repository( const RepoInfo & info_r );
+
+ /**
+ * A dummy Repository (Id \c 0) providing nothing, doing nothing.
+ */
static const Repository noRepository;
+ /** Validate Repository in a boolean context.
+ * \c FALSE iff == noRepository.
+ */
+ //using base::SafeBool<Repository>::operator bool_type;
+
+ public:
typedef unsigned long NumericId;
+
+ /** Runtime unique numeric Repository Id. */
NumericId numericId() const;
- const ResStore & resolvables();
- const RepoInfo info() const;
+
+ /**
+ * \short Repository info used to create this repository
+ */
+ const RepoInfo & info() const;
+
+ /**
+ * \short Patch RPMs the repository provides
+ */
const std::listpackagedelta::PatchRpm & patchRpms() const;
+
+ /**
+ * \short Delta RPMs the repository provides
+ */
const std::listpackagedelta::DeltaRpm & deltaRpms() const;
-};
+ };
+
+
\ No newline at end of file
Modified: trunk/libzypp-bindings/swig/ResObject.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/ResObject.i?rev=8764&r1=8763&r2=8764&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/ResObject.i (original)
+++ trunk/libzypp-bindings/swig/ResObject.i Sat Feb 16 15:56:58 2008
@@ -1,32 +1,5 @@
-class ResObject : public Resolvable
-{
- public:
- typedef detail::ResObjectImplIf Impl;
- typedef ResObject Self;
- typedef ResTraits<Self> TraitsType;
- typedef intrusive_ptr<ResObject> Ptr;
- typedef TraitsType::constPtrType constPtr;
-
- public:
- Text summary() const;
- Text description() const;
- Text insnotify() const;
- Text delnotify() const;
- Text licenseToConfirm() const;
- Vendor vendor() const;
- zypp::ByteCount size() const;
- zypp::ByteCount downloadSize() const;
- Repository repository() const;
- unsigned mediaNr() const;
- bool installOnly() const;
- Date buildtime() const;
- Date installtime() const;
- protected:
- ResObject( const Kind & kind_r,
- const NVRAD & nvrad_r );
- virtual ~ResObject();
-};
+%include
%extend intrusive_ptr<const ResObject>
Modified: trunk/libzypp-bindings/swig/ResPool.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/ResPool.i?rev=8764&r1=8763&r2=8764&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/ResPool.i (original)
+++ trunk/libzypp-bindings/swig/ResPool.i Sat Feb 16 15:56:58 2008
@@ -1,173 +1,315 @@
%apply unsigned { ResPool::size_type };
+%nodefault ResPool;
+%ignore ResPool::byKindBegin;
+%ignore ResPool::byKindEnd;
+%ignore ResPool::byNameBegin;
+%ignore ResPool::byNameEnd;
+
class ResPool
-{
+ {
+ friend std::ostream & operator<<( std::ostream & str, const ResPool & obj );
- public:
- /** \ref zypp::pool::PoolItem */
- typedef pool::PoolTraits::Item Item;
- typedef pool::PoolTraits::size_type size_type;
- typedef pool::PoolTraits::const_iterator const_iterator;
- typedef pool::PoolTraits::byName_iterator byName_iterator;
- typedef pool::PoolTraits::byCapabilityIndex_iterator byCapabilityIndex_iterator;
- typedef pool::PoolTraits::AdditionalCapSet AdditionalCapSet;
-
- public:
- /** Default ctor: empty pool */
- ResPool();
- /** Dtor */
- ~ResPool();
-
- public:
- /** */
- bool empty() const;
- /** */
- size_type size() const;
-
- public:
-
- /** \name Iterate through all ResObjects (all kinds). */
- //@{
- #ifdef SWIGPERL5
- const_iterator begin() const;
- const_iterator end() const;
- #endif
- //@}
-
- public:
- /** \name Iterate through all ResObjects of a certain kind. */
- //@{
- typedef resfilter::ByKind ByKind;
- typedef filter_iterator byKind_iterator;
-
- /*
- byKind_iterator byKindBegin( const ResObject::Kind & kind_r ) const
- { return make_filter_begin( ByKind(kind_r), *this ); }
+ public:
+ /** \ref PoolItem */
+ typedef PoolItem value_type;
+ typedef pool::PoolTraits::size_type size_type;
+ typedef pool::PoolTraits::const_iterator const_iterator;
+
+ typedef pool::PoolTraits::byCapabilityIndex_iterator byCapabilityIndex_iterator;
+ typedef pool::PoolTraits::AdditionalCapabilities AdditionalCapabilities;
+ typedef pool::PoolTraits::repository_iterator repository_iterator;
+
+ public:
+ /** Singleton ctor. */
+ static ResPool instance();
+
+ /** preliminary */
+ ResPoolProxy proxy() const;
+
+ public:
+ /** The pools serial number. Changing whenever the
+ * whenever the content changes. (Resolvables or
+ * Dependencies).
+ */
+ const SerialNumber & serial() const;
+
+ public:
+ /** */
+ bool empty() const;
+ /** */
+ size_type size() const;
+
+ /** \name Iterate through all PoolItems (all kinds). */
+ //@{
+ /** */
+ const_iterator begin() const
+ { return make_filter_begin( pool::ByPoolItem(), store() ); }
+ /** */
+ const_iterator end() const
+ { return make_filter_end( pool::ByPoolItem(), store() ); }
+ //@}
+
+ public:
+ /** Return the corresponding \ref PoolItem.
+ * Pool and sat pool should be in sync. Returns an empty
+ * \ref PoolItem if there is no corresponding \ref PoolItem.
+ * \see \ref PoolItem::satSolvable.
+ */
+ PoolItem find( const sat::Solvable & slv_r ) const;
+
+ public:
+ /** \name Iterate through all PoolItems matching a \c _Filter. */
+ //@{
+ template<class _Filter>
+ filter_iterator<_Filter,const_iterator> filterBegin( const _Filter & filter_r ) const
+ { return make_filter_begin( filter_r, *this ); }
+
+ template<class _Filter>
+ filter_iterator<_Filter,const_iterator> filterEnd( const _Filter & filter_r ) const
+ { return make_filter_end( filter_r, *this ); }
+ //@}
+
+ public:
+ /** \name Iterate through all PoolItems of a certain name and kind. */
+ //@{
+ typedef pool::ByIdent ByIdent;
+ typedef pool::PoolTraits::byIdent_iterator byIdent_iterator;
+
+ byIdent_iterator byIdentBegin( const ByIdent & ident_r ) const
+ {
+ return make_transform_iterator( id2item().equal_range( ident_r.get() ).first,
+ pool::PoolTraits::Id2ItemValueSelector() );
+ }
+
+ byIdent_iterator byIdentBegin( ResKind kind_r, IdString name_r ) const
+ { return byIdentBegin( ByIdent(kind_r,name_r) ); }
+
+ byIdent_iterator byIdentBegin( ResKind kind_r, const C_Str & name_r ) const
+ { return byIdentBegin( ByIdent(kind_r,name_r) ); }
+
+ template<class _Res>
+ byIdent_iterator byIdentBegin( IdString name_r ) const
+ { return byIdentBegin( ByIdent(ResTraits<_Res>::kind,name_r) ); }
+
+ template<class _Res>
+ byIdent_iterator byIdentBegin( const C_Str & name_r ) const
+ { return byIdentBegin( ByIdent(ResTraits<_Res>::kind,name_r) ); }
+
+ /** Derive name and kind from \ref PoolItem. */
+ byIdent_iterator byIdentBegin( const PoolItem & pi_r ) const
+ { return byIdentBegin( ByIdent(pi_r.satSolvable()) ); }
+ /** Derive name and kind from \ref sat::Solvable. */
+ byIdent_iterator byIdentBegin( sat::Solvable slv_r ) const
+ { return byIdentBegin( ByIdent(slv_r) ); }
+ /** Takes a \ref sat::Solvable::ident string. */
+ byIdent_iterator byIdentBegin( IdString ident_r ) const
+ { return byIdentBegin( ByIdent(ident_r) ); }
+
+
+ byIdent_iterator byIdentEnd( const ByIdent & ident_r ) const
+ {
+ return make_transform_iterator( id2item().equal_range( ident_r.get() ).second,
+ pool::PoolTraits::Id2ItemValueSelector() );
+ }
+
+ byIdent_iterator byIdentEnd( ResKind kind_r, IdString name_r ) const
+ { return byIdentEnd( ByIdent(kind_r,name_r) ); }
+
+ byIdent_iterator byIdentEnd( ResKind kind_r, const C_Str & name_r ) const
+ { return byIdentEnd( ByIdent(kind_r,name_r) ); }
+
+ template<class _Res>
+ byIdent_iterator byIdentEnd( IdString name_r ) const
+ { return byIdentEnd( ByIdent(ResTraits<_Res>::kind,name_r) ); }
+
+ template<class _Res>
+ byIdent_iterator byIdentEnd( const C_Str & name_r ) const
+ { return byIdentEnd( ByIdent(ResTraits<_Res>::kind,name_r) ); }
+
+ /** Derive name and kind from \ref PoolItem. */
+ byIdent_iterator byIdentEnd( const PoolItem & pi_r ) const
+ { return byIdentEnd( ByIdent(pi_r.satSolvable()) ); }
+ /** Derive name and kind from \ref sat::Solvable. */
+ byIdent_iterator byIdentEnd( sat::Solvable slv_r ) const
+ { return byIdentEnd( ByIdent(slv_r) ); }
+ /** Takes a \ref sat::Solvable::ident string. */
+ byIdent_iterator byIdentEnd( IdString ident_r ) const
+ { return byIdentEnd( ByIdent(ident_r) ); }
+ //@}
+
+ public:
+ /** \name Iterate through all ResObjects of a certain kind. */
+ //@{
+ typedef zypp::resfilter::ByKind ByKind;
+ typedef filter_iterator byKind_iterator;
- template<class _Res>
- byKind_iterator byKindBegin() const
- { return make_filter_begin( resfilter::byKind<_Res>(), *this ); }
+ byKind_iterator byKindBegin( const ResKind & kind_r ) const
+ { return make_filter_begin( ByKind(kind_r), *this ); }
+ template<class _Res>
+ byKind_iterator byKindBegin() const
+ { return make_filter_begin( resfilter::byKind<_Res>(), *this ); }
- byKind_iterator byKindEnd( const ResObject::Kind & kind_r ) const
- { return make_filter_end( ByKind(kind_r), *this ); }
+ byKind_iterator byKindEnd( const ResKind & kind_r ) const
+ { return make_filter_end( ByKind(kind_r), *this ); }
- template<class _Res>
- byKind_iterator byKindEnd() const
+ template<class _Res>
+ byKind_iterator byKindEnd() const
{ return make_filter_end( resfilter::byKind<_Res>(), *this ); }
- //@}
- */
- public:
- /** \name Iterate through all ResObjects with a certain name (all kinds). */
- /*
- //@{
- byName_iterator byNameBegin( const std::string & name_r ) const;
-
- byName_iterator byNameEnd( const std::string & name_r ) const;
- //@}
- */
- public:
- /** \name Iterate through all ResObjects which have at least
- * one Capability with index \a index_r in dependency \a depType_r.
- */
- /*
- //@{
- byCapabilityIndex_iterator byCapabilityIndexBegin( const std::string & index_r, Dep depType_r ) const;
-
- byCapabilityIndex_iterator byCapabilityIndexEnd( const std::string & index_r, Dep depType_r ) const;
- //@}
- */
- public:
- /** \name Handling addition capabilities in the pool in order for solving it in
- * a solver run. This is used for tasks like needing a package with the name "foo".
- * The solver has to evaluate a proper package by his own.
- *
- * CAUTION: This has another semantic in the solver. The required resolvable has
- * been set for installation (in the pool) only AFTER a solver run.
- */
-
- /**
- * Handling additional requirement. E.G. need package "foo" and package
- * "foo1" which has a greater version than 1.0:
- *
- * \code
- * CapSet capset;
- * capset.insert (CapFactory().parse( ResTraits<Package>::kind, "foo"));
- * capset.insert (CapFactory().parse( ResTraits<Package>::kind, "foo1 > 1.0"));
- *
- * // The user is setting this capablility
- * ResPool::AdditionalCapSet aCapSet;
- * aCapSet[ResStatus::USER] = capset;
- *
- * setAdditionalRequire( aCapSet );
- * \endcode
- */
- void setAdditionalRequire( const AdditionalCapSet & capset ) const;
- AdditionalCapSet & additionalRequire() const;
-
- /**
- * Handling additional conflicts. E.G. do not install anything which provides "foo":
- *
- * \code
- * CapSet capset;
- * capset.insert (CapFactory().parse( ResTraits<Package>::kind, "foo"));
- *
- * // The user is setting this capablility
- * ResPool::AdditionalCapSet aCapSet;
- * aCapSet[ResStatus::USER] = capset;
- *
- * setAdditionalConflict( aCapSet );
- * \endcode
- */
- void setAdditionalConflict( const AdditionalCapSet & capset ) const;
- AdditionalCapSet & additionaConflict() const;
-
- /**
- * Handling additional provides. This is used for ignoring a requirement.
- * e.G. Do ignore the requirement "foo":
- *
- * \code
- * CapSet capset;
- * capset.insert (CapFactory().parse( ResTraits<Package>::kind, "foo"));
- *
- * // The user is setting this capablility
- * ResPool::AdditionalCapSet aCapSet;
- * aCapSet[ResStatus::USER] = capset;
- *
- * setAdditionalProvide( aCapSet );
- * \endcode
- */
- void setAdditionalProvide( const AdditionalCapSet & capset ) const;
- AdditionalCapSet & additionaProvide() const;
-
- private:
- /** */
- friend class ResPoolManager;
- /** Ctor */
- ResPool( pool::PoolTraits::Impl_constPtr impl_r );
- private:
- /** Const access to implementation. */
- pool::PoolTraits::Impl_constPtr _pimpl;
+ //@}
+
+ public:
+ /** \name Iterate through all ResObjects with a certain name (all kinds).
+ * \deprecated Instead of iterating byName and filter byKind use ByIdent iterator.
+ */
+ //@{
+ typedef zypp::resfilter::ByName ByName;
+ typedef filter_iterator byName_iterator;
+
+
+
+ public:
+ /** \name Iterate through all Repositories that contribute ResObjects.
+ */
+ //@{
+ size_type knownRepositoriesSize() const;
+
+ repository_iterator knownRepositoriesBegin() const;
+
+ repository_iterator knownRepositoriesEnd() const;
+ //@}
+
+ public:
+ /** \name Iterate through requested/available Locales.
+ */
+ //@{
+ /** Set the requested locales.
+ * Languages to be supported by the system, e.g. language specific
+ * packages to be installed.
+ */
+ void setRequestedLocales( const LocaleSet & locales_r );
+
+ /** Add one \ref Locale to the set of requested locales.
+ * Return \c true if \c locale_r was newly added to the set.
+ */
+ bool addRequestedLocale( const Locale & locale_r );
+
+ /** Erase one \ref Locale from the set of requested locales.
+ * Return \c false if \c locale_r was not found in the set.
+ */
+ bool eraseRequestedLocale( const Locale & locale_r );
+
+ /** Return the requested locales.
+ * \see \ref setRequestedLocales
+ */
+ const LocaleSet & getRequestedLocales() const;
+
+ /** Wheter this \ref Locale is in the set of requested locales. */
+ bool isRequestedLocale( const Locale & locale_r ) const;
+
+ /** Get the set of available locales.
+ * This is computed from the package data so it actually
+ * represents all locales packages claim to support.
+ */
+ const LocaleSet & getAvailableLocales() const;
+
+ /** Wheter this \ref Locale is in the set of available locales. */
+ bool isAvailableLocale( const Locale & locale_r ) const;
+ //@}
+
+ public:
+ /** \name Handling addition capabilities in the pool in order for solving it in
+ * a solver run. This is used for tasks like needing a package with the name "foo".
+ * The solver has to evaluate a proper package by his own.
+ *
+ * CAUTION: This has another semantic in the solver. The required resolvable has
+ * been set for installation (in the pool) only AFTER a solver run.
+ */
+
+ /**
+ * Handling additional requirement. E.G. need package "foo" and package
+ * "foo1" which has a greater version than 1.0:
+ *
+ * \code
+ * Capabilities capset;
+ * capset.insert (CapFactory().parse( ResTraits<Package>::kind, "foo"));
+ * capset.insert (CapFactory().parse( ResTraits<Package>::kind, "foo1 > 1.0"));
+ *
+ * // The user is setting this capablility
+ * ResPool::AdditionalCapabilities aCapabilities;
+ * aCapabilities[ResStatus::USER] = capset;
+ *
+ * setAdditionalRequire( aCapabilities );
+ * \endcode
+ */
+ void setAdditionalRequire( const AdditionalCapabilities & capset ) const;
+ AdditionalCapabilities & additionalRequire() const;
+
+ /**
+ * Handling additional conflicts. E.G. do not install anything which provides "foo":
+ *
+ * \code75
+ * Capabilities capset;
+ * capset.insert (CapFactory().parse( ResTraits<Package>::kind, "foo"));
+ *
+ * // The user is setting this capablility
+ * ResPool::AdditionalCapabilities aCapabilities;
+ * aCapabilities[ResStatus::USER] = capset;
+ *
+ * setAdditionalConflict( aCapabilities );
+ * \endcode
+ */
+ void setAdditionalConflict( const AdditionalCapabilities & capset ) const;
+ AdditionalCapabilities & additionaConflict() const;
+
+ /**
+ * Handling additional provides. This is used for ignoring a requirement.
+ * e.G. Do ignore the requirement "foo":
+ *
+ * \code
+ * Capabilities capset;
+ * capset.insert (CapFactory().parse( ResTraits<Package>::kind, "foo"));
+ *
+ * // The user is setting this capablility
+ * ResPool::AdditionalCapabilities aCapabilities;
+ * aCapabilities[ResStatus::USER] = capset;
+ *
+ * setAdditionalProvide( aCapabilities );
+ * \endcode
+ */
+ void setAdditionalProvide( const AdditionalCapabilities & capset ) const;
+ AdditionalCapabilities & additionaProvide() const;
+
+ private:
+ const pool::PoolTraits::ItemContainerT & store() const;
+ const pool::PoolTraits::Id2ItemT & id2item() const;
+
+ private:
+ /** Ctor */
+ ResPool( pool::PoolTraits::Impl_constPtr impl_r );
+ /** Const access to implementation. */
+ pool::PoolTraits::Impl_constPtr _pimpl;
+ };
-};
#ifdef SWIGPERL5
-iter2(ResPool, PoolItem_Ref);
+iter2(ResPool, PoolItem);
#endif
#ifdef SWIGRUBY
-iter3(ResPool, PoolItem_Ref*);
+iter3(ResPool, PoolItem*);
// %extend ResPool {
// void each()
// {
// ResPool::const_iterator i = self->begin();
// while ( i != self->end() ) {
-// rb_yield( SWIG_NewPointerObj( (void *) &*i, SWIGTYPE_p_PoolItem_Ref, 0));
+// rb_yield( SWIG_NewPointerObj( (void *) &*i, SWIGTYPE_p_PoolItem, 0));
// ++i;
// }
// }
@@ -178,7 +320,7 @@
{
ResPool::byKind_iterator i = self->byKindBegin( kind_r );
while ( i != self->byKindEnd( kind_r ) ) {
- rb_yield( SWIG_NewPointerObj( (void *) &*i, SWIGTYPE_p_PoolItem_Ref, 0));
+ rb_yield( SWIG_NewPointerObj( (void *) &*i, SWIGTYPE_p_PoolItem, 0));
++i;
}
}
@@ -189,7 +331,7 @@
{
ResPool::byName_iterator i = self->byNameBegin( name );
while ( i != self->byNameEnd( name ) ) {
- rb_yield( SWIG_NewPointerObj( (void *) &*i, $descriptor(PoolItem_Ref), 0));
+ rb_yield( SWIG_NewPointerObj( (void *) &*i, $descriptor(PoolItem), 0));
++i;
}
}
@@ -198,7 +340,7 @@
#endif
#ifdef SWIGPYTHON
-%template(PoolItemSet) std::set;
+%template(PoolItemSet) std::set<PoolItem>;
%newobject ResPool::const_iterator(PyObject **PYTHON_SELF);
%extend ResPool {
swig::PySwigIterator* iterator(PyObject **PYTHON_SELF)
Modified: trunk/libzypp-bindings/swig/ResTraits.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/ResTraits.i?rev=8764&r1=8763&r2=8764&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/ResTraits.i (original)
+++ trunk/libzypp-bindings/swig/ResTraits.i Sat Feb 16 15:56:58 2008
@@ -1,13 +1,13 @@
/** Base of ResTraits. Defines the Resolvable::Kind type. */
-struct ResolvableTraits
+/*struct ResolvableTraits
{
typedef KindOf<Resolvable> KindType;
-};
+};*/
/** ResTraits. Defines common types and the Kind value. */
template<typename _Res>
- struct ResTraits : public ResolvableTraits
+ struct ResTraits
{
typedef intrusive_ptr<_Res> PtrType;
typedef intrusive_ptr<const _Res> constPtrType;
@@ -66,4 +66,3 @@
%STUFF(Atom)
%STUFF(Script)
%STUFF(Message)
-%STUFF(Language)
Modified: trunk/libzypp-bindings/swig/Resolvable.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Resolvable.i?rev=8764&r1=8763&r2=8764&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/Resolvable.i (original)
+++ trunk/libzypp-bindings/swig/Resolvable.i Sat Feb 16 15:56:58 2008
@@ -1,6 +1,8 @@
+class Resolvable : protected sat::Solvable,
+ public base::ReferenceCounted, private base::NonCopyable
+ {
+ friend std::ostream & operator<<( std::ostream & str, const Resolvable & obj );
-class Resolvable
-{
public:
typedef Resolvable Self;
typedef ResTraits<Self> TraitsType;
@@ -8,27 +10,25 @@
typedef TraitsType::PtrType Ptr;
typedef TraitsType::constPtrType constPtr;
- const Kind & kind() const;
- const std::string & name() const;
- const zypp::Edition & edition() const;
- const Arch & arch() const;
+ public:
+ /** Whether this represents a valid- or no-solvable. */
+
+ /** \name Dependencies. */
+ //@{
+ /** Select by Dep. */
+ //Capabilities dep( Dep which_r ) const
+ //{ return operator[]( which_r ); }
+
+ //@}
- const CapSet & dep( Dep which_r ) const;
- const Dependencies & deps() const;
+ public:
+ const sat::Solvable & satSolvable() const { return *this; }
protected:
- Resolvable( const Kind & kind_r,
- const NVRAD & nvrad_r );
+ /** Ctor */
+ Resolvable( const sat::Solvable & solvable_r );
+ /** Dtor */
virtual ~Resolvable();
+ /** Helper for stream output */
virtual std::ostream & dumpOn( std::ostream & str ) const;
-};
-
-int compareByN(const Resolvable::constPtr & lhs,
- const Resolvable::constPtr & rhs);
-
-int compareByNVR(const Resolvable::constPtr & lhs,
- const Resolvable::constPtr & rhs);
-
-int compareByNVRA(const Resolvable::constPtr& lhs,
- const Resolvable::constPtr& rhs);
-
+ };
\ No newline at end of file
Modified: trunk/libzypp-bindings/swig/Resolver.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Resolver.i?rev=8764&r1=8763&r2=8764&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/Resolver.i (original)
+++ trunk/libzypp-bindings/swig/Resolver.i Sat Feb 16 15:56:58 2008
@@ -2,51 +2,7 @@
%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;
-};
+%include
typedef intrusive_ptr<Resolver> Resolver_Ptr;
%template(Resolver_Ptr) intrusive_ptr<Resolver>;
Modified: trunk/libzypp-bindings/swig/Script.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Script.i?rev=8764&r1=8763&r2=8764&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/Script.i (original)
+++ trunk/libzypp-bindings/swig/Script.i Sat Feb 16 15:56:58 2008
@@ -0,0 +1 @@
+%include
\ No newline at end of file
Modified: trunk/libzypp-bindings/swig/SrcPackage.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/SrcPackage.i?rev=8764&r1=8763&r2=8764&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/SrcPackage.i (original)
+++ trunk/libzypp-bindings/swig/SrcPackage.i Sat Feb 16 15:56:58 2008
@@ -1,25 +1 @@
- class SrcPackage : public ResObject
- {
-
- public:
- typedef detail::SrcPackageImplIf Impl;
- typedef SrcPackage Self;
- typedef ResTraits<Self> TraitsType;
- typedef TraitsType::PtrType Ptr;
- typedef TraitsType::constPtrType constPtr;
-
- public:
- /** location of resolvable in repo */
- OnMediaLocation location() const;
-
- protected:
- SrcPackage( const NVRAD & nvrad_r );
- /** Dtor */
- virtual ~SrcPackage();
-
- private:
- /** Access implementation */
- virtual Impl & pimpl() = 0;
- /** Access implementation */
- virtual const Impl & pimpl() const = 0;
- };
+%include ;
Modified: trunk/libzypp-bindings/swig/Target.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Target.i?rev=8764&r1=8763&r2=8764&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/Target.i (original)
+++ trunk/libzypp-bindings/swig/Target.i Sat Feb 16 15:56:58 2008
@@ -1,60 +1,6 @@
typedef intrusive_ptr<Target> Target_Ptr;
-class Target
-{
- public:
-
- typedef std::list PoolItemList;
-
- public:
-
- /** All resolvables provided by the target. */
- const ResStore & resolvables();
-
- /**
- * reload the target in future calls if
- * needed.
- * note the loading can actually be delayed, but
- * the next call to resolvables must reflect the
- * status of the system.
- */
- void reset();
-
- /**
- * load resolvables of certain kind in the internal store
- * and return a iterator
- * successive calls will be faster as resolvables are cached-
- */
- ResStore::resfilter_const_iterator byKindBegin( const ResObject::Kind & kind_r ) const;
- ResStore::resfilter_const_iterator byKindEnd( const ResObject::Kind & kind_r ) const;
-
- /** Null implementation */
- static Target_Ptr nullimpl();
-
- /** Refference to the RPM database */
- //target::rpm::RpmDb & rpmDb();
-
- /** If the package is installed and provides the file
- Needed to evaluate split provides during Resolver::Upgrade() */
- bool providesFile (const std::string & name_str, const std::string & path_str) const;
-
- ResObject::constPtr whoOwnsFile (const std::string & path_str) const;
-
-#ifndef STORAGE_DISABLED
- /** enables the storage target */
- bool isStorageEnabled() const;
- void enableStorage(const zypp::Pathname &root_r);
-#endif
-
- /** Set the log file for target */
- bool setInstallationLogfile(const zypp::Pathname & path_r);
-
- /** Return the root set for this target */
- zypp::Pathname root() const;
-
- /** return the last modification date of the target */
- Date timestamp() const;
-};
+%include
%template(Target_Ptr) intrusive_ptr<Target>;
Modified: trunk/libzypp-bindings/swig/TranslatedText.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/TranslatedText.i?rev=8764&r1=8763&r2=8764&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/TranslatedText.i (original)
+++ trunk/libzypp-bindings/swig/TranslatedText.i Sat Feb 16 15:56:58 2008
@@ -1,44 +1,2 @@
-class TranslatedText
-{
- public:
- /** Implementation */
- class Impl;
-
- public:
- /** Default ctor */
- TranslatedText();
- /** Ctor */
- explicit
- TranslatedText(const std::string &text, const Locale &lang = Locale());
- /** Ctor. */
- explicit
- TranslatedText(const std::liststd::string &text, const Locale &lang = Locale());
- /** Dtor */
- ~TranslatedText();
-
- /** true if the text have no translations for any language */
- bool empty() const ;
-
- /** static default empty translated text */
- static const TranslatedText notext;
-
- public:
-
- /** Synonym for \ref text */
- std::string asString( const Locale &lang = Locale() ) const
- { return text(lang); }
-
- std::string text( const Locale &lang = Locale() ) const;
- std::set<Locale> locales() const;
-
- void setText( const std::string &text, const Locale &lang = Locale());
- void setText( const std::liststd::string &text, const Locale &lang = Locale());
-
- Locale detectLanguage() const;
-
- private:
- /** Pointer to implementation */
- RWCOW_pointer<Impl> _pimpl;
-
-};
+%include
\ No newline at end of file
Modified: trunk/libzypp-bindings/swig/ZYppCommitPolicy.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/ZYppCommitPolicy.i?rev=8764&r1=8763&r2=8764&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/ZYppCommitPolicy.i (original)
+++ trunk/libzypp-bindings/swig/ZYppCommitPolicy.i Sat Feb 16 15:56:58 2008
@@ -5,55 +5,4 @@
%rename("syncPoolAfterCommit=") ZYppCommitPolicy::syncPoolAfterCommit(bool);
#endif
-class ZYppCommitPolicy
-{
- public:
- ZYppCommitPolicy()
- : _restrictToMedia ( 0 )
- , _dryRun ( false )
- , _rpmNoSignature ( false )
- , _syncPoolAfterCommit( true )
- {}
-
- public:
- unsigned restrictToMedia() const
- { return _restrictToMedia; }
-
- bool dryRun() const
- { return _dryRun; }
-
- bool rpmNoSignature() const
- { return _rpmNoSignature; }
-
- bool syncPoolAfterCommit() const
- { return _syncPoolAfterCommit; }
-
- public:
- /** Restrict commit to a certain media number
- * \deprecated
- */
- ZYppCommitPolicy & restrictToMedia( unsigned mediaNr_r )
- { _restrictToMedia = mediaNr_r; return *this; }
-
- /** Process all media (default) */
- ZYppCommitPolicy & allMedia()
- { return restrictToMedia( 0 ); }
-
- /** Set dry run (default: false) */
- ZYppCommitPolicy & dryRun( bool yesNo_r = true )
- { _dryRun = yesNo_r; return *this; }
-
- /** Use rpm option --nosignature (default: false) */
- ZYppCommitPolicy & rpmNoSignature( bool yesNo_r = true )
- { _rpmNoSignature = yesNo_r; return *this; }
-
- /** Kepp pool in sync with the Target databases after commit (default: true) */
- ZYppCommitPolicy & syncPoolAfterCommit( bool yesNo_r = true )
- { _syncPoolAfterCommit = yesNo_r; return *this; }
-
- private:
- unsigned _restrictToMedia;
- bool _dryRun;
- bool _rpmNoSignature;
- bool _syncPoolAfterCommit;
-};
+%include
\ No newline at end of file
Modified: trunk/libzypp-bindings/swig/ZYppCommitResult.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/ZYppCommitResult.i?rev=8764&r1=8763&r2=8764&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/ZYppCommitResult.i (original)
+++ trunk/libzypp-bindings/swig/ZYppCommitResult.i Sat Feb 16 15:56:58 2008
@@ -1,29 +1,4 @@
-struct ZYppCommitResult
- {
- ZYppCommitResult()
- : _result(0)
- {}
-
- typedef std::list PoolItemList;
-
- /**
- * number of committed resolvables
- **/
- int _result;
-
- /**
- * list of resolvables with error
- **/
- PoolItemList _errors;
- /**
- * list of resolvables remaining (due to wrong media)
- **/
- PoolItemList _remaining;
- /**
- * list of kind:source resolvables remaining (due to wrong media)
- **/
- PoolItemList _srcremaining;
- };
+%include
%extend ZYppCommitResult
{
Modified: trunk/libzypp-bindings/swig/ZYppFactory.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/ZYppFactory.i?rev=8764&r1=8763&r2=8764&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/ZYppFactory.i (original)
+++ trunk/libzypp-bindings/swig/ZYppFactory.i Sat Feb 16 15:56:58 2008
@@ -1,12 +1,4 @@
%template(ZYpp_Ptr) intrusive_ptr<ZYpp>;
-class ZYppFactory
-{
-public:
- static ZYppFactory instance();
- ~ZYppFactory();
- ZYpp::Ptr getZYpp() const;
- private:
- ZYppFactory();
-};
+%include
Modified: trunk/libzypp-bindings/swig/perl5/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/perl5/CMakeLists.txt?rev=8764&r1=8763&r2=8764&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/perl5/CMakeLists.txt (original)
+++ trunk/libzypp-bindings/swig/perl5/CMakeLists.txt Sat Feb 16 15:56:58 2008
@@ -18,7 +18,7 @@
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 ${SWIG_EXECUTABLE} -DZYPP_DEPRECATED -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
Modified: trunk/libzypp-bindings/swig/python/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/python/CMakeLists.txt?rev=8764&r1=8763&r2=8764&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/python/CMakeLists.txt (original)
+++ trunk/libzypp-bindings/swig/python/CMakeLists.txt Sat Feb 16 15:56:58 2008
@@ -16,7 +16,7 @@
ADD_CUSTOM_COMMAND (
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/zypp_wrap.cxx
COMMAND ${CMAKE_COMMAND} -E echo_append "Creating wrapper code for python..."
- COMMAND ${SWIG_EXECUTABLE} -c++ -python -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 ${SWIG_EXECUTABLE} -DZYPP_DEPRECATED -c++ -python -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
Modified: trunk/libzypp-bindings/swig/ruby/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/ruby/CMakeLists.txt?rev=8764&r1=8763&r2=8764&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/ruby/CMakeLists.txt (original)
+++ trunk/libzypp-bindings/swig/ruby/CMakeLists.txt Sat Feb 16 15:56:58 2008
@@ -15,7 +15,7 @@
ADD_CUSTOM_COMMAND (
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/zypp_wrap.cxx
COMMAND ${CMAKE_COMMAND} -E echo_append "Creating wrapper code for ruby..."
- COMMAND ${SWIG_EXECUTABLE} -c++ -ruby -autorename -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 ${SWIG_EXECUTABLE} -DZYPP_DEPRECATED -c++ -ruby -autorename -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
Modified: trunk/libzypp-bindings/swig/zypp.i
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/zypp.i?rev=8764&r1=8763&r2=8764&view=diff
==============================================================================
--- trunk/libzypp-bindings/swig/zypp.i (original)
+++ trunk/libzypp-bindings/swig/zypp.i Sat Feb 16 15:56:58 2008
@@ -16,18 +16,15 @@
#include "zypp/base/PtrTypes.h"
#include "zypp/Edition.h"
#include "zypp/ResTraits.h"
-#include "zypp/ResStore.h"
#include "zypp/ZYppFactory.h"
#include "zypp/ZYpp.h"
#include "zypp/Pathname.h"
#include "zypp/base/ReferenceCounted.h"
#include "zypp/ResObject.h"
-#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"
#include "zypp/Patch.h"
#include "zypp/Atom.h"
@@ -35,7 +32,6 @@
#include "zypp/Script.h"
#include "zypp/Message.h"
#include "zypp/Pattern.h"
-#include "zypp/Language.h"
#include "zypp/Product.h"
#include "zypp/ResFilters.h"
#include "zypp/OnMediaLocation.h"
@@ -53,9 +49,12 @@
typedef std::set<Url> UrlSet;
typedef std::liststd::string StringList;
-typedef std::listsolver::detail::ItemCapKind ItemCapKindList;
%}
+%nodefault ByKind;
+%define DEFINE_PTR_TYPE(name)
+%enddef
+
%rename("+") "operator+";
%rename("<<") "operator<<";
%rename("!=") "operator!=";
@@ -96,13 +95,12 @@
%include "ResStatus.i"
%include "NeedAType.i"
%include "Arch.i"
-%include "ResStore.i"
%include "Edition.i"
%include "Kind.i"
%include "ResTraits.i"
%include "Date.i"
%include "Capability.i"
-%include "CapSet.i"
+%include "Capabilities.i"
%include "Dependencies.i"
%include "Dep.i"
%include "Resolvable.i"
@@ -116,10 +114,6 @@
%include "TranslatedText.i"
%include "CheckSum.i"
%include "CapMatch.i"
-%include "CapFactory.i"
-%include "NVR.i"
-%include "NVRA.i"
-%include "NVRAD.i"
%include "Package.i"
%include "Patch.i"
%include "Atom.i"
@@ -127,7 +121,6 @@
%include "Script.i"
%include "Message.i"
%include "Pattern.i"
-%include "Language.i"
%include "Product.i"
%include "PublicKey.i"
%include "KeyRing.i"
@@ -135,17 +128,14 @@
%include "MediaSetAccess.i"
%include "PoolItem.i"
%include "ResPool.i"
-%include "ResPoolManager.i"
%include "ZYppCommitPolicy.i"
%include "ZYppCommitResult.i"
%include "TmpPath.i"
-%include "ItemCapKind.i"
%include "Resolver.i"
#ifdef SWIGPYTHON
%include "python/callbacks.i"
#endif
-
class ZYpp
{
public:
@@ -153,15 +143,10 @@
typedef intrusive_ptr<const ZYpp> constPtr;
public:
- ResPool pool() const;
- ResPoolProxy poolProxy() const;
+ //ResPool pool() const;
+ //ResPoolProxy poolProxy() const;
/*
- SourceFeed_Ref sourceFeed() const;
- */
- void addResolvables (const ResStore& store, bool installed = false);
- void removeResolvables (const ResStore& store);
- /*
DiskUsageCounter::MountPointSet diskUsage();
void setPartitions(const DiskUsageCounter::MountPointSet &mp);
*/
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org