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
target
hal
modalias
rpm
CommitPackageCache.cc
CommitPackageCache.h
CommitPackageCacheImpl.cc
CommitPackageCacheImpl.h
CommitPackageCacheReadAhead.cc
CommitPackageCacheReadAhead.h
HardLocksFile.cc
HardLocksFile.h
RequestedLocalesFile.cc
RequestedLocalesFile.h
SoftLocksFile.cc
SoftLocksFile.h
TargetCallbackReceiver.cc
TargetCallbackReceiver.h
TargetException.cc
TargetException.h
TargetImpl.cc
TargetImpl.h
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
TargetCallbackReceiver.cc
Go to the documentation of this file.
1
/*---------------------------------------------------------------------\
2
| ____ _ __ __ ___ |
3
| |__ / \ / / . \ . \ |
4
| / / \ V /| _/ _/ |
5
| / /__ | | | | | | |
6
| /_____||_| |_| |_| |
7
| |
8
\---------------------------------------------------------------------*/
13
#include "
zypp/target/TargetCallbackReceiver.h
"
14
15
#include "
zypp/target/rpm/RpmCallbacks.h
"
16
18
namespace
zypp
19
{
20
21
namespace
target
22
{
23
24
RpmInstallPackageReceiver::RpmInstallPackageReceiver
(
Resolvable::constPtr
res)
25
: callback::ReceiveReport<rpm::
RpmInstallReport
> ()
26
, _resolvable (res)
27
, _level( target::rpm::InstallResolvableReport::RPM )
28
, _abort (false)
29
{
30
}
31
32
RpmInstallPackageReceiver::~RpmInstallPackageReceiver
()
33
{
34
}
35
36
void
RpmInstallPackageReceiver::reportbegin
()
37
{
38
}
39
40
void
RpmInstallPackageReceiver::reportend
()
41
{
42
}
43
45
void
RpmInstallPackageReceiver::start
(
const
Pathname & name )
46
{
47
_report
->start(
_resolvable
);
48
_abort
=
false
;
49
}
50
55
bool
RpmInstallPackageReceiver::progress
(
unsigned
percent )
56
{
57
_abort
= !
_report
->progress( percent,
_resolvable
);
58
return
_abort
;
59
}
60
61
rpm::RpmInstallReport::Action
62
RpmInstallPackageReceiver::problem
(
Exception
& excpt_r )
63
{
64
rpm::InstallResolvableReport::Action
user =
65
_report
->problem(
_resolvable
66
,
rpm::InstallResolvableReport::INVALID
67
, excpt_r.
asUserHistory
()
68
,
_level
69
);
70
71
switch
(user) {
72
case
rpm::InstallResolvableReport::RETRY
:
73
return
rpm::RpmInstallReport::RETRY
;
74
case
rpm::InstallResolvableReport::ABORT
:
75
_abort
=
true
;
76
return
rpm::RpmInstallReport::ABORT
;
77
case
rpm::InstallResolvableReport::IGNORE
:
78
return
rpm::RpmInstallReport::IGNORE
;
79
}
80
81
return
rpm::RpmInstallReport::problem
( excpt_r );
82
}
83
84
void
RpmInstallPackageReceiver::finishInfo
(
const
std::string & info_r )
85
{
86
_finishInfo
= info_r;
87
}
88
90
void
RpmInstallPackageReceiver::finish
()
91
{
92
_report
->finish(
_resolvable
,
rpm::InstallResolvableReport::NO_ERROR
,
_finishInfo
,
_level
);
93
}
94
96
void
RpmInstallPackageReceiver::finish
(
Exception
& excpt_r )
97
{
98
_report
->finish(
_resolvable
,
rpm::InstallResolvableReport::INVALID
, std::string(),
_level
);
99
}
100
101
void
RpmInstallPackageReceiver::tryLevel
(
target::rpm::InstallResolvableReport::RpmLevel
level_r )
102
{
103
_level
= level_r;
104
}
105
106
110
111
RpmRemovePackageReceiver::RpmRemovePackageReceiver
(
Resolvable::constPtr
res)
112
: callback::ReceiveReport<rpm::
RpmRemoveReport
> ()
113
, _resolvable (res)
114
, _abort(false)
115
{
116
}
117
118
RpmRemovePackageReceiver::~RpmRemovePackageReceiver
()
119
{
120
}
121
122
void
RpmRemovePackageReceiver::reportbegin
()
123
{
124
}
125
126
void
RpmRemovePackageReceiver::reportend
()
127
{
128
}
129
131
void
RpmRemovePackageReceiver::start
(
const
std::string & name )
132
{
133
_report
->start(
_resolvable
);
134
_abort
=
false
;
135
}
136
141
bool
RpmRemovePackageReceiver::progress
(
unsigned
percent )
142
{
143
_abort
= !
_report
->progress( percent,
_resolvable
);
144
return
_abort
;
145
}
146
147
rpm::RpmRemoveReport::Action
148
RpmRemovePackageReceiver::problem
(
Exception
& excpt_r )
149
{
150
rpm::RemoveResolvableReport::Action
user =
151
_report
->problem(
_resolvable
152
,
rpm::RemoveResolvableReport::INVALID
153
, excpt_r.
asUserHistory
()
154
);
155
156
switch
(user) {
157
case
rpm::RemoveResolvableReport::RETRY
:
158
return
rpm::RpmRemoveReport::RETRY
;
159
case
rpm::RemoveResolvableReport::ABORT
:
160
_abort
=
true
;
161
return
rpm::RpmRemoveReport::ABORT
;
162
case
rpm::RemoveResolvableReport::IGNORE
:
163
return
rpm::RpmRemoveReport::IGNORE
;
164
}
165
166
return
rpm::RpmRemoveReport::problem
( excpt_r );
167
}
168
169
void
RpmRemovePackageReceiver::finishInfo
(
const
std::string & info_r )
170
{
171
_finishInfo
= info_r;
172
}
173
175
void
RpmRemovePackageReceiver::finish
()
176
{
177
_report
->progress( 100,
_resolvable
);
178
_report
->finish(
_resolvable
,
rpm::RemoveResolvableReport::NO_ERROR
,
_finishInfo
);
179
}
180
182
void
RpmRemovePackageReceiver::finish
(
Exception
& excpt_r )
183
{
184
_report
->finish(
_resolvable
,
rpm::RemoveResolvableReport::INVALID
, std::string() );
185
}
186
188
}
// namespace target
190
192
}
// namespace zypp
zypp
target
TargetCallbackReceiver.cc
Generated by
1.8.1