Remove deprecated old InstallOrder computation code
authorMichael Andres <ma@suse.de>
Fri, 10 May 2013 10:22:12 +0000 (12:22 +0200)
committerMichael Andres <ma@suse.de>
Fri, 10 May 2013 10:22:12 +0000 (12:22 +0200)
16 files changed:
devel/devel.ma/CleandepsOnRemove.cc
devel/devel.ma/DumpSolv.cc
devel/devel.ma/Ex.cc
devel/devel.ma/Iorder.cc [deleted file]
devel/devel.ma/MaTest.cc
devel/devel.ma/Main.cc
devel/devel.ma/NewPool.cc
devel/devel.ma/Parse.cc
devel/devel.ma/TransList.cc
zypp/CMakeLists.txt
zypp/pool/GetResolvablesToInsDel.cc [deleted file]
zypp/pool/GetResolvablesToInsDel.h [deleted file]
zypp/solver/detail/InstallOrder.cc [deleted file]
zypp/solver/detail/InstallOrder.h [deleted file]
zypp/solver/libzypp_solver.h
zypp/target/TargetImpl.cc

index 003de04..7a378e6 100644 (file)
@@ -3,7 +3,7 @@
 #include <zypp/PoolQuery.h>
 #include <zypp/target/rpm/librpmDb.h>
 #include <zypp/parser/ProductFileReader.h>
-#include "zypp/pool/GetResolvablesToInsDel.h"
+
 #include "zypp/sat/WhatObsoletes.h"
 #include "zypp/ExternalProgram.h"
 
index 86c3329..ad93024 100644 (file)
@@ -2,7 +2,7 @@
 
 #include <zypp/ResObjects.h>
 #include <zypp/sat/WhatObsoletes.h>
-#include "zypp/pool/GetResolvablesToInsDel.h"
+
 
 static std::string appname( __FILE__ );
 static TestSetup test;
index 97a49b7..915644c 100644 (file)
@@ -18,7 +18,7 @@
 #include "zypp/Language.h"
 #include "zypp/Digest.h"
 #include "zypp/PackageKeyword.h"
-#include "zypp/pool/GetResolvablesToInsDel.h"
+
 
 #include "zypp/parser/TagParser.h"
 #include "zypp/parser/susetags/PackagesFileReader.h"
diff --git a/devel/devel.ma/Iorder.cc b/devel/devel.ma/Iorder.cc
deleted file mode 100644 (file)
index f3eb14f..0000000
+++ /dev/null
@@ -1,475 +0,0 @@
-#include "Tools.h"
-#include <zypp/ResObjects.h>
-#include <zypp/ProgressData.h>
-#include <zypp/sat/WhatObsoletes.h>
-
-#include "zypp/pool/GetResolvablesToInsDel.h"
-
-void Dbg( ui::Selectable::Ptr s )
-{
-  SEC << dump(s) << endl;
-  if ( s->installedObj() )
-  {
-    PoolItem pi( s->installedObj() );
-    DBG << pi.satSolvable().obsoletes() << endl;
-    sat::WhatObsoletes obs( pi );
-    INT << "WhatObsoletes " <<  pi << " " << obs << endl;
-  }
-  if ( s->candidateObj() )
-  {
-    PoolItem pi( s->candidateObj() );
-    DBG << pi.satSolvable().obsoletes() << endl;
-    sat::WhatObsoletes obs( pi );
-    INT << "WhatObsoletes " <<  pi << " " << obs << endl;
-  }
-
-}
-
-///////////////////////////////////////////////////////////////////
-
-static std::string appname( "ToolIorder" );
-
-void message( const std::string & msg_r )
-{
-  cerr << "*** " << msg_r << endl;
-}
-
-int usage( const std::string & msg_r = std::string(), int exit_r = 100 )
-{
-  if ( ! msg_r.empty() )
-  {
-    cerr << endl;
-    message( msg_r );
-    cerr << endl;
-  }
-  cerr << "Usage: " << appname << "[OPTIONS] TESTCASE" << endl;
-  cerr << "  Load testcase and analyze install order." << endl;
-  return exit_r;
-}
-
-///////////////////////////////////////////////////////////////////
-
-
-bool progressReceiver( const ProgressData & v )
-{
-  DBG << "...->" << v << endl;
-  return true;
-}
-
-///////////////////////////////////////////////////////////////////
-
-#define LCStack   "IOrder::Stack"
-#define LCCache   "IOrder::Cache"
-#define LCVerbose "IOrder::Verbose"
-
-struct RunnableCache
-{
-  typedef std::tr1::unordered_map<sat::Solvable,TriBool> CacheType;
-  typedef std::vector<sat::Solvable>                     AnalyzeStack;
-
-  RunnableCache()
-  : _ltag( "[0000]" )
-  {}
-
-  /**
-   * Test whether there is a runnable provider for each requirement.
-   */
-  bool isRunnable( const PoolItem & pi ) const
-  { return isRunnable( pi.satSolvable() ); }
-
-  bool isRunnable( sat::Solvable solv_r ) const
-  {
-    SEC << "Runnable?       " << solv_r << endl;
-    if ( _isRunnable( solv_r ) )
-    {
-      MIL << "Runnable:       " << solv_r << endl;
-      return true;
-    }
-    ERR << "NotRunnable:    " << solv_r << endl;
-    return false;
-  }
-
-  /**
-   * Test whether there is a runnable provider for each pre-requirement.
-   */
-  bool isInstallable( const PoolItem & pi ) const
-  { return isInstallable( pi.satSolvable() ); }
-
-  bool isInstallable( sat::Solvable solv_r ) const
-  {
-    SEC << "Installable?    " << solv_r << endl;
-    tribool & cent( get( solv_r ) ); // if (cached) runnable then also installable.
-    if ( cent || checkCaps( solv_r.prerequires() ) )
-    {
-      MIL << "Installable:    " << solv_r << endl;
-      return true;
-    }
-    ERR << "NotInstallable: " << solv_r << endl;
-    return false;
-  }
-
-  /** Clear the cache. */
-  void clear() const
-  {
-    _cache.clear();
-    _stack.clear();
-    _ltag = "[0000]";
-    _INT(LCCache) << "Cache cleared!" << endl;
-  }
-
-  private:
-    /** Internal version without loging for recursive calls. */
-    bool _isRunnable( const PoolItem & pi ) const
-    { return _isRunnable( pi.satSolvable() ); }
-
-    bool _isRunnable( sat::Solvable solv_r ) const
-    {
-      tribool & cent( get( solv_r ) );
-      if ( indeterminate( cent ) )
-        cent = analyze( solv_r );
-      return cent;
-    }
-
-    /**
-     * Determine whether this solvable is runnable.
-     */
-    bool analyze( sat::Solvable solv_r ) const
-    {
-      if ( ! push( solv_r ) )
-      {
-        if ( _stack.back() != solv_r )
-          _SEC(LCStack) << _ltag << "** CYCLE: " << solv_r << " " << _stack << endl;
-        // else it's a self requirement
-        return true; // assume runnable?
-      }
-      _INT(LCStack) << _ltag << "->" << solv_r << " " << _stack << endl;
-      bool ret = checkCaps( solv_r.requires() );
-      _INT(LCStack) << _ltag << "<-" << solv_r << " " << _stack << endl;
-      if ( ! pop( solv_r ) )
-      {
-        _SEC(LCStack) << "** Stack corrupted! Expect " << solv_r << " " << _stack << endl;
-      }
-      return ret;
-    }
-
-    /**
-     * For each capability find a runnable provider.
-     */
-    bool checkCaps( Capabilities caps_r ) const
-    {
-      for_( it, caps_r.begin(), caps_r.end() )
-      {
-        if ( ! findRunnableProvider( *it ) )
-          return false;
-      }
-      return true;
-    }
-
-    /**
-     * Find a runnable provider of a capability on system.
-     *
-     * A runnable package is already installed and all of
-     * its requirements are met by runnable packages.
-     */
-    bool findRunnableProvider( Capability cap_r ) const
-    {
-      _MIL(LCVerbose) << _ltag << "  " << cap_r << endl;
-      sat::WhatProvides prv( cap_r );
-      for_( pit, prv.begin(), prv.end() )
-      {
-        if ( ! *pit )
-        {
-          _DBG(LCVerbose) << _ltag << "     by system" << endl;
-          return true; // noSolvable provides: i.e. system provides
-        }
-
-        PoolItem pi( *pit );
-        if ( pi.status().onSystem() )
-        {
-          if ( _isRunnable( pi ) )
-          {
-            _DBG(LCVerbose) << _ltag << "    " << pi << endl;
-            return true;
-          }
-          else
-          {
-            _WAR(LCVerbose) << _ltag << "    " << pi << endl;
-          }
-        }
-      }
-      ERR << _ltag << "    NO runnable provider for " << cap_r << endl;
-      return false;
-    }
-
-  private:
-    /** Push a new solvable to the AnalyzeStack, or return false is already on stack. */
-    bool push( sat::Solvable solv_r ) const
-    {
-      if ( find( _stack.begin(), _stack.end(), solv_r ) == _stack.end() )
-      {
-        _stack.push_back( solv_r );
-        _ltag = str::form( "[%04lu]", _stack.size() );
-        return true;
-      }
-      // cycle?
-      return false;
-    }
-
-    /** Pop solvable from AnalyzeStack (expecting it to be \c solv_r). */
-    bool pop( sat::Solvable solv_r ) const
-    {
-      if ( _stack.back() == solv_r )
-      {
-        _stack.pop_back();
-        _ltag = str::form( "[%04lu]", _stack.size() );
-        return true;
-      }
-      // stack corrupted?
-      return false;
-    }
-
-    /** Return cache entry, initializing new entries with \ref indeterminate.*/
-    tribool & get( sat::Solvable solv_r ) const
-    {
-      CacheType::iterator it( _cache.find( solv_r ) );
-      if ( it == _cache.end() )
-        return (_cache[solv_r] = indeterminate);
-      return _cache[solv_r];
-    }
-
-    mutable CacheType    _cache;
-    mutable AnalyzeStack _stack;
-    mutable std::string  _ltag;
-};
-
-RunnableCache rcache;
-
-//==================================================
-
-bool upgrade()
-{
-  bool rres = false;
-  {
-    zypp::base::LogControl::TmpLineWriter shutUp;
-    rres = getZYpp()->resolver()->doUpgrade();
-  }
-  if ( ! rres )
-  {
-    ERR << "upgrade " << rres << endl;
-    getZYpp()->resolver()->problems();
-    return false;
-  }
-  MIL << "upgrade " << rres << endl;
-  return true;
-}
-
-bool solve()
-{
-  static unsigned run = 0;
-  USR << "Solve " << run++ << endl;
-  bool rres = false;
-  {
-    zypp::base::LogControl::TmpLineWriter shutUp;
-    rres = getZYpp()->resolver()->resolvePool();
-  }
-  if ( ! rres )
-  {
-    ERR << "resolve " << rres << endl;
-    getZYpp()->resolver()->problems();
-    return false;
-  }
-
-  return true;
-}
-
-void display( const pool::GetResolvablesToInsDel & collect, std::set<IdString> interested )
-{
-  if ( ! interested.empty() )
-  {
-    USR << "======================================================================" << endl;
-    USR << "=== INTERESTED" << endl;
-    USR << "======================================================================" << endl;
-    for_( it, interested.begin(), interested.end() )
-    {
-      MIL << dump(ui::Selectable::get( *it )) << endl;
-    }
-  }
-
-  USR << "======================================================================" << endl;
-  USR << "=== DELETE" << endl;
-  USR << "======================================================================" << endl;
-  if ( 1 )
-  {
-    ProgressData tics( collect._toDelete.size() );
-    tics.name( "DELETE" );
-    tics.sendTo( &progressReceiver );
-    tics.toMin();
-
-    for_( it, collect._toDelete.begin(), collect._toDelete.end() )
-    {
-      tics.incr();
-
-      it->status().setTransact( true, ResStatus::USER );
-//       vdumpPoolStats( SEC << "Transacting:"<< endl,
-//                       make_filter_begin<resfilter::ByTransact>(pool),
-//                       make_filter_end<resfilter::ByTransact>(pool) ) << endl;
-
-      if ( !interested.empty() && interested.find( it->satSolvable().ident() ) == interested.end() )
-      {
-        MIL << "..." << *it << endl;
-        continue;
-      }
-
-      rcache.clear();
-      if ( ! rcache.isInstallable( *it ) )
-      {
-        USR << "FAILED DEL " << *it << endl;
-      }
-    }
-  }
-
-  USR << "======================================================================" << endl;
-  USR << "=== INSTALL" << endl;
-  USR << "======================================================================" << endl;
-  if ( 1 )
-  {
-    ProgressData tics( collect._toInstall.size() );
-    tics.name( "INSTALL" );
-    tics.sendTo( progressReceiver );
-    tics.toMin();
-
-
-    for_( it, collect._toInstall.begin(), collect._toInstall.end() )
-    {
-      tics.incr();
-
-      ui::Selectable::Ptr p( ui::Selectable::get( *it ) );
-      p->setCandidate( *it );
-      p->setToInstall(); // also deletes the installed one
-//       vdumpPoolStats( SEC << "Transacting:"<< endl,
-//                       make_filter_begin<resfilter::ByTransact>(pool),
-//                       make_filter_end<resfilter::ByTransact>(pool) ) << endl;
-
-
-      if ( !interested.empty() && interested.find( p->ident() ) == interested.end() )
-      {
-        MIL << "..." << *it << endl;
-        continue;
-      }
-
-      rcache.clear();
-
-      for_( it, p->installedBegin(), p->installedEnd() )
-      {
-        if ( ! rcache.isInstallable( *it ) )
-        {
-          USR << "FAILED OLD " << *it << endl;
-        }
-      }
-      sat::WhatObsoletes obs( *it );
-      for_( it, obs.begin(), obs.end() )
-      {
-        if ( ! rcache.isInstallable( *it ) )
-        {
-          USR << "FAILED OBS " << *it << endl;
-        }
-      }
-
-
-      if ( ! rcache.isInstallable( *it ) )
-      {
-        USR << "FAILED INS " << *it << endl;
-      }
-    }
-  }
-}
-
-void display( const pool::GetResolvablesToInsDel & collect, IdString ident_r )
-{
-  std::set<IdString> interested;
-  interested.insert( ident_r );
-  display( collect, interested );
-}
-
-
-void display( const pool::GetResolvablesToInsDel & collect )
-{
-  std::set<IdString> interested;
-  display( collect, interested );
-}
-
-
-/******************************************************************
-**
-**      FUNCTION NAME : main
-**      FUNCTION TYPE : int
-*/
-int main( int argc, char * argv[] )
-{
-  INT << "===[START]==========================================" << endl;
-  appname = Pathname::basename( argv[0] );
-  --argc;
-  ++argv;
-
-  if ( ! argc )
-  {
-    return usage();
-  }
-
-  ///////////////////////////////////////////////////////////////////
-
-  Pathname mtest( "/suse/ma/BUGS/439802/bug439802/YaST2/solverTestcase" );
-  Arch     march( Arch_ppc64 );
-
-  while ( argc )
-  {
-    --argc;
-    ++argv;
-  }
-
-  if ( mtest.empty() )
-  {
-    return usage( "Missing Testcase", 102 );
-  }
-
-  ///////////////////////////////////////////////////////////////////
-
-  TestSetup test( march );
-  ResPool   pool( test.pool() );
-  sat::Pool satpool( test.satpool() );
-
-  {
-    zypp::base::LogControl::TmpLineWriter shutUp;
-    test.loadTarget();
-    test.loadTestcaseRepos( mtest ); // <<< repos
-  }
-  test.poolProxy().saveState();
-
-  { // <<< transaction
-    zypp::base::LogControl::TmpLineWriter shutUp;
-    getPi<Product>( "SUSE_SLES", Edition("11-0"), Arch_ppc64 ).status().setTransact( true, ResStatus::USER );
-    vdumpPoolStats( USR << "Transacting:"<< endl,
-                  make_filter_begin<resfilter::ByTransact>(pool),
-                  make_filter_end<resfilter::ByTransact>(pool) ) << endl;
-    upgrade();
-  }
-  vdumpPoolStats( USR << "Transacting:"<< endl,
-                  make_filter_begin<resfilter::ByTransact>(pool),
-                  make_filter_end<resfilter::ByTransact>(pool) ) << endl;
-
-  pool::GetResolvablesToInsDel collect( pool, pool::GetResolvablesToInsDel::ORDER_BY_MEDIANR );
-
-
-
-  test.poolProxy().restoreState();
-  {
-    base::LogControl::TmpLineWriter shutUp( new log::FileLineWriter( "iorder.log" ) );
-    std::set<IdString> interested;
-    //interested.insert( IdString("fillup") );
-    display( collect, interested );
-  }
-
-  INT << "===[END]============================================" << endl << endl;
-  zypp::base::LogControl::TmpLineWriter shutUp;
-  return 0;
-}
index 6791aac..24bd198 100644 (file)
@@ -24,7 +24,7 @@
 #include "zypp/PackageKeyword.h"
 #include "zypp/TmpPath.h"
 #include "zypp/ManagedFile.h"
-#include "zypp/pool/GetResolvablesToInsDel.h"
+
 
 #include "zypp/RepoManager.h"
 #include "zypp/Repository.h"
index 513cb09..8644aa7 100644 (file)
@@ -3,7 +3,7 @@
 #include <zypp/PoolQuery.h>
 #include <zypp/target/rpm/librpmDb.h>
 #include <zypp/parser/ProductFileReader.h>
-#include "zypp/pool/GetResolvablesToInsDel.h"
+
 #include "zypp/sat/WhatObsoletes.h"
 #include "zypp/ExternalProgram.h"
 
index d96c453..a8cf123 100644 (file)
@@ -25,7 +25,7 @@
 #include "zypp/TmpPath.h"
 #include "zypp/ManagedFile.h"
 #include "zypp/MediaSetAccess.h"
-#include "zypp/pool/GetResolvablesToInsDel.h"
+
 
 #include "zypp/RepoManager.h"
 #include "zypp/Repository.h"
index 2847296..c9e1a49 100644 (file)
@@ -19,7 +19,7 @@
 #include "zypp/Digest.h"
 #include "zypp/PackageKeyword.h"
 #include "zypp/ManagedFile.h"
-#include "zypp/pool/GetResolvablesToInsDel.h"
+
 
 #include "zypp/parser/TagParser.h"
 #include "zypp/parser/susetags/PackagesFileReader.h"
index 94a66d7..e644a34 100644 (file)
@@ -3,7 +3,7 @@
 #include <zypp/PoolQuery.h>
 #include <zypp/target/rpm/librpmDb.h>
 #include <zypp/parser/ProductFileReader.h>
-#include "zypp/pool/GetResolvablesToInsDel.h"
+
 #include "zypp/sat/WhatObsoletes.h"
 #include "zypp/ExternalProgram.h"
 #include <zypp/ZYppCallbacks.h>
@@ -163,42 +163,6 @@ bool install()
 
 ///////////////////////////////////////////////////////////////////
 
-namespace zypp
-{
-  void tradOrder()
-  {
-    scoped_ptr<base::LogControl::TmpLineWriter> shutUp( new base::LogControl::TmpLineWriter );
-    ResPool pool( ResPool::instance() );
-    pool::GetResolvablesToInsDel collect( pool, pool::GetResolvablesToInsDel::ORDER_BY_SOURCE );
-    shutUp.reset();
-
-    MIL << "GetResolvablesToInsDel -" << collect._toDelete.size()
-    << " +" << (collect._toInstall.size() + collect._toSrcinstall.size()) << " {" << endl;
-    for_( it, collect._toDelete.begin(), collect._toDelete.end() )
-    {
-      MIL << " - " << *it << endl;
-    }
-    for_( it, collect._toInstall.begin(), collect._toInstall.end() )
-    {
-      MIL << " + " << *it << endl;
-    }
-    for_( it, collect._toSrcinstall.begin(), collect._toSrcinstall.end() )
-    {
-      MIL << " + " << *it << endl;
-    }
-    MIL << "}" << endl;
-  }
-
-}
-///////////////////////////////////////////////////////////////////
-
-void checkTrans()
-{
-  ResPool pool( ResPool::instance() );
-  pool::GetResolvablesToInsDel collect( pool, pool::GetResolvablesToInsDel::ORDER_BY_SOURCE );
-  collect.debugDiffTransaction();
-}
-
 template <class _Iter>
 unsigned count( _Iter begin, _Iter end )
 {
index 5b406ff..b3a0d50 100644 (file)
@@ -470,13 +470,11 @@ INSTALL(  FILES
 
 
 SET( zypp_pool_SRCS
-  pool/GetResolvablesToInsDel.cc
   pool/PoolImpl.cc
   pool/PoolStats.cc
 )
 
 SET( zypp_pool_HEADERS
-  pool/GetResolvablesToInsDel.h
   pool/PoolImpl.h
   pool/PoolStats.h
   pool/PoolTraits.h
@@ -490,7 +488,6 @@ INSTALL(  FILES
 
 SET( zypp_solver_detail_SRCS
   solver/detail/Helper.cc
-  solver/detail/InstallOrder.cc
   solver/detail/ProblemSolutionIgnore.cc
   solver/detail/ProblemSolutionCombi.cc
   solver/detail/Resolver.cc
@@ -508,7 +505,6 @@ SET( zypp_solver_detail_SRCS
 
 SET( zypp_solver_detail_HEADERS
   solver/detail/Helper.h
-  solver/detail/InstallOrder.h
   solver/detail/ProblemSolutionIgnore.h
   solver/detail/ProblemSolutionCombi.h
   solver/detail/Resolver.h
diff --git a/zypp/pool/GetResolvablesToInsDel.cc b/zypp/pool/GetResolvablesToInsDel.cc
deleted file mode 100644 (file)
index a6d799c..0000000
+++ /dev/null
@@ -1,366 +0,0 @@
-/*---------------------------------------------------------------------\
-|                          ____ _   __ __ ___                          |
-|                         |__  / \ / / . \ . \                         |
-|                           / / \ V /|  _/  _/                         |
-|                          / /__ | | | | | |                           |
-|                         /_____||_| |_| |_|                           |
-|                                                                      |
-\---------------------------------------------------------------------*/
-/** \file      zypp/pool/GetResolvablesToInsDel.cc
- *
-*/
-#include <iostream>
-#include <set>
-
-#include "zypp/base/LogTools.h"
-#include "zypp/base/LogControl.h"
-#include "zypp/sat/Solvable.h"
-#include "zypp/sat/WhatObsoletes.h"
-#include "zypp/pool/GetResolvablesToInsDel.h"
-#include "zypp/pool/PoolStats.h"
-#include "zypp/solver/detail/InstallOrder.h"
-
-#include "zypp/Resolver.h"
-#include "zypp/sat/Transaction.h"
-
-using std::endl;
-using zypp::solver::detail::InstallOrder;
-
-#undef  ZYPP_BASE_LOGGER_LOGGROUP
-#define ZYPP_BASE_LOGGER_LOGGROUP "zypp::GetResolvablesToInsDel"
-
-///////////////////////////////////////////////////////////////////
-namespace zypp
-{ /////////////////////////////////////////////////////////////////
-  ///////////////////////////////////////////////////////////////////
-  namespace pool
-  { /////////////////////////////////////////////////////////////////
-
-    /******************************************************************
-     **
-     **        FUNCTION NAME : strip_obsoleted_to_delete
-     **        FUNCTION TYPE : void
-     **
-     ** strip packages to_delete which get obsoleted by
-     ** to_install (i.e. delay deletion in case the
-     ** obsoleting package likes to save whatever...
-    */
-
-    static void
-    strip_obsoleted_to_delete( GetResolvablesToInsDel::PoolItemList & deleteList_r,
-                               const GetResolvablesToInsDel::PoolItemList & instlist_r )
-    {
-      if ( deleteList_r.size() == 0 || instlist_r.size() == 0 )
-        return; // ---> nothing to do
-
-      // These are all installed packages obsoleted by any package to be installed.
-      // Actually we expect all of them to appear in the deleteList_r, and we want
-      // to kick them out. Rpm will delete them when the obsoleter gets installed.
-      sat::WhatObsoletes obsoleted( instlist_r.begin(), instlist_r.end() );
-      for_( it, obsoleted.poolItemBegin(), obsoleted.poolItemEnd() )
-      {
-        DBG << "Ignore appl_delete (should be obsoleted): " << *it << endl;
-        deleteList_r.remove( *it );
-      }
-
-      MIL << "Undelayed deletes: " << deleteList_r << endl;
-    }
-
-    ///////////////////////////////////////////////////////////////////
-    //
-    // METHOD NAME : GetResolvablesToInsDel::GetResolvablesToInsDel
-    // METHOD TYPE : Ctor
-    //
-    GetResolvablesToInsDel::GetResolvablesToInsDel( ResPool pool_r, Order order_r )
-    {
-      zypp::base::LogControl::TmpLineWriter shutUp;
-      typedef std::set<PoolItem> PoolItemSet;
-
-      PoolItemList & dellist_r( _toDelete );
-      PoolItemList & instlist_r( _toInstall );
-      PoolItemList & srclist_r( _toSrcinstall );
-
-      for ( ResPool::const_iterator it = pool_r.begin(); it != pool_r.end(); ++it )
-        {
-          if (it->status().isToBeInstalled())
-            {
-              if ((*it)->kind() == ResKind::srcpackage) {
-               srclist_r.push_back( *it );
-              }
-              else
-               instlist_r.push_back( *it );
-            }
-          else if (it->status().isToBeUninstalled())
-            {
-              if ( it->status().isToBeUninstalledDueToObsolete() )
-                {
-                  DBG << "Ignore auto_delete (should be obsoleted): " << *it << endl;
-                }
-              else if ( it->status().isToBeUninstalledDueToUpgrade() )
-                {
-                  DBG << "Ignore auto_delete (should be upgraded): " << *it << endl;
-                }
-              else {
-               dellist_r.push_back( *it );
-              }
-            }
-        }
-
-      MIL << "ResolvablesToInsDel: delete " << dellist_r.size()
-      << ", install " << instlist_r.size()
-      << ", srcinstall " << srclist_r.size() << endl;
-
-      ///////////////////////////////////////////////////////////////////
-      //
-      // strip packages to_delete which get obsoleted by
-      // to_install (i.e. delay deletion in case the
-      // obsoleting package likes to save whatever...
-      //
-      ///////////////////////////////////////////////////////////////////
-      strip_obsoleted_to_delete( dellist_r, instlist_r );
-
-      if ( dellist_r.size() ) {
-        ///////////////////////////////////////////////////////////////////
-        //
-        // sort delete list...
-        //
-        ///////////////////////////////////////////////////////////////////
-        PoolItemSet delset( dellist_r.begin(), dellist_r.end() );  // for delete order
-        PoolItemSet dummy; // dummy, empty, should contain already installed
-
-        InstallOrder order( pool_r, delset, dummy ); // sort according top prereq
-        order.init();
-        const PoolItemList dsorted( order.getTopSorted() );
-
-        dellist_r.clear();
-        for ( PoolItemList::const_reverse_iterator cit = dsorted.rbegin();
-              cit != dsorted.rend(); ++cit )
-          {
-            dellist_r.push_back( *cit );
-          }
-      }
-
-      ///////////////////////////////////////////////////////////////////
-      //
-      // sort installed list...
-      //
-      ///////////////////////////////////////////////////////////////////
-      if ( instlist_r.empty() )
-        return;
-
-      ///////////////////////////////////////////////////////////////////
-      // Compute install order according to packages prereq.
-      // Try to group packages with respect to the desired install order
-      ///////////////////////////////////////////////////////////////////
-      // backup list for debug purpose.
-      // You can as well build the set, clear the list and rebuild it in install order.
-      PoolItemList instbackup_r;
-      instbackup_r.swap( instlist_r );
-
-      PoolItemSet insset( instbackup_r.begin(), instbackup_r.end() ); // for install order
-      PoolItemSet installed; // dummy, empty, should contain already installed
-
-      InstallOrder order( pool_r, insset, installed );
-      // start recursive depth-first-search
-      order.init();
-      MIL << "order.init() done" << endl;
-      order.printAdj( XXX, false );
-      ///////////////////////////////////////////////////////////////////
-      // build install list in install order
-      ///////////////////////////////////////////////////////////////////
-      PoolItemList best_list;
-      sat::detail::RepoIdType best_prio     = 0;
-      unsigned best_medianum = 0;
-
-      PoolItemList last_list;
-      sat::detail::RepoIdType last_prio     = 0;
-      unsigned last_medianum = 0;
-
-      PoolItemList other_list;
-
-      for ( PoolItemList items = order.computeNextSet(); ! items.empty(); items = order.computeNextSet() )
-        {
-          XXX << "order.computeNextSet: " << items.size() << " resolvables" << endl;
-          ///////////////////////////////////////////////////////////////////
-          // items contains all objects we could install now. Pick all objects
-          // from current media, or best media if none for current. Alwayys pick
-          // objects that do not require media access.
-          ///////////////////////////////////////////////////////////////////
-
-          best_list.clear();
-          last_list.clear();
-          other_list.clear();
-
-          for ( PoolItemList::iterator cit = items.begin(); cit != items.end(); ++cit )
-            {
-              ResObject::constPtr cobj( cit->resolvable() );
-              if (!cobj)
-                continue;
-
-              if ( ! cobj->mediaNr() ) {
-                XXX << "No media access required for " << *cit << endl;
-                order.setInstalled( *cit );
-                other_list.push_back( *cit );
-                continue;
-              }
-
-              if ( cobj->satSolvable().repository().id() == last_prio &&
-                   cobj->mediaNr() == last_medianum ) {
-                // prefer packages on current media.
-                XXX << "Stay with current media " << *cit << endl;
-                last_list.push_back( *cit );
-                continue;
-              }
-
-              if ( last_list.empty() ) {
-                // check for best media as long as there are no packages for current media.
-
-                if ( ! best_list.empty() ) {
-
-                  if ( order_r == ORDER_BY_MEDIANR )
-                    {
-                      if ( cobj->mediaNr() < best_medianum ) {
-                        best_list.clear(); // new best
-                      } else if ( cobj->mediaNr() == best_medianum ) {
-                        if ( cobj->satSolvable().repository().id() < best_prio ) {
-                          best_list.clear(); // new best
-                        } else if ( cobj->satSolvable().repository().id() == best_prio ) {
-                          XXX << "Add to best list " << *cit << endl;
-                          best_list.push_back( *cit ); // same as best -> add
-                          continue;
-                        } else {
-                          continue; // worse
-                        }
-                      } else {
-                        continue; // worse
-                      }
-                    }
-                  else // default: ORDER_BY_SOURCE
-                    {
-                      if ( cobj->satSolvable().repository().id() < best_prio ) {
-                        best_list.clear(); // new best
-                      } else if ( cobj->satSolvable().repository().id() == best_prio ) {
-                        if ( cobj->mediaNr() < best_medianum ) {
-                          best_list.clear(); // new best
-                        } else if ( cobj->mediaNr() == best_medianum ) {
-                          XXX << "Add to best list " << *cit << endl;
-                          best_list.push_back( *cit ); // same as best -> add
-                          continue;
-                        } else {
-                          continue; // worse
-                        }
-                      } else {
-                        continue; // worse
-                      }
-                    }
-                }
-
-                if ( best_list.empty() )
-                  {
-                    XXX << "NEW BEST LIST [S" << cobj->satSolvable().repository().id() << ":" << cobj->mediaNr()
-                        << "] (last [S" << best_prio << ":" << best_medianum << "])" << endl;
-                    best_prio     = cobj->satSolvable().repository().id();
-                    best_medianum = cobj->mediaNr();
-                    // first package or new best
-                    XXX << "Add to best list " << *cit << endl;
-                    best_list.push_back( *cit );
-                    continue;
-                  }
-              }
-
-            } // for all objects in current set
-
-          ///////////////////////////////////////////////////////////////////
-          // remove objects picked from install order and append them to
-          // install list.
-          ///////////////////////////////////////////////////////////////////
-          PoolItemList & take_list( last_list.empty() ? best_list : last_list );
-          if ( last_list.empty() )
-            {
-              MIL << "SET NEW media [S" << best_prio << ":" << best_medianum << "]" << endl;
-              last_prio     = best_prio;
-              last_medianum = best_medianum;
-            }
-          else
-            {
-              XXX << "SET CONTINUE [S" << best_prio << ":" << best_medianum << "]" << endl;
-            }
-
-          for ( PoolItemList::iterator it = take_list.begin(); it != take_list.end(); ++it )
-            {
-              order.setInstalled( *it );
-              XXX << "SET collect " << (*it) << endl;
-            }
-          // move everthing from take_list to the end of instlist_r, clean take_list
-          instlist_r.splice( instlist_r.end(), take_list );
-          // same for other_list
-          instlist_r.splice( instlist_r.end(), other_list );
-
-        } // for all sets computed
-
-
-      MIL << "order done" << endl;
-      if ( instbackup_r.size() != instlist_r.size() )
-        {
-          ERR << "***************** Lost packages in InstallOrder sort." << endl;
-        }
-
-    }
-
-    void GetResolvablesToInsDel::debugDiffTransaction() const
-    {
-      SEC << "START debugDiffTransaction" << endl;
-      sat::Transaction trans( ResPool::instance().resolver().getTransaction() );
-
-      {
-       const PoolItemList & clist( _toDelete );
-       for_( it, clist.begin(), clist.end() )
-       {
-         sat::Transaction::const_iterator ci( trans.find( *it ) );
-         if ( ci == trans.end() )
-           ERR << "Missing to del in NEW trans: " << *it << endl;
-       }
-      }
-      {
-       const PoolItemList & clist( _toInstall );
-       for_( it, clist.begin(), clist.end() )
-       {
-         sat::Transaction::const_iterator ci( trans.find( *it ) );
-         if ( ci == trans.end() )
-           ERR << "Missing to ins in NEW trans: " << *it << endl;
-       }
-      }
-      {
-       const PoolItemList & clist( _toSrcinstall );
-       for_( it, clist.begin(), clist.end() )
-       {
-         sat::Transaction::const_iterator ci( trans.find( *it ) );
-         if ( ci == trans.end() )
-           ERR << "Missing srcins in NEW trans: " << *it << endl;
-       }
-      }
-
-      SEC << "END debugDiffTransaction" << endl;
-    }
-
-    /******************************************************************
-     **
-     **        FUNCTION NAME : operator<<
-     **        FUNCTION TYPE : std::ostream &
-    */
-    std::ostream & operator<<( std::ostream & str, const GetResolvablesToInsDel & obj )
-    {
-      dumpPoolStats( str << "toInstall: " << endl,
-                     obj._toInstall.begin(), obj._toInstall.end() ) << endl;
-      dumpPoolStats( str << "toDelete: " << endl,
-                     obj._toDelete.begin(), obj._toDelete.end() ) << endl;
-      return str;
-    }
-
-    /////////////////////////////////////////////////////////////////
-  } // namespace pool
-  ///////////////////////////////////////////////////////////////////
-  /////////////////////////////////////////////////////////////////
-} // namespace zypp
-///////////////////////////////////////////////////////////////////
-
diff --git a/zypp/pool/GetResolvablesToInsDel.h b/zypp/pool/GetResolvablesToInsDel.h
deleted file mode 100644 (file)
index 5c184f7..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/*---------------------------------------------------------------------\
-|                          ____ _   __ __ ___                          |
-|                         |__  / \ / / . \ . \                         |
-|                           / / \ V /|  _/  _/                         |
-|                          / /__ | | | | | |                           |
-|                         /_____||_| |_| |_|                           |
-|                                                                      |
-\---------------------------------------------------------------------*/
-/** \file      zypp/pool/GetResolvablesToInsDel.h
- *
-*/
-#ifndef ZYPP_POOL_GETRESOLVABLESTOINSDEL_H
-#define ZYPP_POOL_GETRESOLVABLESTOINSDEL_H
-
-#include <iosfwd>
-#include <list>
-
-#include "zypp/ResPool.h"
-#include "zypp/APIConfig.h"
-
-///////////////////////////////////////////////////////////////////
-namespace zypp
-{ /////////////////////////////////////////////////////////////////
-  ///////////////////////////////////////////////////////////////////
-  namespace pool
-  { /////////////////////////////////////////////////////////////////
-
-    ///////////////////////////////////////////////////////////////////
-    //
-    // CLASS NAME : GetResolvablesToInsDel
-    //
-    /** Collect transacting items and sort according to prereqs and
-     *  media access.
-     *
-     * \deprecated Use class \ref sat::Transaction which does a better job
-     *             esp. when packages are to be deleted.
-     */
-    struct ZYPP_DEPRECATED GetResolvablesToInsDel
-    {
-      typedef std::list<PoolItem> PoolItemList;
-
-      /** Influences the sequence of sources and media proscessed.
-       * If true prefer a better source, otherwise a better media.
-       * \code
-       * ORDER_BY_SOURCE:  [S1:1], [S1:2], ... , [S2:1], [S2:2], ...
-       * ORDER_BY_MEDIANR: [S1:1], [S2:1], ... , [S1:2], [S2:2], ...
-       * \endcode
-       */
-      enum Order { ORDER_BY_SOURCE, ORDER_BY_MEDIANR };
-
-      /** */
-      GetResolvablesToInsDel( ResPool pool_r,
-                              Order order_r = ORDER_BY_SOURCE );
-
-      /** Diff with new style \ref Transacrion and write result to log. */
-      void debugDiffTransaction() const;
-
-      PoolItemList _toDelete;
-      PoolItemList _toInstall;
-      PoolItemList _toSrcinstall;
-    };
-    ///////////////////////////////////////////////////////////////////
-
-    /** \relates GetResolvablesToInsDel Stream output */
-    std::ostream & operator<<( std::ostream & str, const GetResolvablesToInsDel & obj );
-
-    /////////////////////////////////////////////////////////////////
-  } // namespace pool
-  ///////////////////////////////////////////////////////////////////
-  /////////////////////////////////////////////////////////////////
-} // namespace zypp
-///////////////////////////////////////////////////////////////////
-#endif // ZYPP_POOL_GETRESOLVABLESTOINSDEL_H
-
diff --git a/zypp/solver/detail/InstallOrder.cc b/zypp/solver/detail/InstallOrder.cc
deleted file mode 100644 (file)
index 74fc2a2..0000000
+++ /dev/null
@@ -1,376 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* InstallOrder.cc
- *
- * Copyright (C) 2005 SUSE Linux Products GmbH
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307, USA.
- */
-
-// stolen from yast2-packagemanager
-/*
-   File:       InstallOrder.h
-   Purpose:    Determine order for installing packages
-   Author:     Ludwig Nussel <lnussel@suse.de>
-   Maintainer: Ludwig Nussel <lnussel@suse.de>
-
-/-*/
-
-#include "zypp/solver/detail/InstallOrder.h"
-#include "zypp/base/LogTools.h"
-#include "zypp/base/Iterator.h"
-#include "zypp/base/Algorithm.h"
-
-#include "zypp/solver/detail/SATResolver.h"
-
-#include "zypp/ResFilters.h"
-#include "zypp/ResStatus.h"
-#include "zypp/sat/Pool.h"
-#include "zypp/sat/WhatObsoletes.h"
-
-/////////////////////////////////////////////////////////////////////////
-namespace zypp
-{ ///////////////////////////////////////////////////////////////////////
-  ///////////////////////////////////////////////////////////////////////
-  namespace solver
-  { /////////////////////////////////////////////////////////////////////
-    /////////////////////////////////////////////////////////////////////
-    namespace detail
-    { ///////////////////////////////////////////////////////////////////
-
-using namespace std;
-using namespace zypp;
-
-#define ITEMNAME(item) (item)->name()
-//-----------------------------------------------------------------------------
-
-InstallOrder::InstallOrder( const ResPool & pool, const PoolItemSet & toinstall, const PoolItemSet & installed )
-    : _pool( pool )
-    , _toinstall( toinstall )
-    , _installed( installed )
-    , _dirty (true)
-    , _numrun (0)
-{
-    _DEBUG("InstallOrder::InstallOrder(_toinstall " << _toinstall.size() << " items, _installed " << _installed.size() << " items)");
-}
-
-
-//-----------------------------------------------------------------------------
-
-void
-InstallOrder::printAdj (std::ostream& os, bool reversed) const
-{
-    const Graph& g = (reversed ? _rgraph : _graph);
-    os << "digraph pkgdeps {" << endl;
-    for (Graph::const_iterator gcit = g.begin(); gcit != g.end(); ++gcit)
-    {
-       Nodes::const_iterator niit = _nodes.find(gcit->first);
-       int order = niit->second.order;
-       string name = gcit->first->name();
-       os << "\"" << name << "\"" << "[label=\"" << name << "\\n" << order << "\"";
-       os << "] " << endl;
-       for (PoolItemList::const_iterator scit = gcit->second.begin(); scit != gcit->second.end(); ++scit)
-       {
-           os << "\"" << name << "\" -> \"" << (*scit)->name() << "\"" << endl;
-       }
-    }
-    os << "}" << endl;
-}
-
-
-//-----------------------------------------------------------------------------
-
-// yea, that stuff is suboptimal. there should be a heap sorted by order
-PoolItemList
-InstallOrder::computeNextSet()
-{
-    PoolItemList newlist;
-
-    if (_dirty) startrdfs();
-
-    for (Nodes::iterator it = _nodes.begin(); it != _nodes.end(); ++it)
-    {
-       if (it->second.order == 0
-           && it->second.item)                 // the default Nodes constructor leaves this empty
-       {
-           XXX << "InstallOrder::computeNextSet found " << ITEMNAME(it->second.item) << endl;
-
-           newlist.push_back(it->second.item);
-       }
-    }
-
-    return newlist;
-}
-
-
-// decrease order of every adjacent node
-void
-InstallOrder::setInstalled(PoolItem item )
-{
-    _dirty = true;
-
-    PoolItemList adj = _rgraph[item];
-
-    XXX << "InstallOrder::setInstalled " << ITEMNAME(item) << endl;
-
-    // order will be < 0
-    _nodes[item].order--;
-    _installed.insert( item );
-    _toinstall.erase( item );
-
-    for (PoolItemList::iterator it = adj.begin(); it != adj.end(); ++it)
-    {
-       NodeInfo& info = _nodes[*it];
-       info.order--;
-       if (info.order < 0)
-       {
-           WAR << "order of node " << (*it) << " is < 0" << endl;
-       }
-    }
-}
-
-
-void
-InstallOrder::setInstalled( const PoolItemList & rl )
-{
-    for (PoolItemList::const_iterator it = rl.begin(); it != rl.end(); ++it)
-    {
-       setInstalled(*it);
-    }
-}
-
-//-----------------------------------------------------------------------------
-
-bool
-InstallOrder::doesProvide( const Capability requirement, PoolItem item ) const
-{
-    Capabilities::const_iterator pend = item->dep( Dep::PROVIDES ).end();
-    for( Capabilities::const_iterator pit = item->dep( Dep::PROVIDES ).begin(); pit != pend; ++pit) {
-       if( pit->matches( requirement ) == CapMatch::yes ) {
-           return true;
-       }
-    }
-    return false;
-}
-
-
-PoolItem
-InstallOrder::findProviderInSet( const Capability requirement, const PoolItemSet & candidates ) const
-{
-    for( PoolItemSet::const_iterator citer = candidates.begin(); citer != candidates.end(); citer++) {
-       if( doesProvide( requirement, *citer ) ) {
-           return *citer;
-       }
-    }
-
-    return PoolItem();
-}
-
-//-----------------------------------------------------------------------------
-
-
-void
-InstallOrder::rdfsvisit (const PoolItem item)
-{
-    typedef list<Capability> CapList;
-    CapList requires;
-
-    XXX << "InstallOrder::rdfsvisit, visiting " << ITEMNAME(item) << endl;
-
-    NodeInfo& nodeinfo = _nodes[item];
-
-    nodeinfo.visited = true;
-    nodeinfo.begintime = _rdfstime;
-    _rdfstime++;
-
-    // items prereq
-    CapabilitySet prq( item->dep(Dep::PREREQUIRES).begin(), item->dep(Dep::PREREQUIRES).end() );
-    // an installed items prereq (in case they are reqired for uninstall scripts)
-    ui::Selectable::Ptr sel( ui::Selectable::get( item ) );
-    for_( it, sel->installedBegin(), sel->installedEnd() )
-    {
-      Capabilities p( it->satSolvable().prerequires() );
-      prq.insert( p.begin(), p.end() );
-    }
-    // any obsoleted items prereq (in case they are reqired for uninstall scripts)
-    sat::WhatObsoletes obs( item );
-    for_( it, obs.begin(), obs.end() )
-    {
-      Capabilities p( it->prerequires() );
-      prq.insert( p.begin(), p.end() );
-    }
-    // put prerequires first and requires last on list to ensure
-    // that prerequires are processed first
-    for (CapabilitySet::const_iterator it = prq.begin(); it != prq.end(); ++it)
-    {
-       requires.push_back(*it);
-    }
-
-    // Product requirements are ignored to assert Product gets installed
-    // as early as possible. Some stuff depends on it (e.g. registration).
-    if ( ! isKind<Product>( item.resolvable() ) )
-      {
-        for (Capabilities::const_iterator it = item->dep (Dep::REQUIRES).begin(); it != item->dep (Dep::REQUIRES).end(); ++it)
-          {
-            requires.push_back(*it);
-          }
-      }
-
-    for (CapList::const_iterator iter = requires.begin(); iter != requires.end(); ++iter)
-    {
-        bool goBack = false;
-       const Capability requirement = *iter;
-        PoolItemList providers;
-
-       XXX << "check requirement " << requirement << " of " << ITEMNAME(item) << endl;
-        SATResolver satResolver(_pool, sat::Pool::instance().get());
-       PoolItemList tovisit;
-        sat::WhatProvides possibleProviders(requirement);
-
-       // first, look in _installed
-        for_( iter, possibleProviders.begin(), possibleProviders.end() ) {
-            PoolItem provider = ResPool::instance().find( *iter );
-            if ( provider == item )
-            {
-              goBack = true;
-              break;
-            }
-            if (_installed.find( provider ) != _installed.end())       // and is not installed
-            {
-                XXX << "tovisit " << ITEMNAME(provider) << endl;
-                providers.push_back (provider);
-            }
-        }
-
-        if ( goBack )
-          continue;
-
-       // if not found in _installed, look in _toinstall
-
-       if (providers.empty()) {
-            for_( iter, possibleProviders.begin(), possibleProviders.end() ) {
-                PoolItem provider = ResPool::instance().find( *iter );
-                if ((provider.resolvable() != item.resolvable())               // resolvable could provide its own requirement
-                    && (_toinstall.find( provider ) != _toinstall.end()))      // and is not to be installed
-                {
-                    XXX << "tovisit " << ITEMNAME(provider) << endl;
-                    tovisit.push_back (provider);
-                }
-            }
-       }
-
-       for (PoolItemList::iterator it = tovisit.begin(); it != tovisit.end(); ++it)
-       {
-           const PoolItem must_visit = *it;
-           if (_nodes[must_visit].visited == false)
-           {
-               nodeinfo.order++;
-               _rgraph[must_visit].push_back( item );
-               _graph[item].push_back( must_visit );
-               rdfsvisit( must_visit );
-           }
-           else if (_nodes[must_visit].endtime == 0)
-           {
-               if (must_visit != item)
-               {
-                 // log only the 1st occurrence.
-                 std::string lstr( ITEMNAME(item) );
-                 lstr += " -> ";
-                 lstr += ITEMNAME(must_visit);
-                 if ( _logset.insert( lstr ).second )
-                 {
-                   WAR << "** dependency loop: " << lstr << endl;
-                 }
-               }
-           }
-           else
-           {
-               // filter multiple depends on same item (cosmetic)
-               PoolItemList & lrg = _rgraph[must_visit];
-               if( find( lrg.begin(), lrg.end(), item) == lrg.end() )
-               {
-                   nodeinfo.order++;
-                   lrg.push_back( item );
-
-                   PoolItemList & lg = _graph[item];
-                   if( find( lg.begin(), lg.end(), must_visit ) == lg.end() )
-                       lg.push_back( must_visit );
-               }
-           }
-       }
-    }
-    _topsorted.push_back(item);
-    _nodes[item].endtime = _rdfstime;
-    _rdfstime++;
-
-    XXX << ITEMNAME(item) << " done" << endl;
-}
-
-
-void
-InstallOrder::startrdfs()
-{
-    _nodes.clear();
-    _rgraph.clear();
-    _graph.clear();
-
-    _rdfstime = 1;
-
-    _topsorted.clear();
-
-    _numrun++;
-    XXX << "run #" << _numrun << endl;
-
-    // initialize all nodes
-    for (PoolItemSet::iterator it = _toinstall.begin(); it != _toinstall.end(); ++it)
-    {
-       PoolItem item = *it;
-       _nodes[item] = NodeInfo (item);
-       _rgraph[item] = PoolItemList();
-       _graph[item] = PoolItemList();
-    }
-
-    // visit all nodes
-    for (PoolItemSet::iterator it = _toinstall.begin(); it != _toinstall.end(); ++it)
-    {
-       const PoolItem item = *it;
-       if (_nodes[item].visited == false)
-       {
-           XXX << "start recursion on " << ITEMNAME(item) << endl;
-           rdfsvisit (item);
-       }
-    }
-
-    _dirty = false;
-}
-
-
-//-----------------------------------------------------------------------------
-
-const PoolItemList
-InstallOrder::getTopSorted() const
-{
-    return _topsorted;
-}
-
-
-///////////////////////////////////////////////////////////////////
-    };// namespace detail
-    /////////////////////////////////////////////////////////////////////
-    /////////////////////////////////////////////////////////////////////
-  };// namespace solver
-  ///////////////////////////////////////////////////////////////////////
-  ///////////////////////////////////////////////////////////////////////
-};// namespace zypp
-/////////////////////////////////////////////////////////////////////////
diff --git a/zypp/solver/detail/InstallOrder.h b/zypp/solver/detail/InstallOrder.h
deleted file mode 100644 (file)
index ce9fa8e..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* InstallOrder.h
- *
- * Copyright (C) 2005 SUSE Linux Products GmbH
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307, USA.
- */
-
-// stolen from yast2-packagemanager
-/*
-   File:       InstallOrder.h
-   Purpose:    Determine order for installing packages
-   Author:     Ludwig Nussel <lnussel@suse.de>
-   Maintainer: Ludwig Nussel <lnussel@suse.de>
-
-/-*/
-
-#ifndef ZYPP_SOLVER_DETAIL_INSTALLORDER_H
-#define ZYPP_SOLVER_DETAIL_INSTALLORDER_H
-
-#include <string>
-#include <list>
-#include <map>
-#include <set>
-
-#include "zypp/PoolItem.h"
-#include "zypp/ResPool.h"
-#include "zypp/Capabilities.h"
-
-#include "zypp/solver/detail/Types.h"
-
-/////////////////////////////////////////////////////////////////////////
-namespace zypp
-{ ///////////////////////////////////////////////////////////////////////
-  ///////////////////////////////////////////////////////////////////////
-  namespace solver
-  { /////////////////////////////////////////////////////////////////////
-    /////////////////////////////////////////////////////////////////////
-    namespace detail
-    { ///////////////////////////////////////////////////////////////////
-
-/**
- * compute Installation order.<br>
- *
- * There are two Interfaces:<br>
- * - getTopSorted: return flat list of packages in proper order<br>
- * - computeNextSet: return only packages without requirements, see comment below<br>
- * */
-
-class InstallOrder
-{
-    private:
-       const ResPool & _pool;
-       PoolItemSet _toinstall;
-       PoolItemSet _installed;
-
-       /** adjacency list type */
-       typedef std::map<PoolItem, PoolItemList> Graph;
-
-       /** adjacency list, package -> requirements */
-       Graph _graph;
-
-       /** reversed graph, package -> referers */
-       Graph _rgraph;
-
-       struct NodeInfo
-       {
-           unsigned begintime;
-           unsigned endtime;
-           bool visited;
-           int order; // number of incoming edges in reverse graph
-
-           PoolItem item;
-
-           NodeInfo() : begintime(0), endtime(0), visited(false), order(0) {}
-           NodeInfo(PoolItem item) : begintime(0), endtime(0), visited(false), order(0), item(item) {}
-       };
-
-       typedef std::map<PoolItem, NodeInfo> Nodes;
-
-       Nodes _nodes;
-
-       unsigned _rdfstime;
-
-       PoolItemList _topsorted;
-
-       bool _dirty;
-
-       unsigned _numrun;
-
-       std::set<std::string> _logset;
-
-    private:
-       void rdfsvisit (PoolItem item);
-
-       PoolItem findProviderInSet( const Capability requirement, const PoolItemSet & candidates ) const;
-       bool doesProvide( const Capability requirement, PoolItem item ) const;
-
-    public:
-
-       /**
-        * Constructor
-        *
-        * @param toinstall Set of ResItems that have to be installed
-        * @param installed Set of ResItems that are already installed
-        * */
-       InstallOrder( const ResPool & pool, const PoolItemSet & toinstall, const PoolItemSet & installed);
-
-       /**
-        * Compute a list of ResItems which have no requirements and can be
-        * installed in parallel without conflicts. Use setInstalled to make
-        * computation of a different set possible */
-       PoolItemList computeNextSet();
-
-       /**
-        * set a Solvable as installed, computeNextSet is able to compute a new
-        * set then
-        * */
-       void setInstalled( PoolItem item );
-
-       /**
-        * like above, for convenience
-        * */
-       void setInstalled( const PoolItemList & list );
-
-       /**
-        * recoursive depth first search, build internal trees
-        * */
-       void startrdfs();
-
-       /**
-        * Initialize data structures. Must be called before any other
-        * function.
-        * */
-       void init() { startrdfs(); }
-
-       /**
-        * compute topological sorted list
-        *
-        * @return list of resolvables in an installable order
-        * */
-       const PoolItemList getTopSorted() const;
-
-       void printAdj (std::ostream & os, bool reversed = false) const;
-};
-
-///////////////////////////////////////////////////////////////////
-    };// namespace detail
-    /////////////////////////////////////////////////////////////////////
-    /////////////////////////////////////////////////////////////////////
-  };// namespace solver
-  ///////////////////////////////////////////////////////////////////////
-  ///////////////////////////////////////////////////////////////////////
-};// namespace zypp
-/////////////////////////////////////////////////////////////////////////
-
-#endif // ZYPP_SOLVER_DETAIL_INSTALLORDER_H
index fab8352..2c864ed 100644 (file)
@@ -26,6 +26,5 @@
 #include "zypp/solver/detail/ResolverProblem.h"
 #include "zypp/solver/detail/ProblemSolution.h"
 #include "zypp/solver/detail/SolutionAction.h"
-#include "zypp/solver/detail/InstallOrder.h"
 
 #endif // ZYPP_SOLVER_DETAIL_LIBZYPP_H
index 0581417..a47f598 100644 (file)
@@ -47,7 +47,6 @@
 
 #include "zypp/parser/ProductFileReader.h"
 
-#include "zypp/pool/GetResolvablesToInsDel.h"
 #include "zypp/solver/detail/Testcase.h"
 
 #include "zypp/repo/DeltaCandidates.h"