solver/detail/Helper.cc
solver/detail/InstallOrder.cc
solver/detail/ProblemSolutionIgnore.cc
- solver/detail/ProblemSolutionInstall.cc
- solver/detail/ProblemSolutionKeep.cc
- solver/detail/ProblemSolutionUninstall.cc
- solver/detail/ProblemSolutionUnlock.cc
solver/detail/ProblemSolutionCombi.cc
solver/detail/Resolver.cc
solver/detail/ResolverUpgrade.cc
solver/detail/Helper.h
solver/detail/InstallOrder.h
solver/detail/ProblemSolutionIgnore.h
- solver/detail/ProblemSolutionInstall.h
- solver/detail/ProblemSolutionKeep.h
- solver/detail/ProblemSolutionUninstall.h
- solver/detail/ProblemSolutionUnlock.h
solver/detail/ProblemSolutionCombi.h
solver/detail/Resolver.h
solver/detail/SolutionAction.h
: ProblemSolution (parent, "", "")
{
// TranslatorExplanation %s = name of package, patch, selection ...
- _description = str::form (_("Ignore some dependencies for %s"), item->name().c_str() );
+ _description = str::form (_("Ignore some dependencies of %s"), item->name().c_str() );
// addAction ( new InjectSolutionAction (item, capability, REQUIRES));
}
+++ /dev/null
-
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/* ProblemSolution.cc
- *
- * Easy-to use interface to the ZYPP dependency resolver
- *
- * Copyright (C) 2000-2002 Ximian, Inc.
- * 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.
- */
-
-#include <sstream>
-
-#include "zypp/base/String.h"
-#include "zypp/base/Gettext.h"
-
-#include "zypp/solver/detail/ProblemSolutionInstall.h"
-#include "zypp/solver/detail/Helper.h"
-
-using namespace std;
-
-/////////////////////////////////////////////////////////////////////////
-namespace zypp
-{ ///////////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////////
- namespace solver
- { /////////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////
- namespace detail
- { ///////////////////////////////////////////////////////////////////
-
-IMPL_PTR_TYPE(ProblemSolutionInstall);
-
-//---------------------------------------------------------------------------
-
-ProblemSolutionInstall::ProblemSolutionInstall( ResolverProblem_Ptr parent,
- PoolItem item )
- : ProblemSolution (parent, "", "")
-{
- // TranslatorExplanation %s = name of package, patch, selection ...
- _description = str::form (_("install %s"), item->name().c_str() );
- // TranslatorExplanation %s = name of package, patch, selection ...
- _details = str::form (_("install %s"), Helper::itemToString (item).c_str());
-
- addAction ( new TransactionSolutionAction (item,
- INSTALL));
-}
-
-ProblemSolutionInstall::ProblemSolutionInstall( ResolverProblem_Ptr parent,
- PoolItemList & itemList )
- : ProblemSolution (parent, "", "")
-{
- _description = _("Install missing resolvables");
-
- for (PoolItemList::iterator iter = itemList.begin();
- iter != itemList.end(); iter++) {
- PoolItem item = *iter;
- addAction ( new TransactionSolutionAction (item, INSTALL));
- }
-
- ostringstream details;
- details << _actions;
- _details = details.str();
-
-}
-
- ///////////////////////////////////////////////////////////////////
- };// namespace detail
- /////////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////
- };// namespace solver
- ///////////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////////
-};// namespace zypp
-/////////////////////////////////////////////////////////////////////////
+++ /dev/null
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/* Resolver_problems.cc
- *
- * Copyright (C) 2000-2002 Ximian, Inc.
- * 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.
- */
-
-#ifndef ZYPP_SOLVER_DETAIL_PROBLEMSOLUTIONINSTALL_H
-#define ZYPP_SOLVER_DETAIL_PROBLEMSOLUTIONINSTALL_H
-
-#include "zypp/ProblemSolution.h"
-#include "zypp/solver/detail/Types.h"
-
-/////////////////////////////////////////////////////////////////////////
-namespace zypp
-{ ///////////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////////
- namespace solver
- { /////////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////
- namespace detail
- { ///////////////////////////////////////////////////////////////////
-
- /**
- * Class representing one possible solution to one problem found during resolving
- * This problem solution installs one or more items
- *
- **/
- class ProblemSolutionInstall : public ProblemSolution
- {
- public:
-
- /**
- * Constructor.
- **/
- ProblemSolutionInstall( ResolverProblem_Ptr parent, PoolItem item);
- ProblemSolutionInstall( ResolverProblem_Ptr parent, PoolItemList & itemlist );
- };
-
- ///////////////////////////////////////////////////////////////////
- };// namespace detail
- /////////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////
- };// namespace solver
- ///////////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////////
-};// namespace zypp
-/////////////////////////////////////////////////////////////////////////
-
-#endif // ZYPP_SOLVER_DETAIL_PROBLEMSOLUTIONAINSTALL_H
-
+++ /dev/null
-
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/* ProblemSolution.cc
- *
- * Easy-to use interface to the ZYPP dependency resolver
- *
- * Copyright (C) 2000-2002 Ximian, Inc.
- * 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.
- */
-
-#include <sstream>
-
-#include "zypp/base/String.h"
-#include "zypp/base/Gettext.h"
-#include "zypp/solver/detail/ProblemSolutionKeep.h"
-#include "zypp/solver/detail/Helper.h"
-
-using namespace std;
-
-/////////////////////////////////////////////////////////////////////////
-namespace zypp
-{ ///////////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////////
- namespace solver
- { /////////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////
- namespace detail
- { ///////////////////////////////////////////////////////////////////
-
-IMPL_PTR_TYPE(ProblemSolutionKeep);
-
-//---------------------------------------------------------------------------
-
-ProblemSolutionKeep::ProblemSolutionKeep( ResolverProblem_Ptr parent,
- PoolItem item )
- : ProblemSolution (parent, "", "")
-{
- // TranslatorExplanation %s = name of package, patch, selection ...
- _description = str::form (_("keep %s"), item->name().c_str() );
- // TranslatorExplanation %s = name of package, patch, selection ...
- _details = str::form (_("keep %s"), Helper::itemToString (item).c_str());
-
- addAction ( new TransactionSolutionAction (item,
- KEEP));
-}
-
-ProblemSolutionKeep::ProblemSolutionKeep( ResolverProblem_Ptr parent,
- PoolItemList & itemList )
- : ProblemSolution (parent, "", "")
-{
- _description = _("Keep resolvables");
-
- for (PoolItemList::iterator iter = itemList.begin();
- iter != itemList.end(); iter++) {
- PoolItem item = *iter;
- addAction ( new TransactionSolutionAction (item, KEEP));
- }
-
- ostringstream details;
- details << _actions;
- _details = details.str();
-
-}
-
- ///////////////////////////////////////////////////////////////////
- };// namespace detail
- /////////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////
- };// namespace solver
- ///////////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////////
-};// namespace zypp
-/////////////////////////////////////////////////////////////////////////
+++ /dev/null
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/* Resolver_problems.cc
- *
- * Copyright (C) 2000-2002 Ximian, Inc.
- * 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.
- */
-
-#ifndef ZYPP_SOLVER_DETAIL_PROBLEMSOLUTIONKEEP_H
-#define ZYPP_SOLVER_DETAIL_PROBLEMSOLUTIONKEEP_H
-
-#include "zypp/ProblemSolution.h"
-#include "zypp/solver/detail/Types.h"
-
-/////////////////////////////////////////////////////////////////////////
-namespace zypp
-{ ///////////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////////
- namespace solver
- { /////////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////
- namespace detail
- { ///////////////////////////////////////////////////////////////////
-
- /**
- * Class representing one possible solution to one problem found during resolving
- * This problem solution keeps one or more items
- *
- **/
- class ProblemSolutionKeep : public ProblemSolution
- {
- public:
-
- /**
- * Constructor.
- **/
- ProblemSolutionKeep( ResolverProblem_Ptr parent, PoolItem item);
- ProblemSolutionKeep( ResolverProblem_Ptr parent, PoolItemList & itemlist );
- };
-
- ///////////////////////////////////////////////////////////////////
- };// namespace detail
- /////////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////
- };// namespace solver
- ///////////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////////
-};// namespace zypp
-/////////////////////////////////////////////////////////////////////////
-
-#endif // ZYPP_SOLVER_DETAIL_PROBLEMSOLUTIONAKEEP_H
-
+++ /dev/null
-
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/* ProblemSolution.cc
- *
- * Easy-to use interface to the ZYPP dependency resolver
- *
- * Copyright (C) 2000-2002 Ximian, Inc.
- * 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.
- */
-
-#include <sstream>
-
-#include "zypp/base/String.h"
-#include "zypp/base/Gettext.h"
-#include "zypp/solver/detail/ProblemSolutionUninstall.h"
-#include "zypp/solver/detail/Helper.h"
-
-using namespace std;
-
-/////////////////////////////////////////////////////////////////////////
-namespace zypp
-{ ///////////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////////
- namespace solver
- { /////////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////
- namespace detail
- { ///////////////////////////////////////////////////////////////////
-
-IMPL_PTR_TYPE(ProblemSolutionUninstall);
-
-//---------------------------------------------------------------------------
-ProblemSolutionUninstall::ProblemSolutionUninstall( ResolverProblem_Ptr parent, PoolItem item,
- const std::string & descr,
- const std::string & detail)
- : ProblemSolution (parent, descr, detail)
-{
- addAction ( new TransactionSolutionAction (item, REMOVE));
-}
-
-
-
-ProblemSolutionUninstall::ProblemSolutionUninstall( ResolverProblem_Ptr parent,
- PoolItem item)
- : ProblemSolution (parent, "", "")
-{
- ResStatus status = item.status();
- if (status.isInstalled()) {
- // TranslatorExplanation %s = name of package, patch, selection ...
- _description = str::form (_("delete %s"), item->name().c_str() );
- // TranslatorExplanation %s = name of package, patch, selection ...
- _details = str::form (_("delete %s"), Helper::itemToString (item).c_str());
- } else {
- // TranslatorExplanation %s = name of package, patch, selection ...
- _description = str::form (_("do not install %s"), item->name().c_str() );
- // TranslatorExplanation %s = name of package, patch, selection ...
- _details = str::form (_("do not install %s"), Helper::itemToString (item).c_str());
- }
-
- addAction ( new TransactionSolutionAction (item, REMOVE));
-}
-
-ProblemSolutionUninstall::ProblemSolutionUninstall( ResolverProblem_Ptr parent,
- PoolItemList & itemlist)
- : ProblemSolution (parent, "", "")
-{
- _description = _("Do not install or delete the resolvables concerned");
-
- for (PoolItemList::iterator iter = itemlist.begin();
- iter != itemlist.end(); iter++) {
- PoolItem item = *iter;
- addAction ( new TransactionSolutionAction (item, REMOVE));
- }
-
- ostringstream details;
- details << _actions;
- _details = details.str();
-}
-
- ///////////////////////////////////////////////////////////////////
- };// namespace detail
- /////////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////
- };// namespace solver
- ///////////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////////
-};// namespace zypp
-/////////////////////////////////////////////////////////////////////////
+++ /dev/null
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/* Resolver_problems.cc
- *
- * Copyright (C) 2000-2002 Ximian, Inc.
- * 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.
- */
-
-#ifndef ZYPP_SOLVER_DETAIL_PROBLEMSOLUTIONUNINSTALL_H
-#define ZYPP_SOLVER_DETAIL_PROBLEMSOLUTIONUNINSTALL_H
-
-#include "zypp/solver/detail/Types.h"
-#include "zypp/ProblemSolution.h"
-
-/////////////////////////////////////////////////////////////////////////
-namespace zypp
-{ ///////////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////////
- namespace solver
- { /////////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////
- namespace detail
- { ///////////////////////////////////////////////////////////////////
-
- /**
- * Class representing one possible solution to one problem found during resolving
- * This problem solution uninstalls one or more items
- *
- **/
- class ProblemSolutionUninstall : public ProblemSolution
- {
- public:
-
- /**
- * Constructor.
- **/
- ProblemSolutionUninstall( ResolverProblem_Ptr parent, PoolItem item);
- ProblemSolutionUninstall( ResolverProblem_Ptr parent, PoolItem item,
- const std::string & descr,
- const std::string & detail);
- ProblemSolutionUninstall( ResolverProblem_Ptr parent, PoolItemList & itemlist);
- };
-
- ///////////////////////////////////////////////////////////////////
- };// namespace detail
- /////////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////
- };// namespace solver
- ///////////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////////
-};// namespace zypp
-/////////////////////////////////////////////////////////////////////////
-
-#endif // ZYPP_SOLVER_DETAIL_PROBLEMSOLUTIONAUNINSTALL_H
-
+++ /dev/null
-
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/* ProblemSolution.cc
- *
- * Easy-to use interface to the ZYPP dependency resolver
- *
- * Copyright (C) 2000-2002 Ximian, Inc.
- * 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.
- */
-
-#include <sstream>
-
-#include "zypp/base/String.h"
-#include "zypp/base/Gettext.h"
-#include "zypp/base/Algorithm.h"
-#include "zypp/ResPool.h"
-#include "zypp/ResFilters.h"
-#include "zypp/solver/detail/ProblemSolutionUnlock.h"
-
-using namespace std;
-
-/////////////////////////////////////////////////////////////////////////
-namespace zypp
-{ ///////////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////////
- namespace solver
- { /////////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////
- namespace detail
- { ///////////////////////////////////////////////////////////////////
-
-IMPL_PTR_TYPE(ProblemSolutionUnlock);
-
-//---------------------------------------------------------------------------
-
-struct LockReset : public resfilter::PoolItemFilterFunctor
-{
- ProblemSolutionUnlock & _problemSolutionUnlock;
- LockReset( ProblemSolutionUnlock & solution )
- : _problemSolutionUnlock( solution )
- { }
-
- bool operator()( PoolItem item )
- {
- _problemSolutionUnlock.addAction ( new TransactionSolutionAction (item, UNLOCK));
- return true;
- }
-};
-
-
-ProblemSolutionUnlock::ProblemSolutionUnlock( ResolverProblem_Ptr parent,
- const ResPool & pool)
- : ProblemSolution (parent, "", "")
-{
- _description = _("unlock all resolvables");
- LockReset lockReset (*this);
-
- invokeOnEach ( pool.begin(), pool.end(),
- resfilter::ByLock( ),
- functor::functorRef<bool,PoolItem>(lockReset));
-}
-
-ProblemSolutionUnlock::ProblemSolutionUnlock( ResolverProblem_Ptr parent,
- PoolItem item)
- : ProblemSolution (parent, "", "")
-{
- // TranslatorExplanation %s = name of package, patch, selection ...
- _description = str::form (_("unlock %s"), item->name().c_str() );
-
- addAction ( new TransactionSolutionAction (item, UNLOCK));
-}
-
-ProblemSolutionUnlock::ProblemSolutionUnlock( ResolverProblem_Ptr parent,
- PoolItemList & itemlist)
- : ProblemSolution (parent, "", "")
-{
- _description = _("Unlock these resolvables");
-
- for (PoolItemList::iterator iter = itemlist.begin();
- iter != itemlist.end(); iter++) {
- PoolItem item = *iter;
- addAction ( new TransactionSolutionAction (item, UNLOCK));
- }
-
- ostringstream details;
- details << _actions;
- _details = details.str();
-}
-
- ///////////////////////////////////////////////////////////////////
- };// namespace detail
- /////////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////
- };// namespace solver
- ///////////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////////
-};// namespace zypp
-/////////////////////////////////////////////////////////////////////////
+++ /dev/null
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/* Resolver_problems.cc
- *
- * Copyright (C) 2000-2002 Ximian, Inc.
- * 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.
- */
-
-#ifndef ZYPP_SOLVER_DETAIL_PROBLEMSOLUTIONUNLOCK_H
-#define ZYPP_SOLVER_DETAIL_PROBLEMSOLUTIONUNLOCK_H
-
-#include "zypp/solver/detail/Types.h"
-#include "zypp/ProblemSolution.h"
-
-/////////////////////////////////////////////////////////////////////////
-namespace zypp
-{ ///////////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////////
- namespace solver
- { /////////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////
- namespace detail
- { ///////////////////////////////////////////////////////////////////
-
- /**
- * Class representing one possible solution to one problem found during resolving
- * This problem solution unlocks one or more items
- *
- **/
- class ProblemSolutionUnlock : public ProblemSolution
- {
- public:
-
- /**
- * Constructor.
- **/
- ProblemSolutionUnlock( ResolverProblem_Ptr parent, PoolItem item);
- ProblemSolutionUnlock( ResolverProblem_Ptr parent, PoolItemList & itemlist);
- ProblemSolutionUnlock( ResolverProblem_Ptr parent, const ResPool & pool);
- };
-
- ///////////////////////////////////////////////////////////////////
- };// namespace detail
- /////////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////
- };// namespace solver
- ///////////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////////
-};// namespace zypp
-/////////////////////////////////////////////////////////////////////////
-
-#endif // ZYPP_SOLVER_DETAIL_PROBLEMSOLUTIONAUNLOCK_H
-
Resolver::resolvePool()
{
solverInit();
- return _satResolver->resolvePool(_extra_requires, _extra_conflicts);
+ return _satResolver->resolvePool(_extra_requires, _extra_conflicts, _addWeak);
}
bool
Resolver::resolveQueue(solver::detail::SolverQueueItemList & queue)
{
solverInit();
- return _satResolver->resolveQueue(queue);
+ return _satResolver->resolveQueue(queue, _addWeak);
}
#include "zypp/sat/WhatProvides.h"
#include "zypp/solver/detail/SATResolver.h"
#include "zypp/solver/detail/ProblemSolutionCombi.h"
+#include "zypp/solver/detail/ProblemSolutionIgnore.h"
extern "C" {
#include "satsolver/repo_solv.h"
sat::Pool::instance().prepare();
+ // Add ignoring request
+
+
// Solve !
MIL << "Starting solving...." << endl;
MIL << *this;
void
-SATResolver::solverInit()
+SATResolver::solverInit(const PoolItemList & weakItems)
{
SATCollectTransact info (*this);
invokeOnEach ( _pool.begin(), _pool.end(),
functor::functorRef<bool,PoolItem>(info) );
+
+ for (PoolItemList::const_iterator iter = weakItems.begin(); iter != weakItems.end(); iter++) {
+ Id id = (*iter)->satSolvable().id();
+ if (id == ID_NULL) {
+ ERR << "Weaken: " << *iter << " not found" << endl;
+ }
+ MIL << "Weaken dependencies of " << *iter << " with the SAT-Pool ID: " << id << endl;
+ queue_push( &(_jobQueue), SOLVER_WEAKEN_SOLVABLE_DEPS );
+ queue_push( &(_jobQueue), id );
+ }
}
void
bool
SATResolver::resolvePool(const CapabilitySet & requires_caps,
- const CapabilitySet & conflict_caps)
+ const CapabilitySet & conflict_caps,
+ const PoolItemList & weakItems)
{
MIL << "SATResolver::resolvePool()" << endl;
// initialize
- solverInit();
+ solverInit(weakItems);
for (PoolItemList::const_iterator iter = _items_to_install.begin(); iter != _items_to_install.end(); iter++) {
- PoolItem r = *iter;
-
Id id = (*iter)->satSolvable().id();
if (id == ID_NULL) {
ERR << "Install: " << *iter << " not found" << endl;
}
for (PoolItemList::const_iterator iter = _items_to_update.begin(); iter != _items_to_update.end(); iter++) {
- PoolItem r = *iter;
-
Id id = (*iter)->satSolvable().id();
if (id == ID_NULL) {
ERR << "Update explicit: " << *iter << " not found" << endl;
bool
-SATResolver::resolveQueue(const SolverQueueItemList &requestQueue)
+SATResolver::resolveQueue(const SolverQueueItemList &requestQueue,
+ const PoolItemList & weakItems)
{
MIL << "SATResolver::resolvQueue()" << endl;
// initialize
- solverInit();
+ solverInit(weakItems);
// generate solver queue
for (SolverQueueItemList::const_iterator iter = requestQueue.begin(); iter != requestQueue.end(); iter++) {
MIL << "SATResolver::doUpdate()" << endl;
// initialize
- solverInit();
+ solverInit(PoolItemList());
_solv = solver_create( _SATPool, sat::Pool::instance().systemRepo().get() );
_solv->vendorCheckCb = &vendorCheck;
};
-string SATResolver::SATprobleminfoString(Id problem, string &detail)
+string SATResolver::SATprobleminfoString(Id problem, string &detail, Id &ignoreId)
{
string ret;
Pool *pool = _solv->pool;
Id dep, source, target;
Solvable *s, *s2;
+ ignoreId = 0;
probr = solver_findproblemrule(_solv, problem);
switch (solver_problemruleinfo(_solv, &(_jobQueue), probr, &dep, &source, &target))
{
ret = str::form (_("%s obsoletes %s provided by %s"), solvable2str(pool, s), dep2str(pool, dep), solvable2str(pool, s2));
break;
case SOLVER_PROBLEM_DEP_PROVIDERS_NOT_INSTALLABLE:
+ ignoreId = source; // for setting weak dependencies
s = pool_id2solvable(pool, source);
Capability cap(dep);
sat::WhatProvides possibleProviders(cap);
MIL << "Problem " << pcnt++ << ":" << endl;
MIL << "====================================" << endl;
string detail;
- string whatString = SATprobleminfoString (problem,detail);
+ Id ignorId;
+ string whatString = SATprobleminfoString (problem,detail,ignorId);
MIL << whatString << endl;
MIL << "------------------------------------" << endl;
ResolverProblem_Ptr resolverProblem = new ResolverProblem (whatString, detail);
+
solution = 0;
while ((solution = solver_next_solution(_solv, problem, solution)) != 0) {
element = 0;
problemSolution->actionCount() > 1 ? true : false); // Solutions with more than 1 action will be shown first.
MIL << "------------------------------------" << endl;
}
+
+ if (ignorId > 0) {
+ // There is a possibility to ignore this error by setting weak dependencies
+ PoolItem item = _pool.find (sat::Solvable(ignorId));
+ ProblemSolutionIgnore *problemSolution = new ProblemSolutionIgnore(resolverProblem, item);
+ resolverProblem->addSolution (problemSolution,
+ false); // Solutions will be shown at the end
+ }
+
// save problem
resolverProblems.push_back (resolverProblem);
}
bool _onlyRequires; // true: consider required packages only
// ---------------------------------- methods
- std::string SATprobleminfoString (Id problem, std::string &detail);
+ std::string SATprobleminfoString (Id problem, std::string &detail, Id &ignoreId);
void resetItemTransaction (PoolItem item);
// Create a SAT solver and reset solver selection in the pool (Collecting
- void solverInit();
+ void solverInit(const PoolItemList & weakItems);
// common solver run with the _jobQueue; Save results back to pool
bool solving();
// cleanup solver
// solver run with pool selected items
bool resolvePool(const CapabilitySet & requires_caps,
- const CapabilitySet & conflict_caps);
+ const CapabilitySet & conflict_caps,
+ const PoolItemList & weakItems);
// solver run with the given request queue
- bool resolveQueue(const SolverQueueItemList &requestQueue);
+ bool resolveQueue(const SolverQueueItemList &requestQueue,
+ const PoolItemList & weakItems);
// searching for new packages
bool doUpdate();