libzypp
11.13.5
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
libzypp
Welcome to libzypp
Code Pitfalls - Frequently made mistakes
Code Snippets
Environment Variables
Testing for provided features.
Notes on revisions
Extending ZYpp: Plugins and Hooks
Services
Solver - Vendor protection
Writing and tunning testcases
Libzypp and threads
Todo List
Deprecated List
Modules
Namespaces
Classes
Files
File List
zypp
base
media
misc
parser
pool
repo
sat
solver
detail
Helper.cc
Helper.h
InstallOrder.cc
InstallOrder.h
ProblemSolutionCombi.cc
ProblemSolutionCombi.h
ProblemSolutionIgnore.cc
ProblemSolutionIgnore.h
Resolver.cc
Resolver.h
SATResolver.cc
SATResolver.h
SolutionAction.cc
SolutionAction.h
SolverQueueItem.cc
SolverQueueItem.h
SolverQueueItemDelete.cc
SolverQueueItemDelete.h
SolverQueueItemInstall.cc
SolverQueueItemInstall.h
SolverQueueItemInstallOneOf.cc
SolverQueueItemInstallOneOf.h
SolverQueueItemLock.cc
SolverQueueItemLock.h
SolverQueueItemUpdate.cc
SolverQueueItemUpdate.h
SystemCheck.cc
SystemCheck.h
Testcase.cc
Testcase.h
Types.h
libzypp_solver.h
target
thread
ui
url
ws
zypp_detail
APIConfig.h
Arch.cc
Arch.h
AutoDispose.h
Bit.h
ByteCount.cc
ByteCount.h
Callback.h
Capabilities.cc
Capabilities.h
Capability.cc
Capability.h
CapMatch.cc
CapMatch.h
Changelog.cc
Changelog.h
CheckSum.cc
CheckSum.h
CountryCode.cc
CountryCode.h
Date.cc
Date.h
Dep.cc
Dep.h
Digest.cc
Digest.h
DiskUsage.cc
DiskUsage.h
DiskUsageCounter.cc
DiskUsageCounter.h
DownloadMode.cc
DownloadMode.h
Edition.cc
Edition.h
ExternalProgram.cc
ExternalProgram.h
Fetcher.cc
Fetcher.h
FileChecker.cc
FileChecker.h
Filter.h
Glob.cc
Glob.h
HistoryLog.cc
HistoryLog.h
HistoryLogData.cc
HistoryLogData.h
IdString.cc
IdString.h
IdStringType.h
InstanceId.cc
InstanceId.h
KeyContext.h
KeyRing.cc
KeyRing.h
KVMap.h
LanguageCode.cc
LanguageCode.h
Locale.cc
Locale.h
Locks.cc
Locks.h
ManagedFile.h
MediaProducts.cc
MediaProducts.h
MediaSetAccess.cc
MediaSetAccess.h
Misc.h
OnMediaLocation.cc
OnMediaLocation.h
Package.cc
Package.h
PackageKeyword.h
Patch.cc
Patch.h
PathInfo.cc
PathInfo.h
Pathname.cc
Pathname.h
Pattern.cc
Pattern.h
PluginFrame.cc
PluginFrame.h
PluginFrameException.cc
PluginFrameException.h
PluginScript.cc
PluginScript.h
PluginScriptException.cc
PluginScriptException.h
PoolItem.cc
PoolItem.h
PoolItemBest.cc
PoolItemBest.h
PoolQuery.cc
PoolQuery.h
PoolQueryResult.cc
PoolQueryResult.h
PoolQueryUtil.tcc
ProblemSolution.cc
ProblemSolution.h
ProblemTypes.h
Product.cc
Product.h
ProgressData.cc
ProgressData.h
ProvideFilePolicy.cc
ProvideFilePolicy.h
PublicKey.cc
PublicKey.h
Range.cc
Range.h
Rel.cc
Rel.h
RelCompare.h
RepoInfo.cc
RepoInfo.h
RepoManager.cc
RepoManager.h
Repository.cc
Repository.h
RepoStatus.cc
RepoStatus.h
ResFilters.h
ResKind.cc
ResKind.h
ResObject.cc
ResObject.h
ResObjects.h
Resolvable.cc
Resolvable.h
Resolver.cc
Resolver.h
ResolverProblem.cc
ResolverProblem.h
ResPool.cc
ResPool.h
ResPoolProxy.cc
ResPoolProxy.h
ResStatus.cc
ResStatus.h
ResTraits.h
ServiceInfo.cc
ServiceInfo.h
Signature.cc
Signature.h
SrcPackage.cc
SrcPackage.h
SysContent.cc
SysContent.h
Target.cc
Target.h
TmpPath.cc
TmpPath.h
TriBool.h
Url.cc
Url.h
Vendor.h
VendorAttr.cc
VendorAttr.h
VendorSupportOptions.cc
VendorSupportOptions.h
ZConfig.cc
ZConfig.h
ZYpp.cc
ZYpp.h
ZYppCallbacks.h
ZYppCommit.h
ZYppCommitPolicy.cc
ZYppCommitPolicy.h
ZYppCommitResult.cc
ZYppCommitResult.h
ZYppFactory.cc
ZYppFactory.h
File Members
SATResolver.h
Go to the documentation of this file.
1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2
/* SATResolver.h
3
*
4
* Copyright (C) 2000-2002 Ximian, Inc.
5
* Copyright (C) 2005 SUSE Linux Products GmbH
6
*
7
* This program is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU General Public License,
9
* version 2, as published by the Free Software Foundation.
10
*
11
* This program is distributed in the hope that it will be useful, but
12
* WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19
* 02111-1307, USA.
20
*/
21
22
#ifndef ZYPP_SOLVER_DETAIL_SAT_RESOLVER_H
23
#define ZYPP_SOLVER_DETAIL_SAT_RESOLVER_H
24
25
extern
"C"
26
{
27
#include <solv/solver.h>
28
#include <solv/pool.h>
29
}
30
31
#include <iosfwd>
32
#include <list>
33
#include <map>
34
#include <string>
35
36
#include "
zypp/base/ReferenceCounted.h
"
37
#include "
zypp/base/PtrTypes.h
"
38
#include "
zypp/ResPool.h
"
39
#include "
zypp/base/SerialNumber.h
"
40
#include "
zypp/ProblemTypes.h
"
41
#include "
zypp/ResolverProblem.h
"
42
#include "
zypp/ProblemSolution.h
"
43
#include "
zypp/Capability.h
"
44
#include "
zypp/solver/detail/SolverQueueItem.h
"
45
47
namespace
zypp
48
{
49
50
namespace
sat
51
{
52
class
Transaction;
53
}
54
56
namespace
solver
57
{
58
59
namespace
detail
60
{
61
62
64
//
65
// CLASS NAME : SATResolver
71
class
SATResolver
:
public
base::ReferenceCounted
,
private
base::NonCopyable
{
72
73
private
:
74
ResPool
_pool
;
75
Pool *
_SATPool
;
76
Solver *
_solv
;
77
Queue
_jobQueue
;
78
79
// list of problematic items (orphaned)
80
PoolItemList
_problem_items
;
81
82
// list populated by calls to addPoolItemTo*()
83
PoolItemList
_items_to_install
;
84
PoolItemList
_items_to_remove
;
85
PoolItemList
_items_to_lock
;
86
PoolItemList
_items_to_keep
;
87
88
// solve results
89
PoolItemList
_result_items_to_install
;
90
PoolItemList
_result_items_to_remove
;
91
92
bool
_fixsystem
;
// repair errors in rpm dependency graph
93
bool
_allowdowngrade
;
// allow to downgrade installed solvable
94
bool
_allowarchchange
;
// allow to change architecture of installed solvables
95
bool
_allowvendorchange
;
// allow to change vendor of installed solvables
96
bool
_allowuninstall
;
// allow removal of installed solvables
97
bool
_updatesystem
;
// update
98
bool
_noupdateprovide
;
// true: update packages needs not to provide old package
99
bool
_dosplitprovides
;
// true: consider legacy split provides
100
bool
_onlyRequires
;
// true: consider required packages only
101
bool
_ignorealreadyrecommended
;
// true: ignore recommended packages that were already recommended by the installed packages
102
bool
_distupgrade
;
103
bool
_distupgrade_removeunsupported
;
104
bool
_solveSrcPackages
;
// false: generate no job rule for source packages selected in the pool
105
bool
_cleandepsOnRemove
;
// whether removing a package should also remove no longer needed requirements
106
107
// ---------------------------------- methods
108
std::string
SATprobleminfoString
(Id problem, std::string &detail, Id &ignoreId);
109
void
resetItemTransaction
(
PoolItem
item);
110
111
// Create a SAT solver and reset solver selection in the pool (Collecting
112
void
solverInit
(
const
PoolItemList
& weakItems);
113
// common solver run with the _jobQueue; Save results back to pool
114
bool
solving
(
const
CapabilitySet
& requires_caps =
CapabilitySet
(),
115
const
CapabilitySet
& conflict_caps =
CapabilitySet
());
116
// cleanup solver
117
void
solverEnd
();
118
// set locks for the solver
119
void
setLocks
();
120
// set requirements for a running system
121
void
setSystemRequirements
();
122
123
// Checking if this solvable/item has a buddy which reflect the real
124
// user visible description of an item
125
// e.g. The release package has a buddy to the concerning product item.
126
// This user want's the message "Product foo conflicts with product bar" and
127
// NOT "package release-foo conflicts with package release-bar"
128
// So these functions return the concerning buddy (e.g. product item)
129
sat::Solvable
mapSolvable
(
const
Id &
id
);
130
PoolItem
mapItem
(
const
PoolItem
&item);
131
132
public
:
133
134
SATResolver
(
const
ResPool
&
pool
, Pool *SATPool);
135
virtual
~SATResolver
();
136
137
// ---------------------------------- I/O
138
139
virtual
std::ostream &
dumpOn
( std::ostream & str )
const
;
140
friend
std::ostream&
operator<<
(std::ostream& str,
const
SATResolver
& obj)
141
{
return
obj.
dumpOn
(str); }
142
143
ResPool
pool
(
void
)
const
;
144
void
setPool
(
const
ResPool
&
pool
) {
_pool
=
pool
; }
145
146
// solver run with pool selected items
147
bool
resolvePool
(
const
CapabilitySet
& requires_caps,
148
const
CapabilitySet
& conflict_caps,
149
const
PoolItemList
& weakItems,
150
const
std::set<Repository> & upgradeRepos
151
);
152
// solver run with the given request queue
153
bool
resolveQueue
(
const
SolverQueueItemList
&requestQueue,
154
const
PoolItemList
& weakItems
155
);
156
// searching for new packages
157
void
doUpdate
();
158
159
ResolverProblemList
problems
();
160
void
applySolutions
(
const
ProblemSolutionList
&solutions);
161
162
void
addPoolItemToInstall
(
PoolItem
item);
163
void
addPoolItemsToInstallFromList
(
PoolItemList
& rl);
164
165
void
addPoolItemToLock
(
PoolItem
item);
166
void
addPoolItemToKeep
(
PoolItem
item);
167
168
void
addPoolItemToRemove
(
PoolItem
item);
169
void
addPoolItemsToRemoveFromList
(
PoolItemList
& rl);
170
171
bool
fixsystem
()
const
{
return
_fixsystem
;}
172
void
setFixsystem
(
const
bool
fixsystem
) {
_fixsystem
=
fixsystem
;}
173
174
bool
ignorealreadyrecommended
()
const
{
return
_ignorealreadyrecommended
;}
175
void
setIgnorealreadyrecommended
(
const
bool
ignorealreadyrecommended
) {
_ignorealreadyrecommended
=
ignorealreadyrecommended
;}
176
177
bool
distupgrade
()
const
{
return
_distupgrade
;}
178
void
setDistupgrade
(
const
bool
distupgrade
) {
_distupgrade
=
distupgrade
;}
179
180
bool
distupgrade_removeunsupported
()
const
{
return
_distupgrade_removeunsupported
;}
181
void
setDistupgrade_removeunsupported
(
const
bool
distupgrade_removeunsupported
) {
_distupgrade_removeunsupported
=
distupgrade_removeunsupported
;}
182
183
bool
allowdowngrade
()
const
{
return
_allowdowngrade
;}
184
void
setAllowdowngrade
(
const
bool
allowdowngrade
) {
_allowdowngrade
=
allowdowngrade
;}
185
186
bool
allowarchchange
()
const
{
return
_allowarchchange
;}
187
void
setAllowarchchange
(
const
bool
allowarchchange
) {
_allowarchchange
=
allowarchchange
;}
188
189
bool
allowvendorchange
()
const
{
return
_allowvendorchange
;}
190
void
setAllowvendorchange
(
const
bool
allowvendorchange
) {
_allowvendorchange
=
allowvendorchange
;}
191
192
bool
allowuninstall
()
const
{
return
_allowuninstall
;}
193
void
setAllowuninstall
(
const
bool
allowuninstall
) {
_allowuninstall
=
allowuninstall
;}
194
195
bool
updatesystem
()
const
{
return
_updatesystem
;}
196
void
setUpdatesystem
(
const
bool
updatesystem
) {
_updatesystem
=
updatesystem
;}
197
198
bool
noupdateprovide
()
const
{
return
_noupdateprovide
;}
199
void
setNoupdateprovide
(
const
bool
noupdateprovide
) {
_noupdateprovide
=
noupdateprovide
;}
200
201
bool
dosplitprovides
()
const
{
return
_dosplitprovides
;}
202
void
setDosplitprovides
(
const
bool
dosplitprovides
) {
_dosplitprovides
=
dosplitprovides
;}
203
204
bool
onlyRequires
()
const
{
return
_onlyRequires
;}
205
void
setOnlyRequires
(
const
bool
onlyRequires
) {
_onlyRequires
=
onlyRequires
;}
206
207
bool
solveSrcPackages
()
const
{
return
_solveSrcPackages
; }
208
void
setSolveSrcPackages
(
bool
state_r ) {
_solveSrcPackages
= state_r; }
209
210
bool
cleandepsOnRemove
()
const
{
return
_cleandepsOnRemove
; }
211
void
setCleandepsOnRemove
(
bool
state_r ) {
_cleandepsOnRemove
= state_r; }
212
213
PoolItemList
problematicUpdateItems
(
void
)
const
{
return
_problem_items
; }
214
215
PoolItemList
resultItemsToInstall
() {
return
_result_items_to_install
; }
216
PoolItemList
resultItemsToRemove
() {
return
_result_items_to_remove
; }
217
PoolItemList
problematicUpdateItems
() {
return
_problem_items
; }
218
219
};
220
222
};
// namespace detail
225
};
// namespace solver
228
};
// namespace zypp
230
231
#endif // ZYPP_SOLVER_DETAIL_SAT_RESOLVER_H
zypp
solver
detail
SATResolver.h
Generated by
1.8.1