libzypp 17.37.10

repodownloaderwf.cc
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
9#include "repodownloaderwf.h"
10#include "zypp/ng/reporthelper.h"
11#include <zypp-core/zyppng/pipelines/mtry.h>
12#include <zypp/parser/yum/RepomdFileReader.h>
13#include <zypp/repo/RepoMirrorList.h>
14
15#include <utility>
16#include <fstream>
17#include <zypp-media/ng/Provide>
18#include <zypp-media/ng/ProvideSpec>
19#include <zypp/ng/Context>
20#include <zypp/ng/repo/Downloader>
21#include <zypp-common/PublicKey.h>
22#include <zypp/KeyRing.h>
23
24#include <zypp/ng/workflows/signaturecheckwf.h>
25#include <zypp/ng/workflows/repoinfowf.h>
26#include <zypp/ng/workflows/logichelpers.h>
27#include <zypp/ng/repo/workflows/rpmmd.h>
28#include <zypp/ng/repo/workflows/susetags.h>
29#include <zypp/ng/repo/workflows/plaindir.h>
30
31// sync workflow helpers
32#include <zypp/ng/workflows/contextfacade.h>
33#include <zypp/ng/workflows/mediafacade.h>
34
35#undef ZYPP_BASE_LOGGER_LOGGROUP
36#define ZYPP_BASE_LOGGER_LOGGROUP "zypp::repomanager"
37
38
39 namespace zyppng {
40 namespace {
41
42 using namespace zyppng::operators;
43
44 template < class Executor, class OpType >
45 struct DownloadMasterIndexLogic : public LogicBase<Executor, OpType>
46 {
47 public:
48 ZYPP_ENABLE_LOGIC_BASE(Executor, OpType);
49
50 using DlContextRefType = std::conditional_t<zyppng::detail::is_async_op_v<OpType>, repo::AsyncDownloadContextRef, repo::SyncDownloadContextRef>;
51 using ZyppContextType = typename remove_smart_ptr_t<DlContextRefType>::ContextType;
52 using ProvideType = typename ZyppContextType::ProvideType;
53 using MediaHandle = typename ProvideType::MediaHandle;
54 using ProvideRes = typename ProvideType::Res;
55
56 DownloadMasterIndexLogic( DlContextRefType &&ctxRef, MediaHandle &&mediaHandle, zypp::filesystem::Pathname &&masterIndex_r )
57 : _dlContext( std::move(ctxRef) )
58 , _media(std::move( mediaHandle ))
59 , _masterIndex(std::move( masterIndex_r ))
60 { }
61
62 public:
63 MaybeAsyncRef<expected<DlContextRefType>> execute( ) {
64
65 zypp::RepoInfo ri = _dlContext->repoInfo();
66 // always download them, even if repoGpgCheck is disabled
67 _sigpath = _masterIndex.extend( ".asc" );
68 _keypath = _masterIndex.extend( ".key" );
69 _destdir = _dlContext->destDir();
70
71 auto providerRef = _dlContext->zyppContext()->provider();
72 return provider()->provide( _media, _masterIndex, ProvideFileSpec().setDownloadSize( zypp::ByteCount( 20, zypp::ByteCount::MB ) ).setMirrorsAllowed( false ) )
73 | and_then( [this]( ProvideRes && masterres ) {
74 // update the gpg keys provided by the repo
75 return RepoInfoWorkflow::fetchGpgKeys( _dlContext->zyppContext(), _dlContext->repoInfo() )
76 | and_then( [this](){
77
78 // fetch signature and maybe key file
79 return provider()->provide( _media, _sigpath, ProvideFileSpec().setOptional( true ).setDownloadSize( zypp::ByteCount( 20, zypp::ByteCount::MB ) ).setMirrorsAllowed( false ) )
80
81 | and_then( ProvideType::copyResultToDest ( provider(), _destdir / _sigpath ) )
82
83 | [this]( expected<zypp::ManagedFile> sigFile ) {
84 zypp::Pathname sigpathLocal { _destdir/_sigpath };
85 if ( !sigFile.is_valid () || !zypp::PathInfo(sigpathLocal).isExist() ) {
86 return makeReadyResult(expected<void>::success()); // no sigfile, valid result
87 }
88 _dlContext->files().push_back( std::move(*sigFile) );
89
90 // check if we got the key, if not we fall back to downloading the .key file
91 auto expKeyId = mtry( &KeyRing::readSignatureKeyId, _dlContext->zyppContext()->keyRing(), sigpathLocal );
92 if ( expKeyId && !_dlContext->zyppContext()->keyRing()->isKeyKnown(*expKeyId) ) {
93
94 bool needsMirrorToFetchKey = _dlContext->repoInfo().baseUrlsEmpty() && _dlContext->repoInfo().mirrorListUrl().isValid() ;
95 if ( needsMirrorToFetchKey ) {
96 // when dealing with mirrors we notify the user to use gpgKeyUrl instead of
97 // fetching the gpg key from any mirror
98 JobReportHelper( _dlContext->zyppContext() ).warning(_("Downloading signature key via mirrors, consider explicitely setting gpgKeyUrl via the repository configuration instead."));
99 }
100
101 // we did not get the key via gpgUrl downloads, lets fallback
102 return provider()->provide( _media, _keypath, ProvideFileSpec().setOptional( true ).setDownloadSize( zypp::ByteCount( 20, zypp::ByteCount::MB ) ).setMirrorsAllowed(needsMirrorToFetchKey) )
103 | and_then( ProvideType::copyResultToDest ( provider(), _destdir / _keypath ) )
104 | and_then( [this]( zypp::ManagedFile keyFile ) {
105 _dlContext->files().push_back( std::move(keyFile));
106 return expected<void>::success();
107 });
108 }
109
110 // we should not reach this line, but if we do we continue and fail later if its required
111 return makeReadyResult(expected<void>::success());
112 };
113 })
114 | [this,masterres=std::move(masterres)]( expected<void> ) {
115 return make_expected_success( std::move(masterres) );
116 };
117
118 } )
119 // execute plugin verification if there is one
120 | and_then( std::bind( &DownloadMasterIndexLogic::pluginVerification, this, std::placeholders::_1 ) )
121
122 // signature checking
123 | and_then( std::bind( &DownloadMasterIndexLogic::signatureCheck, this, std::placeholders::_1 ) )
124
125 // copy everything into a directory
126 | and_then( ProvideType::copyResultToDest ( providerRef, _destdir / _masterIndex ) )
127
128 // final tasks
129 | and_then([this]( zypp::ManagedFile &&masterIndex ) {
130 // Accepted!
131 _dlContext->repoInfo().setMetadataPath( _destdir );
132 _dlContext->repoInfo().setValidRepoSignature( _repoSigValidated );
133
134 // release the media handle
135 _media = MediaHandle();
136 auto &allFiles = _dlContext->files();
137
138 // make sure the masterIndex is in front
139 allFiles.insert( allFiles.begin (), std::move(masterIndex) );
140 return make_expected_success( std::move(_dlContext) );
141 });
142 }
143
144
145 private:
146 auto provider () {
147 return _dlContext->zyppContext()->provider();
148 }
149
150 MaybeAsyncRef<expected<ProvideRes>> signatureCheck ( ProvideRes &&res ) {
151
152 if ( _dlContext->repoInfo().repoGpgCheck() ) {
153
154 // The local files are in destdir_r, if they were present on the server
155 zypp::Pathname sigpathLocal { _destdir/_sigpath };
156 zypp::Pathname keypathLocal { _destdir/_keypath };
157 bool isSigned = zypp::PathInfo(sigpathLocal).isExist();
158
159 if ( isSigned || _dlContext->repoInfo().repoGpgCheckIsMandatory() ) {
160
161 auto verifyCtx = zypp::keyring::VerifyFileContext( res.file() );
162
163 // only add the signature if it exists
164 if ( isSigned )
165 verifyCtx.signature( sigpathLocal );
166
167 // only add the key if it exists
168 if ( zypp::PathInfo(keypathLocal).isExist() ) {
169 try {
170 _dlContext->zyppContext()->keyRing()->importKey( zypp::PublicKey(keypathLocal), false );
171 } catch (...) {
172 return makeReadyResult( expected<ProvideRes>::error( ZYPP_FWD_CURRENT_EXCPT() ) );
173 }
174 }
175
176 // set the checker context even if the key is not known
177 // (unsigned repo, key file missing; bnc #495977)
178 verifyCtx.keyContext( _dlContext->repoInfo() );
179
180 return getExtraKeysInRepomd( std::move(res ) )
181 | and_then([this, vCtx = std::move(verifyCtx) ]( ProvideRes &&res ) mutable {
182 for ( const auto &keyData : _buddyKeys ) {
183 DBG << "Keyhint remember buddy " << keyData << std::endl;
184 vCtx.addBuddyKey( keyData.id() );
185 }
186
187 return SignatureFileCheckWorkflow::verifySignature( _dlContext->zyppContext(), std::move(vCtx))
188 | and_then([ this, res = std::move(res) ]( zypp::keyring::VerifyFileContext verRes ){
189 // remember the validation status
190 _repoSigValidated = verRes.fileValidated();
191 return make_expected_success(std::move(res));
192 });
193 });
194
195 } else {
196 WAR << "Accept unsigned repository because repoGpgCheck is not mandatory for " << _dlContext->repoInfo().alias() << std::endl;
197 }
198 } else {
199 WAR << "Signature checking disabled in config of repository " << _dlContext->repoInfo().alias() << std::endl;
200 }
201 return makeReadyResult(expected<ProvideRes>::success(res));
202 }
203
204 // execute the repo verification if there is one
205 expected<ProvideRes> pluginVerification ( ProvideRes &&prevRes ) {
206 // The local files are in destdir_r, if they were present on the server
207 zypp::Pathname sigpathLocal { _destdir/_sigpath };
208 zypp::Pathname keypathLocal { _destdir/_keypath };
209
210 if ( _dlContext->pluginRepoverification() && _dlContext->pluginRepoverification()->isNeeded() ) {
211 try {
212
213 if ( zypp::PathInfo(sigpathLocal).isExist() && !zypp::PathInfo(keypathLocal).isExist() ) {
214 auto kr = _dlContext->zyppContext()->keyRing();
215 // if we have a signature but no keyfile, we need to export it from the keyring
216 auto expKeyId = mtry( &KeyRing::readSignatureKeyId, kr.get(), sigpathLocal );
217 if ( !expKeyId ) {
218 MIL << "Failed to read signature from file: " << sigpathLocal << std::endl;
219 } else {
220 std::ofstream os( keypathLocal.c_str() );
221 if ( kr->isKeyKnown(*expKeyId) ) {
222 kr->dumpPublicKey(
223 *expKeyId,
224 kr->isKeyTrusted(*expKeyId),
225 os
226 );
227 }
228 }
229 }
230
231 _dlContext->pluginRepoverification()->getChecker( sigpathLocal, keypathLocal, _dlContext->repoInfo() )( prevRes.file() );
232 } catch ( ... ) {
233 return expected<ProvideRes>::error( std::current_exception () );
234 }
235 }
236 return make_expected_success(std::move(prevRes));
237 }
238
243 MaybeAsyncRef<expected<ProvideRes>> getExtraKeysInRepomd ( ProvideRes &&res ) {
244
245 if ( _masterIndex.basename() != "repomd.xml" ) {
246 return makeReadyResult( expected<ProvideRes>::success( std::move(res) ) );
247 }
248
249 std::vector<std::pair<std::string,std::string>> keyhints { zypp::parser::yum::RepomdFileReader(res.file()).keyhints() };
250 if ( keyhints.empty() )
251 return makeReadyResult( expected<ProvideRes>::success( std::move(res) ) );
252 DBG << "Check keyhints: " << keyhints.size() << std::endl;
253
254 auto keyRing { _dlContext->zyppContext()->keyRing() };
255 return zypp::parser::yum::RepomdFileReader(res.file()).keyhints()
256 | transform([this, keyRing]( std::pair<std::string, std::string> val ) {
257
258 const auto& [ file, keyid ] = val;
259 auto keyData = keyRing->trustedPublicKeyData( keyid );
260 if ( keyData ) {
261 DBG << "Keyhint is already trusted: " << keyid << " (" << file << ")" << std::endl;
262 return makeReadyResult ( expected<zypp::PublicKeyData>::success(keyData) ); // already a trusted key
263 }
264
265 DBG << "Keyhint search key " << keyid << " (" << file << ")" << std::endl;
266
267 keyData = keyRing->publicKeyData( keyid );
268 if ( keyData )
269 return makeReadyResult( expected<zypp::PublicKeyData>::success(keyData) );
270
271 // TODO: Enhance the key caching in general...
272 const zypp::ZConfig & conf = _dlContext->zyppContext()->config();
273 zypp::Pathname cacheFile = conf.repoManagerRoot() / conf.pubkeyCachePath() / file;
274
275 return zypp::PublicKey::noThrow(cacheFile)
276 | [ keyid = keyid ]( auto &&key ){
277 if ( key.fileProvidesKey( keyid ) )
278 return make_expected_success( std::forward<decltype(key)>(key) );
279 else
280 return expected<zypp::PublicKey>::error( std::make_exception_ptr (zypp::Exception("File does not provide key")));
281 }
282 | or_else ([ this, file = file, keyid = keyid, cacheFile ] ( auto ) mutable -> MaybeAsyncRef<expected<zypp::PublicKey>> {
283 auto providerRef = _dlContext->zyppContext()->provider();
284 return providerRef->provide( _media, file, ProvideFileSpec().setOptional(true).setMirrorsAllowed(false) )
285 | and_then( ProvideType::copyResultToDest( providerRef, _destdir / file ) )
286 | and_then( [this, providerRef, file, keyid , cacheFile = std::move(cacheFile)]( zypp::ManagedFile &&res ) {
287
288 // remember we downloaded the file
289 _dlContext->files().push_back ( std::move(res) );
290
291 auto key = zypp::PublicKey::noThrow( _dlContext->files().back() );
292 if ( not key.fileProvidesKey( keyid ) ) {
293 const std::string str = (zypp::str::Str() << "Keyhint " << file << " does not contain a key with id " << keyid << ". Skipping it.");
294 WAR << str << std::endl;
295 return makeReadyResult(expected<zypp::PublicKey>::error( std::make_exception_ptr( zypp::Exception(str)) ));
296 }
297
298 // Try to cache it...
299 zypp::filesystem::assert_dir( cacheFile.dirname() );
300 return providerRef->copyFile( key.path(), cacheFile )
301 | [ key ]( expected<zypp::ManagedFile> res ) mutable {
302 if ( res ) {
303 // do not delete from cache
304 res->resetDispose ();
305 }
306 return expected<zypp::PublicKey>::success( std::move(key) );
307 };
308 });
309 })
310 | and_then( [ keyRing, keyid = keyid ]( zypp::PublicKey key ){
311 keyRing->importKey( key, false ); // store in general keyring (not trusted!)
312 return expected<zypp::PublicKeyData>::success(keyRing->publicKeyData( keyid )); // fetch back from keyring in case it was a hidden key
313 });
314 })
315 | [this, res = res] ( std::vector<expected<zypp::PublicKeyData>> &&keyHints ) mutable {
316 std::for_each( keyHints.begin(), keyHints.end(), [this]( expected<zypp::PublicKeyData> &keyData ){
317 if ( keyData && *keyData ) {
318 if ( not zypp::PublicKey::isSafeKeyId( keyData->id() ) ) {
319 WAR << "Keyhint " << keyData->id() << " for " << *keyData << " is not strong enough for auto import. Just caching it." << std::endl;
320 return;
321 }
322 _buddyKeys.push_back ( std::move(keyData.get()) );
323 }
324 });
325
326 MIL << "Check keyhints done. Buddy keys: " << _buddyKeys.size() << std::endl;
327 return expected<ProvideRes>::success (std::move(res));
328 };
329 }
330
331 DlContextRefType _dlContext;
332 MediaHandle _media;
333 zypp::Pathname _masterIndex;
334
335 zypp::Pathname _destdir;
336 zypp::Pathname _sigpath;
337 zypp::Pathname _keypath;
338 zypp::TriBool _repoSigValidated = zypp::indeterminate;
339
340 std::vector<zypp::PublicKeyData> _buddyKeys;
341 };
342
343 }
344
345 AsyncOpRef<expected<repo::AsyncDownloadContextRef> > RepoDownloaderWorkflow::downloadMasterIndex(repo::AsyncDownloadContextRef dl, ProvideMediaHandle mediaHandle, zypp::Pathname masterIndex_r)
346 {
347 return SimpleExecutor<DownloadMasterIndexLogic, AsyncOp<expected<repo::AsyncDownloadContextRef>>>::run( std::move(dl), std::move(mediaHandle), std::move(masterIndex_r) );
348 }
349
350 expected<repo::SyncDownloadContextRef> RepoDownloaderWorkflow::downloadMasterIndex(repo::SyncDownloadContextRef dl, SyncMediaHandle mediaHandle, zypp::Pathname masterIndex_r)
351 {
352 return SimpleExecutor<DownloadMasterIndexLogic, SyncOp<expected<repo::SyncDownloadContextRef>>>::run( std::move(dl), std::move(mediaHandle), std::move(masterIndex_r) );
353 }
354
355 AsyncOpRef<expected<repo::AsyncDownloadContextRef>> RepoDownloaderWorkflow::downloadMasterIndex ( repo::AsyncDownloadContextRef dl, AsyncLazyMediaHandle mediaHandle, zypp::filesystem::Pathname masterIndex_r )
356 {
357 using namespace zyppng::operators;
358 return dl->zyppContext()->provider()->attachMediaIfNeeded( mediaHandle )
359 | and_then([ dl, mi = std::move(masterIndex_r) ]( ProvideMediaHandle handle ) mutable {
360 return downloadMasterIndex( std::move(dl), std::move(handle), std::move(mi) );
361 });
362 }
363
364 expected<repo::SyncDownloadContextRef> RepoDownloaderWorkflow::downloadMasterIndex ( repo::SyncDownloadContextRef dl, SyncLazyMediaHandle mediaHandle, zypp::filesystem::Pathname masterIndex_r )
365 {
366 using namespace zyppng::operators;
367 return dl->zyppContext()->provider()->attachMediaIfNeeded( mediaHandle )
368 | and_then([ dl, mi = std::move(masterIndex_r) ]( SyncMediaHandle handle ) mutable {
369 return downloadMasterIndex( std::move(dl), std::move(handle), std::move(mi) );
370 });
371 }
372
373
374 namespace {
375 template <class DlContextRefType, class MediaHandleType>
376 auto statusImpl ( DlContextRefType dlCtx, MediaHandleType &&mediaHandle ) {
377
378 constexpr bool isAsync = std::is_same_v<DlContextRefType,repo::AsyncDownloadContextRef>;
379
380 const auto finalizeStatus = [ dlCtx ]( zypp::RepoStatus status ){
381 return expected<zypp::RepoStatus>::success( zypp::RepoStatus( dlCtx->repoInfo()) && status );
382 };
383
384 switch( dlCtx->repoInfo().type().toEnum()) {
385 case zypp::repo::RepoType::RPMMD_e:
386 return RpmmdWorkflows::repoStatus( dlCtx, std::forward<MediaHandleType>(mediaHandle) ) | and_then( std::move(finalizeStatus) );
387 case zypp::repo::RepoType::YAST2_e:
388 return SuseTagsWorkflows::repoStatus( dlCtx, std::forward<MediaHandleType>(mediaHandle) ) | and_then( std::move(finalizeStatus) );
389 case zypp::repo::RepoType::RPMPLAINDIR_e:
390 return PlaindirWorkflows::repoStatus ( dlCtx, std::forward<MediaHandleType>(mediaHandle) ) | and_then( std::move(finalizeStatus) );
391 case zypp::repo::RepoType::NONE_e:
392 break;
393 }
394
395 return makeReadyResult<expected<zypp::RepoStatus>, isAsync >( expected<zypp::RepoStatus>::error( ZYPP_EXCPT_PTR (zypp::repo::RepoUnknownTypeException(dlCtx->repoInfo()))) );
396 }
397 }
398
399 AsyncOpRef<expected<zypp::RepoStatus> > RepoDownloaderWorkflow::repoStatus(repo::AsyncDownloadContextRef dl, ProvideMediaHandle mediaHandle) {
400 return statusImpl( dl, std::move(mediaHandle) );
401 }
402
403 expected<zypp::RepoStatus> RepoDownloaderWorkflow::repoStatus(repo::SyncDownloadContextRef dl, SyncMediaHandle mediaHandle) {
404 return statusImpl( dl, std::move(mediaHandle) );
405 }
406
407 AsyncOpRef<expected<zypp::RepoStatus> > RepoDownloaderWorkflow::repoStatus( repo::AsyncDownloadContextRef dl, AsyncLazyMediaHandle mediaHandle ) {
408 using namespace zyppng::operators;
409 return dl->zyppContext()->provider()->attachMediaIfNeeded( mediaHandle )
410 | and_then([ dl ]( ProvideMediaHandle handle ) {
411 return repoStatus( dl, std::move(handle) );
412 });
413 }
414
415 expected<zypp::RepoStatus> RepoDownloaderWorkflow::repoStatus( repo::SyncDownloadContextRef dl, SyncLazyMediaHandle mediaHandle ) {
416 using namespace zyppng::operators;
417 return dl->zyppContext()->provider()->attachMediaIfNeeded( mediaHandle )
418 | and_then([ dl ]( SyncMediaHandle handle ) {
419 return repoStatus( dl, std::move(handle) );
420 });
421 }
422
423
424 namespace {
425 template <class DlContextRefType, class MediaHandleType>
426 auto downloadImpl ( DlContextRefType dlCtx, MediaHandleType &&mediaHandle, ProgressObserverRef &&progressObserver ) {
427
428 constexpr bool isAsync = std::is_same_v<DlContextRefType,repo::AsyncDownloadContextRef>;
429
430 switch( dlCtx->repoInfo().type().toEnum()) {
431 case zypp::repo::RepoType::RPMMD_e:
432 return RpmmdWorkflows::download( std::move(dlCtx), std::forward<MediaHandleType>(mediaHandle), std::move(progressObserver) );
433 case zypp::repo::RepoType::YAST2_e:
434 return SuseTagsWorkflows::download( std::move(dlCtx), std::forward<MediaHandleType>(mediaHandle), std::move(progressObserver) );
435 case zypp::repo::RepoType::RPMPLAINDIR_e:
436 return PlaindirWorkflows::download ( std::move(dlCtx), std::forward<MediaHandleType>(mediaHandle) );
437 case zypp::repo::RepoType::NONE_e:
438 break;
439 }
440
441 return makeReadyResult<expected<DlContextRefType>, isAsync >( expected<DlContextRefType>::error( ZYPP_EXCPT_PTR (zypp::repo::RepoUnknownTypeException(dlCtx->repoInfo()))) );
442 }
443 }
444
445 AsyncOpRef<expected<repo::AsyncDownloadContextRef> > RepoDownloaderWorkflow::download(repo::AsyncDownloadContextRef dl, ProvideMediaHandle mediaHandle, ProgressObserverRef progressObserver)
446 {
447 return downloadImpl( dl, std::move(mediaHandle), std::move(progressObserver) );
448 }
449
450 expected<repo::SyncDownloadContextRef> RepoDownloaderWorkflow::download(repo::SyncDownloadContextRef dl, SyncMediaHandle mediaHandle, ProgressObserverRef progressObserver)
451 {
452 return downloadImpl( dl, std::move(mediaHandle), std::move(progressObserver) );
453 }
454
455 AsyncOpRef<expected<repo::AsyncDownloadContextRef> > RepoDownloaderWorkflow::download(repo::AsyncDownloadContextRef dl, AsyncLazyMediaHandle mediaHandle, ProgressObserverRef progressObserver)
456 {
457 using namespace zyppng::operators;
458 return dl->zyppContext()->provider()->attachMediaIfNeeded( mediaHandle )
459 | and_then([ dl, po = std::move(progressObserver) ]( ProvideMediaHandle handle ) mutable {
460 return downloadImpl( dl, std::move(handle), std::move(po) );
461 });
462 }
463
464 expected<repo::SyncDownloadContextRef> RepoDownloaderWorkflow::download(repo::SyncDownloadContextRef dl, SyncLazyMediaHandle mediaHandle, ProgressObserverRef progressObserver)
465 {
466 using namespace zyppng::operators;
467 return dl->zyppContext()->provider()->attachMediaIfNeeded( mediaHandle )
468 | and_then([ dl, po = std::move(progressObserver) ]( SyncMediaHandle handle ) mutable {
469 return downloadImpl( dl, std::move(handle), std::move(po) );
470 });
471 }
472}
KeyRing.h
RepoMirrorList.h
RepomdFileReader.h
Interface of repomd.xml file reader.
zypp::ByteCount
Store and operate with byte count.
Definition ByteCount.h:32
zypp::ByteCount::MB
static const Unit MB
1000^2 Byte
Definition ByteCount.h:61
zypp::Exception
Base class for Exception.
Definition Exception.h:153
zypp::KeyRing::readSignatureKeyId
std::string readSignatureKeyId(const Pathname &signature)
reads the public key id from a signature
Definition KeyRing.cc:195
zypp::RepoInfo
What is known about a repository.
Definition RepoInfo.h:72
zypp::RepoStatus
Track changing files or directories.
Definition RepoStatus.h:41
zypp::ZConfig
Interim helper class to collect global options and settings.
Definition ZConfig.h:69
zypp::ZConfig::repoManagerRoot
Pathname repoManagerRoot() const
The RepoManager root directory.
Definition ZConfig.cc:980
zypp::ZConfig::pubkeyCachePath
Pathname pubkeyCachePath() const
Path where the pubkey caches.
Definition ZConfig.cc:1075
zypp::filesystem::PathInfo
Wrapper class for stat/lstat.
Definition PathInfo.h:226
zypp::filesystem::PathInfo::isExist
bool isExist() const
Return whether valid stat info exists.
Definition PathInfo.h:286
zypp::filesystem::Pathname
Pathname.
Definition Pathname.h:47
zypp::filesystem::Pathname::dirname
Pathname dirname() const
Return all but the last component od this path.
Definition Pathname.h:126
zypp::filesystem::Pathname::c_str
const char * c_str() const
String representation.
Definition Pathname.h:112
zypp::keyring::VerifyFileContext
I/O context for KeyRing::verifyFileSignatureWorkflow.
Definition KeyRingContexts.h:30
zypp::keyring::VerifyFileContext::fileValidated
bool fileValidated() const
Whether the signature was actually successfully verified.
Definition KeyRingContexts.cc:113
zypp::parser::yum::RepomdFileReader
Reads through a repomd.xml file and collects type, location, checksum and other data about metadata f...
Definition RepomdFileReader.h:39
zypp::parser::yum::RepomdFileReader::keyhints
std::vector< std::pair< std::string, std::string > > keyhints() const
gpg key hits shipped in keywords (bsc#1184326)
Definition RepomdFileReader.cc:210
zypp::repo::RepoUnknownTypeException
thrown when it was impossible to determine this repo type.
Definition RepoException.h:143
zyppng::JobReportHelper
Definition reporthelper.h:135
zyppng::JobReportHelper::warning
bool warning(std::string msg_r, UserData userData_r=UserData())
send warning text
Definition reporthelper.cc:206
zyppng::ProvideFileSpec
Definition providespec.h:92
zyppng::ProvideMediaHandle
Definition provide.h:55
zyppng::ProvideRes
A ProvideRes object is a reference counted ownership of a resource in the cache provided by a Provide...
Definition provideres.h:36
zyppng::SyncMediaHandle
Definition mediafacade.h:26
zyppng::expected
Definition expected.h:27
zyppng::expected::success
static expected success(ConsParams &&...params)
Definition expected.h:115
zyppng::expected::error
static expected error(ConsParams &&...params)
Definition expected.h:126
zyppng::expected::error
E & error()
Definition expected.h:225
contextfacade.h
logichelpers.h
ZYPP_ENABLE_LOGIC_BASE
#define ZYPP_ENABLE_LOGIC_BASE(Executor, OpType)
Definition logichelpers.h:223
mediafacade.h
mtry.h
std::conditional_t
typename conditional< B, T, F >::type conditional_t
Definition TypeTraits.h:39
str
String related utilities and Regular expression matching.
zypp::filesystem::assert_dir
int assert_dir(const Pathname &path, unsigned mode)
Like 'mkdir -p'.
Definition PathInfo.cc:324
zypp::ManagedFile
AutoDispose< const Pathname > ManagedFile
A Pathname plus associated cleanup code to be executed when path is no longer needed.
Definition ManagedFile.h:27
zypp::TriBool
boost::logic::tribool TriBool
3-state boolean logic (true, false and indeterminate).
Definition String.h:31
zyppng::PlaindirWorkflows::download
AsyncOpRef< expected< repo::AsyncDownloadContextRef > > download(repo::AsyncDownloadContextRef dl, ProvideMediaHandle mediaHandle, ProgressObserverRef progressObserver)
Definition plaindir.cc:88
zyppng::PlaindirWorkflows::repoStatus
AsyncOpRef< expected< zypp::RepoStatus > > repoStatus(repo::AsyncDownloadContextRef dl, ProvideMediaHandle mediaHandle)
Definition plaindir.cc:42
zyppng::RepoDownloaderWorkflow::download
AsyncOpRef< expected< repo::AsyncDownloadContextRef > > download(repo::AsyncDownloadContextRef dl, ProvideMediaHandle mediaHandle, ProgressObserverRef progressObserver=nullptr)
Definition repodownloaderwf.cc:445
zyppng::RepoDownloaderWorkflow::downloadMasterIndex
AsyncOpRef< expected< repo::AsyncDownloadContextRef > > downloadMasterIndex(repo::AsyncDownloadContextRef dl, ProvideMediaHandle mediaHandle, zypp::filesystem::Pathname masterIndex_r)
Definition repodownloaderwf.cc:345
zyppng::RepoDownloaderWorkflow::repoStatus
AsyncOpRef< expected< zypp::RepoStatus > > repoStatus(repo::AsyncDownloadContextRef dl, ProvideMediaHandle mediaHandle)
Definition repodownloaderwf.cc:399
zyppng::RepoInfoWorkflow::fetchGpgKeys
expected< void > fetchGpgKeys(SyncContextRef ctx, zypp::RepoInfo info)
Definition repoinfowf.cc:136
zyppng::RpmmdWorkflows::download
AsyncOpRef< expected< repo::AsyncDownloadContextRef > > download(repo::AsyncDownloadContextRef dl, ProvideMediaHandle mediaHandle, ProgressObserverRef progressObserver)
Definition rpmmd.cc:171
zyppng::RpmmdWorkflows::repoStatus
AsyncOpRef< expected< zypp::RepoStatus > > repoStatus(repo::AsyncDownloadContextRef dl, ProvideMediaHandle mediaHandle)
Definition rpmmd.cc:74
zyppng::SignatureFileCheckWorkflow::verifySignature
expected< zypp::keyring::VerifyFileContext > verifySignature(SyncContextRef ctx, zypp::keyring::VerifyFileContext context)
Definition signaturecheckwf.cc:58
zyppng::SuseTagsWorkflows::download
AsyncOpRef< expected< repo::AsyncDownloadContextRef > > download(repo::AsyncDownloadContextRef dl, ProvideMediaHandle mediaHandle, ProgressObserverRef progressObserver)
Definition susetags.cc:330
zyppng::SuseTagsWorkflows::repoStatus
AsyncOpRef< expected< zypp::RepoStatus > > repoStatus(repo::AsyncDownloadContextRef dl, ProvideMediaHandle mediaHandle)
Definition susetags.cc:84
zyppng::operators
Definition asyncresult.h:279
zyppng::operators::and_then
auto and_then(Fun &&function)
Definition expected.h:623
zyppng
Definition MediaNetworkRequestExecutor.h:16
zyppng::mtry
Exp mtry(F &&f, Args &&...args)
Definition mtry.h:28
zyppng::makeReadyResult
std::conditional_t< isAsync, AsyncOpRef< T >, T > makeReadyResult(T &&result)
Definition asyncop.h:297
zyppng::AsyncOpRef
std::shared_ptr< AsyncOp< T > > AsyncOpRef
Definition asyncop.h:255
zyppng::remove_smart_ptr_t
typename remove_smart_ptr< T >::type remove_smart_ptr_t
Definition type_traits.h:133
zyppng::make_expected_success
static expected< std::decay_t< Type >, Err > make_expected_success(Type &&t)
Definition expected.h:397
zyppng::AsyncLazyMediaHandle
LazyMediaHandle< Provide > AsyncLazyMediaHandle
Definition repodownloaderwf.h:33
zyppng::or_else
ResultType or_else(const expected< T, E > &exp, Function &&f)
Definition expected.h:463
zyppng::and_then
ResultType and_then(const expected< T, E > &exp, Function &&f)
Definition expected.h:423
zyppng::SyncLazyMediaHandle
LazyMediaHandle< MediaSyncFacade > SyncLazyMediaHandle
Definition repodownloaderwf.h:34
zyppng::transform
Container< Ret > transform(Container< Msg, CArgs... > &&val, Transformation &&transformation)
Definition transform.h:31
plaindir.h
repodownloaderwf.h
repoinfowf.h
reporthelper.h
rpmmd.h
signaturecheckwf.h
zypp::repo::RepoType::RPMMD_e
@ RPMMD_e
Definition RepoType.h:38
zypp::repo::RepoType::NONE_e
@ NONE_e
Definition RepoType.h:37
zypp::repo::RepoType::YAST2_e
@ YAST2_e
Definition RepoType.h:39
zypp::repo::RepoType::RPMPLAINDIR_e
@ RPMPLAINDIR_e
Definition RepoType.h:40
zypp::str::Str
Convenient building of std::string via std::ostringstream Basically a std::ostringstream autoconverti...
Definition String.h:213
zyppng::LogicBase
Definition logichelpers.h:161
zyppng::SimpleExecutor
Definition logichelpers.h:212
susetags.h
ZYPP_EXCPT_PTR
#define ZYPP_EXCPT_PTR(EXCPT)
Drops a logline and returns Exception as a std::exception_ptr.
Definition Exception.h:463
ZYPP_FWD_CURRENT_EXCPT
#define ZYPP_FWD_CURRENT_EXCPT()
Drops a logline and returns the current Exception as a std::exception_ptr.
Definition Exception.h:471
_
#define _(MSG)
Definition Gettext.h:39
DBG
#define DBG
Definition Logger.h:99
MIL
#define MIL
Definition Logger.h:100
WAR
#define WAR
Definition Logger.h:101