remove obsolete capability handling stuff
authorMichael Andres <ma@suse.de>
Mon, 17 Mar 2008 17:16:23 +0000 (17:16 +0000)
committerMichael Andres <ma@suse.de>
Mon, 17 Mar 2008 17:16:23 +0000 (17:16 +0000)
32 files changed:
devel/devel.aschnell/parse1.cc
devel/devel.aschnell/parse2.cc
devel/devel.ma/Ex.cc
devel/devel.ma/NewPool.cc
devel/devel.ma/Parse.cc
devel/devel.ma/testdrafts/BitField.cc
devel/devel.ma/testdrafts/CompareBy.cc
tests/repo/RepoVariables_test.cc
tests/zypp/TranslatedText_test.cc
zypp/CMakeLists.txt
zypp/CapAndItem.h [deleted file]
zypp/CapFilters.h [deleted file]
zypp/CapMatchHelper.h [deleted file]
zypp/Capability.h
zypp/Locks.cc
zypp/OnMediaLocation.h
zypp/ResFilters.h
zypp/ResPool.cc
zypp/ResPool.h
zypp/ZConfig.h
zypp/pool/PoolImpl.cc
zypp/pool/PoolImpl.h
zypp/pool/PoolTraits.h
zypp/sat/SATResolver.cc
zypp/solver/detail/Helper.cc
zypp/solver/detail/InstallOrder.cc
zypp/solver/detail/ProblemSolutionUnlock.cc
zypp/solver/detail/Resolver.cc
zypp/solver/detail/ResolverUpgrade.cc
zypp/solver/detail/Resolver_problems.cc
zypp/target/TargetImpl.cc
zypp/ui/PatternExpander.cc

index 0e50d41..7ff4039 100644 (file)
@@ -10,7 +10,6 @@
 #include "zypp/ResPoolProxy.h"
 #include "zypp/ResPool.h"
 #include "zypp/ResFilters.h"
-#include "zypp/CapFilters.h"
 #include "zypp/Package.h"
 #include "zypp/Pattern.h"
 #include "zypp/Language.h"
index c6738ba..1ae3a13 100644 (file)
@@ -11,7 +11,6 @@
 #include "zypp/ResPool.h"
 #include "zypp/ResPoolManager.h"
 #include "zypp/ResFilters.h"
-#include "zypp/CapFilters.h"
 #include "zypp/Package.h"
 #include "zypp/Pattern.h"
 #include "zypp/Language.h"
index 2a1f8f0..de6301f 100644 (file)
@@ -8,13 +8,11 @@
 
 #include "zypp/ZYppFactory.h"
 #include "zypp/ResPoolProxy.h"
-#include <zypp/CapMatchHelper.h>
 
 #include "zypp/ZYppCallbacks.h"
 #include "zypp/NVRAD.h"
 #include "zypp/ResPool.h"
 #include "zypp/ResFilters.h"
-#include "zypp/CapFilters.h"
 #include "zypp/Package.h"
 #include "zypp/Pattern.h"
 #include "zypp/Language.h"
index 801515d..7347262 100644 (file)
@@ -16,7 +16,6 @@
 #include "zypp/NVRAD.h"
 #include "zypp/ResPool.h"
 #include "zypp/ResFilters.h"
-#include "zypp/CapFilters.h"
 #include "zypp/ResObjects.h"
 #include "zypp/Digest.h"
 #include "zypp/PackageKeyword.h"
@@ -316,14 +315,20 @@ struct MediaChangeReceive : public callback::ReceiveReport<media::MediaChangeRep
 {
   virtual Action requestMedia( Url & source
                                , unsigned mediumNr
+                               , const std::string & label
                                , Error error
-                               , const std::string & description )
+                               , const std::string & description
+                               , const std::vector<std::string> & devices
+                               , unsigned int & dev_current )
   {
     SEC << __FUNCTION__ << endl
     << "  " << source << endl
     << "  " << mediumNr << endl
+    << "  " << label << endl
     << "  " << error << endl
-    << "  " << description << endl;
+    << "  " << description << endl
+    << "  " << devices << endl
+    << "  " << dev_current << endl;
     return IGNORE;
   }
 };
index 54ebc67..4e0602a 100644 (file)
@@ -8,13 +8,11 @@
 
 #include "zypp/ZYppFactory.h"
 #include "zypp/ResPoolProxy.h"
-#include <zypp/CapMatchHelper.h>
 
 #include "zypp/ZYppCallbacks.h"
 #include "zypp/NVRAD.h"
 #include "zypp/ResPool.h"
 #include "zypp/ResFilters.h"
-#include "zypp/CapFilters.h"
 #include "zypp/Package.h"
 #include "zypp/Pattern.h"
 #include "zypp/Language.h"
index 3a39e54..2fefddf 100644 (file)
@@ -20,7 +20,6 @@
 #include "zypp/NVRAD.h"
 #include "zypp/ResPool.h"
 #include "zypp/ResFilters.h"
-#include "zypp/CapFilters.h"
 
 #include <zypp/SourceFactory.h>
 #include <zypp/source/susetags/SuseTagsImpl.h>
index 25b782f..62b4c17 100644 (file)
@@ -15,7 +15,6 @@
 
 #include "zypp/ResPool.h"
 #include "zypp/ResFilters.h"
-#include "zypp/CapFilters.h"
 
 #include <zypp/SourceFactory.h>
 #include <zypp/source/susetags/SuseTagsImpl.h>
index 31f92b2..0c1429d 100644 (file)
@@ -30,7 +30,7 @@ BOOST_AUTO_TEST_CASE(replace_text)
   BOOST_CHECK_EQUAL(replacer1("http://foo/$arch/bar"),
                     "http://foo/"+ ZConfig::instance().systemArchitecture().asString() + "/bar");
 
-  getZYpp()->setArchitecture(Arch("i686"));
+  ZConfig::instance().setSystemArchitecture(Arch("i686"));
   BOOST_CHECK_EQUAL(replacer1("http://foo/$arch/bar/$basearch"),
                     "http://foo/i686/bar/i386");
 
index e371fdc..495ed10 100644 (file)
@@ -4,8 +4,7 @@
 
 #include "zypp/base/Logger.h"
 #include "zypp/TranslatedText.h"
-#include "zypp/ZYppFactory.h"
-#include "zypp/ZYpp.h"
+#include "zypp/ZConfig.h"
 
 #include <boost/test/auto_unit_test.hpp>
 
@@ -17,13 +16,9 @@ using namespace zypp;
 
 BOOST_AUTO_TEST_CASE(translatedtext_test)
 {
-  ZYpp::Ptr god;
-
-  god = getZYpp();
-
   TranslatedText testTT;
   MIL << "Locale: en" << std::endl;
-  god->setTextLocale(Locale("en"));
+  ZConfig::instance().setTextLocale(Locale("en"));
   testTT.setText("default");
   MIL << "value: '" << testTT.text() << "'" << std::endl;
   BOOST_CHECK_EQUAL( testTT.text(), "default" );
@@ -32,7 +27,7 @@ BOOST_AUTO_TEST_CASE(translatedtext_test)
   BOOST_CHECK_EQUAL( testTT.text(), "default english" );
 
   MIL << "Locale: es_ES" << std::endl;
-  god->setTextLocale(Locale("es_ES"));
+  ZConfig::instance().setTextLocale(Locale("es_ES"));
 
   BOOST_CHECK_EQUAL( testTT.text(), "default english" );
 
@@ -45,7 +40,7 @@ BOOST_AUTO_TEST_CASE(translatedtext_test)
   BOOST_CHECK_EQUAL( testTT.text(), "hola Spain" );
 
   MIL << "Locale: null" << std::endl;
-  god->setTextLocale(Locale());
+  ZConfig::instance().setTextLocale(Locale());
   BOOST_CHECK_EQUAL( testTT.text(), "default" );
 }
 
index 1e6bc27..f878a21 100644 (file)
@@ -95,10 +95,7 @@ SET( zypp_HEADERS
   Callback.h
   Capabilities.h
   Capability.h
-  CapAndItem.h
-  CapFilters.h
   CapMatch.h
-  CapMatchHelper.h
   Changelog.h
   CheckSum.h
   CountryCode.h
diff --git a/zypp/CapAndItem.h b/zypp/CapAndItem.h
deleted file mode 100644 (file)
index 592c754..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*---------------------------------------------------------------------\
-|                          ____ _   __ __ ___                          |
-|                         |__  / \ / / . \ . \                         |
-|                           / / \ V /|  _/  _/                         |
-|                          / /__ | | | | | |                           |
-|                         /_____||_| |_| |_|                           |
-|                                                                      |
-\---------------------------------------------------------------------*/
-/** \file      zypp/CapAndItem.h
- *
-*/
-#ifndef ZYPP_CAPANDITEM_H
-#define ZYPP_CAPANDITEM_H
-
-#include "zypp/base/Deprecated.h"
-
-#include "zypp/PoolItem.h"
-#include "zypp/Capability.h"
-
-///////////////////////////////////////////////////////////////////
-namespace zypp
-{ /////////////////////////////////////////////////////////////////
-
-    ///////////////////////////////////////////////////////////////////
-    //
-    // CLASS NAME : CapAndItem
-    //
-    /**
-     *
-     * \deprecated no longer supported
-    */
-    struct ZYPP_DEPRECATED CapAndItem
-    {
-       friend std::ostream & operator<<( std::ostream & str, const CapAndItem & obj );
-       public:
-           Capability cap;
-           PoolItem item;
-
-           CapAndItem( Capability c, PoolItem i )
-               : cap( c )
-               , item( i )
-           { }
-    };
-
-  /////////////////////////////////////////////////////////////////
-} // namespace zypp
-///////////////////////////////////////////////////////////////////
-#endif // ZYPP_CAPANDITEM_H
diff --git a/zypp/CapFilters.h b/zypp/CapFilters.h
deleted file mode 100644 (file)
index 03c8e6c..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/*---------------------------------------------------------------------\
-|                          ____ _   __ __ ___                          |
-|                         |__  / \ / / . \ . \                         |
-|                           / / \ V /|  _/  _/                         |
-|                          / /__ | | | | | |                           |
-|                         /_____||_| |_| |_|                           |
-|                                                                      |
-\---------------------------------------------------------------------*/
-/** \file      zypp/CapFilters.h
- *
-*/
-#ifndef ZYPP_CAPFILTERS_H
-#define ZYPP_CAPFILTERS_H
-
-#include "zypp/base/Deprecated.h"
-#include "zypp/base/Functional.h"
-#include "zypp/Capability.h"
-#include "zypp/ResObject.h"
-
-///////////////////////////////////////////////////////////////////
-namespace zypp
-{ /////////////////////////////////////////////////////////////////
-  ///////////////////////////////////////////////////////////////////
-  namespace capfilter
-  { /////////////////////////////////////////////////////////////////
-
-    /** \defgroup CAPFILTERS Filter functors operating on Capability.
-     * \ingroup g_Functor
-    */
-    //@{
-
-    /** */
-    typedef std::unary_function<Capability, bool> CapabilityFilterFunctor;
-
-    /** */
-    struct ZYPP_DEPRECATED ByRefers : public CapabilityFilterFunctor
-    {
-      ZYPP_DEPRECATED bool operator()( const Capability & c ) const
-      {
-        return false; //c.refers() == _refers;
-      }
-
-      ZYPP_DEPRECATED ByRefers( Resolvable::Kind refers_r )
-      : _refers( refers_r )
-      {}
-      ZYPP_DEPRECATED ByRefers( ResObject::constPtr p )
-      : _refers( p->kind() )
-      {}
-      ZYPP_DEPRECATED ByRefers( const Capability & cap_r )
-      //: _refers( cap_r.refers() )
-      {}
-      Resolvable::Kind _refers;
-    };
-
-    /** */
-    struct ZYPP_DEPRECATED ByIndex : public CapabilityFilterFunctor
-    {
-      ZYPP_DEPRECATED bool operator()( const Capability & c ) const
-      {
-        return false; //c.index() == _index;
-      }
-
-      ZYPP_DEPRECATED ByIndex( const std::string & index_r )
-      : _index( index_r )
-      {}
-      ZYPP_DEPRECATED ByIndex( const Capability & cap_r )
-      //: _index( cap_r.index() )
-      {}
-      std::string _index;
-    };
-
-    /** */
-    struct ByCapMatch : public CapabilityFilterFunctor
-    {
-      bool operator()( const Capability & c ) const
-      {
-        return _lhs.matches( c ) == _expect;
-      }
-
-      ByCapMatch( const Capability & cap_r, CapMatch expect_r = CapMatch::yes )
-      : _lhs( cap_r )
-      , _expect( expect_r )
-      {}
-      Capability _lhs;
-      CapMatch   _expect;
-    };
-
-    //@}
-    /////////////////////////////////////////////////////////////////
-  } // namespace capfilter
-  ///////////////////////////////////////////////////////////////////^
-  /////////////////////////////////////////////////////////////////
-} // namespace zypp
-///////////////////////////////////////////////////////////////////
-#endif // ZYPP_CAPFILTERS_H
diff --git a/zypp/CapMatchHelper.h b/zypp/CapMatchHelper.h
deleted file mode 100644 (file)
index e9521c1..0000000
+++ /dev/null
@@ -1,378 +0,0 @@
-/*---------------------------------------------------------------------\
-|                          ____ _   __ __ ___                          |
-|                         |__  / \ / / . \ . \                         |
-|                           / / \ V /|  _/  _/                         |
-|                          / /__ | | | | | |                           |
-|                         /_____||_| |_| |_|                           |
-|                                                                      |
-\---------------------------------------------------------------------*/
-/** \file      zypp/CapMatchHelper.h
- *
-*/
-#ifndef ZYPP_CAPMATCHHELPER_H
-#define ZYPP_CAPMATCHHELPER_H
-
-#include "zypp/base/Algorithm.h"
-#include "zypp/base/Function.h"
-#include "zypp/ResPool.h"
-
-///////////////////////////////////////////////////////////////////
-namespace zypp
-{ /////////////////////////////////////////////////////////////////
-
-  /** Functor testing whether argument matches a certain Capability.
-   * \ingroup g_Functor
-   * \ingroup CAPFILTERS
-  */
-  class MatchesCapability
-  {
-  public:
-    MatchesCapability( const Capability & lhs_r )
-    : _lhs( lhs_r )
-    {}
-
-    bool operator()( const CapAndItem & capitem_r ) const
-    { return operator()( capitem_r.cap ); }
-
-    bool operator()( const Capability & rhs_r ) const
-    { return( _lhs.matches( rhs_r ) == CapMatch::yes ); }
-
-  private:
-    const Capability & _lhs;
-  };
-
-  /** \defgroup CAPMATCHHELPER Find matching Capabilities.
-   * \ingroup g_Algorithm
-  */
-  //@{
-
-  /** Algorithm invoking \c action_r on each \ref Capabilities entry
-   * that matches a given \ref Capability.
-  */
-  inline int forEachMatchIn( Capabilities::const_iterator begin_r,
-                             Capabilities::const_iterator end_r,
-                             const Capability & lhs_r,
-                             function<bool(const Capability &)> action_r )
-  {
-    return invokeOnEach( begin_r, end_r,
-                         MatchesCapability( lhs_r ), // filter
-                         action_r );
-  }
-
-  /** Algorithm invoking \c action_r on each \ref Capabilities entry
-   * that matches a given \ref Capability.
-  */
-  inline int forEachMatchIn( const Capabilities & capset_r,
-                             const Capability & lhs_r,
-                             function<bool(const Capability &)> action_r )
-  {
-    return invokeOnEach( capset_r.begin(), capset_r.end(),
-                         MatchesCapability( lhs_r ), // filter
-                         action_r );
-  }
-
-  /** Algorithm invoking \c action_r on each matching \ref Capability
-   * in a \ref ResPool.
-   *
-   * \code
-   * // Returns wheter willing to collect more items.
-   * bool consume( const CapAndItem & cai_r );
-   *
-   * ResPool    _pool;
-   * Capability _cap;
-   * // Invoke consume on all provides that match _cap
-   * forEachMatchIn( _pool, Dep::PROVIDES, _cap, consume );
-   * \endcode
-   *
-   * \relates ResPool.
-   * \see ForEachMatchInPool
-  */
-  inline int forEachMatchIn( const ResPool & pool_r, const Dep & dep_r,
-                             const Capability & lhs_r,
-                             function<bool(const CapAndItem &)> action_r )
-  {
-    std::string index( lhs_r.index() );
-    return invokeOnEach( pool_r.byCapabilityIndexBegin( index, dep_r ),
-                         pool_r.byCapabilityIndexEnd( index, dep_r ),
-                         MatchesCapability( lhs_r ), // filter
-                         action_r );
-  }
-
-
-  ///////////////////////////////////////////////////////////////////
-
-  /** Functor invoking \c action_r on each matching \ref Capability
-   *  in a \ref Capabilities.
-   *
-   * Functor is provided to ease using \ref forEachMatchIn as action
-   * in other algorithms (nested loop over two Capabilitiess).
-  */
-  class ForEachMatchInCapabilities
-  {
-  public:
-    typedef function<bool(const Capability &, const Capability &)> Action;
-
-  public:
-    ForEachMatchInCapabilities( const Capabilities & set_r, const Action & action_r )
-    : _set( set_r )
-    , _action( action_r )
-    {}
-
-    bool operator()( const Capability & cap_r ) const
-    {
-      return( forEachMatchIn( _set, cap_r, bind( _action, _1, cap_r ) )
-              >= 0 ); // i.e. _action did not return false
-    }
-
-  private:
-    const Capabilities & _set;
-    Action         _action;
-  };
-
-  /** Invoke \c action_r on each matching pair of Capabilities within
-   * two Capabilitiess. */
-  inline int forEachMatchIn( const Capabilities & lhs_r,
-                             const Capabilities & rhs_r,
-                             function<bool(const Capability &, const Capability &)> action_r )
-  {
-    return invokeOnEach( lhs_r.begin(), lhs_r.end(),
-                         ForEachMatchInCapabilities( rhs_r, action_r ) );
-  }
-  ///////////////////////////////////////////////////////////////////
-
-  namespace capmatch_detail {
-    struct AlwaysFalse
-    {
-      bool operator()( const Capability &, const Capability & ) const
-      { return false; }
-      bool operator()( const Capability & ) const
-      { return false; }
-    };
-  }
-
-  /** Return \c true if the Capabilities contains at least one Capabilitiy
-   *  that matches.
-  */
-  inline bool hasMatches( const Capabilities & lhs_r, const Capability & rhs_r )
-  {
-    return( forEachMatchIn( lhs_r, rhs_r, capmatch_detail::AlwaysFalse() ) < 0 );
-  }
-
-  /** Return \c true if the Capabilitiess contain at least one pair of
-   *  Capabilities that match.
-  */
-  inline bool hasMatches( const Capabilities & lhs_r, const Capabilities & rhs_r )
-  {
-    return( forEachMatchIn( lhs_r, rhs_r, capmatch_detail::AlwaysFalse() ) < 0 );
-  }
-
-  ///////////////////////////////////////////////////////////////////
-
-
-  /** Functor invoking \c action_r on each matching \ref Capability
-   *  in a \ref ResPool.
-   *
-   * Functor is provided to ease using \ref forEachMatchIn as action
-   * in other algorithms.
-   *
-   * \code
-   * bool consume( const CapAndItem & cai_r );
-   *
-   * ResPool  _pool;
-   * PoolItem _pi;
-   *
-   * // Invoke consume on all PoolItems obsoleted by pi.
-   * // short: forEachPoolItemMatchedBy( _pool, _pi, Dep::OBSOLETES, consume );
-   * for_each( _pi->dep(Dep::OBSOLETES).begin(),
-   *           _pi->dep(Dep::OBSOLETES).end(),
-   *           ForEachMatchInPool( _pool, Dep::PROVIDES, consume ) );
-   *
-   * // Invoke consume on all PoolItems obsoleting pi.
-   * // short: forEachPoolItemMatching( _pool, Dep::OBSOLETES, _pi, consume );
-   * for_each( pi->dep(Dep::PROVIDES).begin(),
-   *           pi->dep(Dep::PROVIDES).end(),
-   *           ForEachMatchInPool( _pool, Dep::OBSOLETES, consume ) );
-   *
-   * \endcode
-   *
-   * \ingroup g_Functor
-   * \ingroup CAPFILTERS
-   * \relates ResPool.
-   * \see forEachPoolItemMatchedBy
-   * \see forEachPoolItemMatching
-  */
-  class ForEachMatchInPool
-  {
-  public:
-    typedef function<bool(const CapAndItem &)> Action;
-
-  public:
-    ForEachMatchInPool( const ResPool & pool_r,
-                        const Dep &     dep_r,
-                        const Action &  action_r )
-    : _pool  ( pool_r )
-    , _dep   ( dep_r )
-    , _action( action_r )
-    {}
-
-    bool operator()( const Capability & cap_r ) const
-    {
-      return( forEachMatchIn( _pool, _dep, cap_r, _action )
-              >= 0 ); // i.e. _action did not return false
-    }
-
-  private:
-    ResPool _pool;
-    Dep     _dep;
-    Action  _action;
-  };
-
-  /** Find all items in a ResPool matched by a certain PoolItems
-   *  dependency set.
-   *
-   * Iterates <tt>poolitem_r->dep(poolitemdep_r)</tt>
-   * and invokes \c action_r on each item in \c pool_r,
-   * that provides a match.
-   * \code
-   * bool consume( const CapAndItem & cai_r );
-   *
-   * ResPool  _pool;
-   * PoolItem _pi;
-   *
-   * // Invoke consume on all PoolItems obsoleted by pi.
-   * forEachPoolItemMatchedBy( _pool, _pi, Dep::OBSOLETES, consume );
-   * \endcode
-   *
-   * \note \c action_r is invoked for each matching Capability. So if
-   * the same PoolItem provides multiple matches, \c action_r refers
-   * to the same PoolItem multiple times. It may as well be that
-   * \c poolitem_r provides a matching Capability. Use \ref OncePerPoolItem
-   * to compensate this if neccessary.
-  */
-  inline int forEachPoolItemMatchedBy( const ResPool &  pool_r,
-                                        const PoolItem & poolitem_r,
-                                        const Dep &      poolitemdep_r,
-                                        function<bool(const CapAndItem &)> action_r )
-  {
-    return invokeOnEach( poolitem_r->dep(poolitemdep_r).begin(),
-                         poolitem_r->dep(poolitemdep_r).end(),
-                         ForEachMatchInPool( pool_r, Dep::PROVIDES, action_r ) );
-  }
-
-  /** Find all items in a ResPool matching a certain PoolItem.
-   *
-   * Iterates <tt>poolitem_r->dep(Dep::PROVIDES)</tt>
-   * and invoking \c action_r on each item in \c pool_r,
-   * that provides a match.
-   * \code
-   * bool consume( const CapAndItem & cai_r );
-   *
-   * ResPool  _pool;
-   * PoolItem _pi;
-   *
-   * // Invoke consume on all PoolItems obsoleting pi.
-   * forEachPoolItemMatching( _pool, Dep::OBSOLETES, _pi, consume );
-   * \endcode
-   *
-   * \note \c action_r is invoked for each matching Capability. So if
-   * the same PoolItem provides multiple matches, \c action_r refers
-   * to the same PoolItem multiple times. It may as well be that
-   * \c poolitem_r provides a matching Capability. Use \ref OncePerPoolItem
-   * to compensate this if neccessary.
-  */
-  inline int forEachPoolItemMatching( const ResPool &  pool_r,
-                                      const Dep &      pooldep_r,
-                                      const PoolItem & poolitem_r,
-                                      function<bool(const CapAndItem &)> action_r )
-  {
-    return invokeOnEach( poolitem_r->dep(Dep::PROVIDES).begin(),
-                         poolitem_r->dep(Dep::PROVIDES).end(),
-                         ForEachMatchInPool( pool_r, pooldep_r, action_r ) );
-  }
-
-  /** Functor translating \ref CapAndItem actions into \ref PoolItem
-   *  actions avoiding multiple invocations for the same \ref PoolItem.
-   *
-   * Additionally you may omit invocation of \a action_r for a
-   * specific PoolItem.
-   *
-   * Even if no _action is given, the PoolItems that would have been
-   * processed are collected in a std::set, available via
-   * \ref collectedItems.
-   *
-   * \code
-   * bool consume( const CapAndItem & cai_r );
-   * bool consumePi( const PoolItem & pi_r );
-   *
-   * ResPool  _pool;
-   * PoolItem _pi;
-   *
-   * // Invoke consume on all PoolItems obsoleted by pi.
-   * // Once for each matching Capability, thus the same PoolItem
-   * // might be involved mutiple times.
-   * forEachPoolItemMatchedBy( _pool, _pi, Dep::OBSOLETES,
-   *                           consume );
-   *
-   * // Invoke consume on all PoolItems obsoleted by pi.
-   * // Once for each PoolItem, still including _pi in case
-   * // it provides a match by itself.
-   * forEachPoolItemMatchedBy( _pool, _pi, Dep::OBSOLETES,
-   *                           OncePerPoolItem( consumePi ) );
-   *
-   * // Invoke consume on all PoolItems obsoleted by pi.
-   * // Once for each PoolItem, omitting invokation for
-   * // _pi (in case it obsoletes itself).
-   * forEachPoolItemMatchedBy( _pool, _pi, Dep::OBSOLETES,
-   *                           OncePerPoolItem( consumePi, _pi ) );
-   * \endcode
-   * \ingroup g_Functor
-   * \ingroup CAPFILTERS
-  */
-  struct OncePerPoolItem
-  {
-  public:
-    typedef function<bool(const PoolItem &)> Action;
-
-  public:
-    explicit
-    OncePerPoolItem( const PoolItem & self_r = PoolItem() )
-    : _self  ( self_r )
-    , _uset  ( new std::set<PoolItem> )
-    {}
-
-    OncePerPoolItem( const Action & action_r,
-                     const PoolItem & self_r = PoolItem() )
-    : _action( action_r )
-    , _self  ( self_r )
-    , _uset  ( new std::set<PoolItem> )
-    {}
-
-    bool operator()( const CapAndItem & cai_r ) const
-    {
-      if ( cai_r.item == _self ) // omit _self
-        return true;
-      // intentionally collect items in _uset even
-      // if no _action specified.
-      if ( _uset->insert( cai_r.item ).second
-           && _action )
-        return _action( cai_r.item );
-
-      return true;
-    }
-
-    const std::set<PoolItem> & collectedItems() const
-    { return *_uset; }
-
-  private:
-    Action   _action;
-    PoolItem _self;
-    shared_ptr<std::set<PoolItem> > _uset;
-  };
-
-
-  //@}
-
-  /////////////////////////////////////////////////////////////////
-} // namespace zypp
-///////////////////////////////////////////////////////////////////
-#endif // ZYPP_CAPMATCHHELPER_H
index e10a29b..7493690 100644 (file)
@@ -57,10 +57,6 @@ namespace zypp
                     private base::SafeBool<Capability>
   {
     public:
-      // legacy
-      std::string index() const ZYPP_DEPRECATED;
-
-    public:
       enum CtorFlag { PARSED, UNPARSED };
 
     public:
@@ -293,12 +289,6 @@ namespace zypp
 
   inline CapDetail Capability::detail() const { return CapDetail( _id ); }
 
-  inline std::string Capability::index() const
-  {
-    CapDetail cap( _id );
-    return( cap.isSimple() ? cap.name().asString() : std::string() );
-  }
-
   /////////////////////////////////////////////////////////////////
 } // namespace zypp
 ///////////////////////////////////////////////////////////////////
index 10a4a45..d617bb8 100644 (file)
 #include <fstream>
 #include <boost/function.hpp>
 
-#include <zypp/base/Regex.h>
-#include <zypp/base/String.h>
+#include "zypp/base/Regex.h"
+#include "zypp/base/String.h"
 #include "zypp/base/Logger.h"
 #include "zypp/base/IOStream.h"
 #include "zypp/PoolItem.h"
-#include "zypp/CapMatchHelper.h"
 
 #undef ZYPP_BASE_LOGGER_LOGGROUP
 #define ZYPP_BASE_LOGGER_LOGGROUP "locks"
@@ -32,7 +31,7 @@ namespace zypp
 {
 namespace locks
 {
-
+#if 0
 //
 // collect matching names
 //
@@ -89,29 +88,12 @@ wildcards2regex(const string & str)
 
   return regexed;
 }
-
+#endif
 
 //
 // assign Lock to installed pool item
 //
 
-struct ItemLockerFunc
-{
-  ItemLockerFunc( const string lock_str )
-    : _lock_str(lock_str)
-  {}
-
-  bool operator()( const CapAndItem &cai_r )
-  {
-    PoolItem item(cai_r.item);
-    MIL << "Locking " << cai_r.item << "(matched by " << _lock_str << ")" << endl;
-    item.status().setLock( true, ResStatus::USER);
-    return true;
-  }
-
-  string _lock_str;
-};
-
 struct AddLockToPool
 {
   AddLockToPool( const ResPool &pool )
index 2fd1089..84b6144 100644 (file)
@@ -87,13 +87,6 @@ namespace zypp
     { _openchecksum = val_r; return *this; }
 
   public:
-    /** \deprecated use \ref setLocation or \ref changeMedianr */
-    ZYPP_DEPRECATED OnMediaLocation & xsetMedianr( unsigned val_r )
-    { return changeMedianr( val_r ); }
-    /** \deprecated use \ref setLocation or \ref changeFilename */
-    ZYPP_DEPRECATED OnMediaLocation & xsetFilename( const Pathname & val_r )
-    {  return changeFilename( val_r ); }
-
     /** Individual manipulation of \c medianr.
      * Using \ref setLocation is prefered.
     */
index 9abd4e7..a0221c3 100644 (file)
 
 #include "zypp/base/Functional.h"
 #include "zypp/Resolvable.h"
-#include "zypp/CapFilters.h"
 
 #include "zypp/PoolItem.h"
 #include "zypp/Repository.h"
-#include "zypp/CapAndItem.h"
 
 ///////////////////////////////////////////////////////////////////
 namespace zypp
@@ -203,7 +201,7 @@ namespace zypp
 
       std::string _alias;
     };
-      
+
     /** Select ResObject by Edition using \a _Compare functor.
      *
      * Selects ResObject if <tt>_Compare( ResObject->edition(), _edition )</tt>
@@ -343,97 +341,6 @@ namespace zypp
       }
     };
 
-
-
-    ///////////////////////////////////////////////////////////////////
-
-    /** Select ResObject if at least one Capability with
-     *  index \a index_r was found in dependency \a depType_r.
-    */
-    struct ByCapabilityIndex
-    {
-      bool operator()( const CapAndItem & /*cai*/ ) const
-      {
-       return true;                    // its all in the PoolImpl !
-      }
-    };
-
-
-    /** Select ResObject if at least one Capability with
-     *  index \a index_r was found in dependency \a depType_r.
-    */
-    struct ByCapMatch
-    {
-      bool operator()( const CapAndItem & cai ) const
-      {
-       return cai.cap.matches( _cap ) == CapMatch::yes;
-      }
-      ByCapMatch( const Capability & cap_r )
-       : _cap( cap_r )
-      {}
-      Capability _cap;
-    };
-
-
-    /** Select PoolItem by uninstalled. */
-    struct ByCaIUninstalled
-    {
-      bool operator()( const CapAndItem & cai ) const
-      {
-       return cai.item.status().isUninstalled();
-      }
-    };
-
-    /** Select PoolItem by installed. */
-    struct ByCaIInstalled
-    {
-      bool operator()( const CapAndItem & cai ) const
-      {
-       return cai.item.status().isInstalled();
-      }
-    };
-
-    /** Select PoolItem by transact. */
-    struct ByCaITransact
-    {
-      bool operator()( const CapAndItem & cai ) const
-      {
-       return cai.item.status().transacts();
-      }
-    };
-
-    /** Select PoolItem by not transact. */
-    struct ByCaINotTransact
-    {
-      bool operator()( const CapAndItem & cai ) const
-      {
-       return !(cai.item.status().transacts());
-      }
-    };
-
-
-    /** Select CapAndItem by kind. */
-    struct ByCaIKind
-    {
-      ByCaIKind( const ResObject::Kind & kind_r )
-      : _kind( kind_r )
-      {}
-
-      bool operator()( const CapAndItem & cai ) const
-      {
-        return cai.item->kind() == _kind;
-      }
-
-      ResObject::Kind _kind;
-    };
-
-    /** */
-    template<class _Res>
-      inline ByCaIKind byCaIKind()
-      { return ByCaIKind( ResTraits<_Res>::kind ); }
-
-    ///////////////////////////////////////////////////////////////////
-
     //@}
     /////////////////////////////////////////////////////////////////
   } // namespace resfilter
index 6fba802..145f75d 100644 (file)
@@ -66,13 +66,6 @@ namespace zypp
   PoolItem ResPool::find( const sat::Solvable & slv_r ) const
   { return _pimpl->find( slv_r ); }
 
-  ResPool::byCapabilityIndex_iterator ResPool::byCapabilityIndexBegin( const std::string & index_r, Dep depType_r ) const
-  { return _pimpl->_caphashfake.begin(); }
-
-  ResPool::byCapabilityIndex_iterator ResPool::byCapabilityIndexEnd( const std::string & index_r, Dep depType_r ) const
-  { return _pimpl->_caphashfake.end(); }
-
-
   ResPool::size_type ResPool::knownRepositoriesSize() const
   { return _pimpl->knownRepositories().size(); }
 
index cd57144..8da1eea 100644 (file)
@@ -54,9 +54,8 @@ namespace zypp
       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;
+      typedef pool::PoolTraits::AdditionalCapabilities  AdditionalCapabilities;
+      typedef pool::PoolTraits::repository_iterator      repository_iterator;
 
     public:
       /** Singleton ctor. */
@@ -201,34 +200,19 @@ namespace zypp
       //@}
 
     public:
-      /** \name Iterate through all ResObjects with a certain name (all kinds).
-       * \deprecated Instead of iterating byName and filter byKind use ByIdent iterator.
-      */
+      /** \name Iterate through all ResObjects with a certain name (all kinds). */
       //@{
       typedef zypp::resfilter::ByName ByName;
       typedef filter_iterator<ByName,const_iterator> byName_iterator;
 
-      byName_iterator ZYPP_DEPRECATED byNameBegin( const std::string & name_r ) const
+      byName_iterator byNameBegin( const std::string & name_r ) const
       { return make_filter_begin( ByName(name_r), *this ); }
 
-      byName_iterator ZYPP_DEPRECATED byNameEnd( const std::string & name_r ) const
+      byName_iterator byNameEnd( const std::string & name_r ) const
       { return make_filter_end( ByName(name_r), *this ); }
       //@}
 
     public:
-      /** \name Iterate through all ResObjects which have at least
-       *  one Capability with index \a index_r in dependency \a depType_r.
-       *
-       * \deprecated If you're looking for providers of a certain capability
-       * use \ref sat::WhatProvides. That's currently the only index provided.
-       */
-      //@{
-      byCapabilityIndex_iterator ZYPP_DEPRECATED byCapabilityIndexBegin( const std::string & index_r, Dep depType_r ) const;
-
-      byCapabilityIndex_iterator ZYPP_DEPRECATED byCapabilityIndexEnd( const std::string & index_r, Dep depType_r ) const;
-      //@}
-
-    public:
       /** \name Iterate through all Repositories that contribute ResObjects.
        */
       //@{
index 034889d..e2d90bf 100644 (file)
@@ -66,10 +66,6 @@ namespace zypp
       void resetSystemArchitecture()
       { setSystemArchitecture( defaultSystemArchitecture() ); }
 
-      /** use setSystemArchitecture */
-      ZYPP_DEPRECATED void overrideSystemArchitecture( const Arch & arch_r )
-      { setSystemArchitecture( arch_r ); }
-
     public:
       /** The autodetected prefered locale for translated texts.
        */
index 937ec73..23d803a 100644 (file)
 #include "zypp/base/LogTools.h"
 
 #include "zypp/pool/PoolImpl.h"
-#include "zypp/Package.h"
-#include "zypp/VendorAttr.h"
-
-#include "zypp/sat/Pool.h"
-#include "zypp/Repository.h"
 
 using std::endl;
 
@@ -25,11 +20,6 @@ using std::endl;
 namespace zypp
 { /////////////////////////////////////////////////////////////////
 
-  std::ostream & operator<<( std::ostream & str, const CapAndItem & obj )
-  {
-    return str << "{" << obj.cap << ", " << obj.item << "}";
-  }
-
   ///////////////////////////////////////////////////////////////////
   namespace pool
   { /////////////////////////////////////////////////////////////////
index ac21696..d094da4 100644 (file)
@@ -278,10 +278,6 @@ namespace zypp
 
         mutable shared_ptr<ResPoolProxy>      _poolProxy;
         mutable scoped_ptr<KnownRepositories> _knownRepositoriesPtr;
-
-      public:
-        /** \bug FAKE capindex */
-        const PoolTraits::CapItemContainerT   _caphashfake;
     };
     ///////////////////////////////////////////////////////////////////
 
index a856cf3..3263295 100644 (file)
@@ -28,8 +28,6 @@
 namespace zypp
 { /////////////////////////////////////////////////////////////////
 
-  class CapAndItem;
-
   ///////////////////////////////////////////////////////////////////
   namespace pool
   { /////////////////////////////////////////////////////////////////
@@ -141,24 +139,10 @@ namespace zypp
       typedef transform_iterator<Id2ItemValueSelector, Id2ItemT::const_iterator>
                                                         byIdent_iterator;
 
-
       /* list of known Repositories */
       typedef std::list<Repository>                    RepoContainerT;
       typedef RepoContainerT::const_iterator           repository_iterator;
 
-       
-      // internal organization
-      typedef std::list<zypp::CapAndItem>              CapItemContainerT;      // (why,who) pairs
-      typedef std::map<std::string,CapItemContainerT>  CapItemStoreT;          // capability.index -> (why,who) pairs
-      typedef std::map<Dep,CapItemStoreT>              DepCapItemContainerT;   // Dep -> (capability.index -> (why,who) pairs)
-
-      typedef CapItemContainerT::iterator              capitemiterator;
-      typedef CapItemContainerT::const_iterator                const_capitemiterator;
-      typedef CapItemContainerT::size_type             capitemsize_type;
-      /** hashed by capability index */
-      typedef const_capitemiterator                     byCapabilityIndex_iterator;
-
-
       typedef PoolImpl                   Impl;
       typedef shared_ptr<PoolImpl>       Impl_Ptr;
       typedef shared_ptr<const PoolImpl> Impl_constPtr;
index 1b17bb6..70d0011 100644 (file)
@@ -30,7 +30,6 @@
 #include "zypp/base/Algorithm.h"
 #include "zypp/ResPool.h"
 #include "zypp/ResFilters.h"
-#include "zypp/CapFilters.h"
 #include "zypp/sat/SATResolver.h"
 #include "zypp/sat/Pool.h"
 #include "zypp/sat/WhatProvides.h"
index 6f01d5d..6999c7b 100644 (file)
@@ -31,7 +31,6 @@
 #include "zypp/base/Algorithm.h"
 #include "zypp/ResPool.h"
 #include "zypp/ResFilters.h"
-#include "zypp/CapFilters.h"
 #include "zypp/RepoInfo.h"
 
 using namespace std;
index 868928c..5c00180 100644 (file)
@@ -34,7 +34,6 @@
 
 #include "zypp/ResFilters.h"
 #include "zypp/ResStatus.h"
-#include "zypp/CapAndItem.h"
 #include "zypp/NameKindProxy.h"
 #include "zypp/sat/SATResolver.h"
 #include "zypp/sat/Pool.h"
index 06ea1a2..d06a847 100644 (file)
@@ -29,7 +29,6 @@
 #include "zypp/base/Algorithm.h"
 #include "zypp/ResPool.h"
 #include "zypp/ResFilters.h"
-#include "zypp/CapFilters.h"
 #include "zypp/solver/detail/ProblemSolutionUnlock.h"
 
 using namespace std;
index 0af7fed..d44ae77 100644 (file)
@@ -31,7 +31,6 @@
 #include "zypp/base/Algorithm.h"
 #include "zypp/ResPool.h"
 #include "zypp/ResFilters.h"
-#include "zypp/CapFilters.h"
 #include "zypp/sat/Pool.h"
 #include "zypp/sat/Solvable.h"
 #include "zypp/sat/SATResolver.h"
index 5929f44..dad663b 100644 (file)
@@ -46,7 +46,6 @@
 #include "zypp/ResPool.h"
 #include "zypp/ResStatus.h"
 #include "zypp/ResFilters.h"
-#include "zypp/CapFilters.h"
 #include "zypp/Capability.h"
 #include "zypp/VendorAttr.h"
 #include "zypp/Package.h"
index d08c005..8682f28 100644 (file)
@@ -34,7 +34,6 @@
 #include "zypp/base/Algorithm.h"
 #include "zypp/ResPool.h"
 #include "zypp/ResFilters.h"
-#include "zypp/CapFilters.h"
 
 
 /////////////////////////////////////////////////////////////////////////
index c2ee7fe..f382301 100644 (file)
@@ -31,7 +31,6 @@
 #include "zypp/ExternalProgram.h"
 #include "zypp/Repository.h"
 
-#include "zypp/CapMatchHelper.h"
 #include "zypp/ResFilters.h"
 #include "zypp/target/CommitLog.h"
 #include "zypp/target/TargetImpl.h"
@@ -137,63 +136,6 @@ namespace zypp
     } // namespace
     ///////////////////////////////////////////////////////////////////
 
-    ///////////////////////////////////////////////////////////////////
-    namespace
-    { /////////////////////////////////////////////////////////////////
-
-      /** Helper removing obsoleted non-Package from store. */
-      struct StorageRemoveObsoleted
-      {
-        StorageRemoveObsoleted(const PoolItem & byPoolitem_r )
-        : _byPoolitem( byPoolitem_r )
-        {}
-
-        bool operator()( const PoolItem & poolitem_r ) const
-        {
-          if ( ! poolitem_r.status().isInstalled() )
-            return true;
-
-          if ( isKind<Package>(poolitem_r.resolvable()) )
-            {
-              ERR << "Ignore unsupported Package/non-Package obsolete: "
-                  << _byPoolitem << " obsoletes " << poolitem_r << endl;
-              return true;
-            }
-
-          try
-            {
-               // delete poolitem_r.resolvable()
-               MIL<< "Obsoleted: " << poolitem_r << " (by " << _byPoolitem << ")" << endl;
-            }
-          catch ( Exception & excpt_r )
-            {
-              ZYPP_CAUGHT( excpt_r );
-              WAR << "Failed obsolete: " << poolitem_r << " (by " << _byPoolitem << ")" << endl;
-            }
-
-          return true;
-        }
-
-      private:
-        const PoolItem               _byPoolitem;
-      };
-
-      /** Helper processing non-Package obsoletes.
-      *
-      * Scan \a pool_r for items obsoleted \a byPoolitem_r and remove them from
-      * \a storage_r.
-      */
-      void obsoleteMatchesFromStorage( const ResPool & pool_r,
-                                       const PoolItem & byPoolitem_r )
-      {
-        forEachPoolItemMatchedBy( pool_r, byPoolitem_r, Dep::OBSOLETES,
-                                  OncePerPoolItem( StorageRemoveObsoleted( byPoolitem_r ) ) );
-      }
-
-      /////////////////////////////////////////////////////////////////
-    } // namespace
-    ///////////////////////////////////////////////////////////////////
-
     /** Helper for PackageProvider queries during commit. */
     struct QueryInstalledEditionHelper
     {
@@ -641,9 +583,6 @@ namespace zypp
         {
           if (it->status().isToBeInstalled())
           {
-            // Process OBSOLETES and remove them from store.
-            obsoleteMatchesFromStorage( pool_r, *it );
-
             bool success = false;
             try
             {
index dc25557..7cdbb2f 100644 (file)
@@ -17,7 +17,6 @@
 #include "zypp/base/Algorithm.h"
 #include "zypp/base/Function.h"
 #include "zypp/ResPool.h"
-#include "zypp/CapMatchHelper.h"
 
 using std::endl;
 
@@ -91,16 +90,11 @@ namespace zypp
       /** Store Patterns matching an \c Includes capability in \c _patternMap. */
       void expandInclude( const Capability & include_r )
       {
-        forEachMatchIn( _pool, Dep::PROVIDES, include_r,
-                        bind( &Impl::storeIncludeMatch, this, _1 ) );
-      }
-
-      /** Store a Pattern in \c _patternMap. */
-      bool storeIncludeMatch( const CapAndItem & capitem_r )
-      {
-        _patternMap[asKind<Pattern>(capitem_r.item)];
-        //DBG << mapEntry(*_patternMap.find(asKind<Pattern>(capitem_r.item))) << endl;
-        return true;
+        sat::WhatProvides w( include_r );
+        for_( it, w.begin(), w.end() )
+        {
+          _patternMap[asKind<Pattern>(PoolItem(*it))];
+        }
       }
 
     private:
@@ -134,19 +128,17 @@ namespace zypp
       /** Return true if Capability \c extends_r is provided by Pattern. */
       bool providedBy( const Pattern::constPtr & pat_r, const Capability & extends_r )
       {
-        std::string index( extends_r.index() );
-        return( std::find_if( _pool.byCapabilityIndexBegin( index, Dep::PROVIDES ),
-                              _pool.byCapabilityIndexEnd( index, Dep::PROVIDES ),
-                              bind( &Impl::providedByFilter, this, pat_r, extends_r, _1 ) )
-                != _pool.byCapabilityIndexEnd( index, Dep::PROVIDES ) );
-      }
-
-      /** Return true if \c capitem_r refers to \c pat_r and matches \c extends_r. */
-      bool providedByFilter( const Pattern::constPtr & pat_r, const Capability & extends_r,
-                             const CapAndItem & capitem_r ) const
-      {
-        return( capitem_r.item == pat_r
-                && extends_r.matches( capitem_r.cap ) == CapMatch::yes );
+        if ( !pat_r )
+          return false;
+
+        sat::Solvable pat( pat_r->satSolvable() );
+        sat::WhatProvides w( extends_r );
+        for_( it, w.begin(), w.end() )
+        {
+          if ( pat == *it )
+            return true;
+        }
+        return false;
       }
 
     private: