libzypp: zypp/ng/repo/workflows/repodownloaderwf.cc Source File

libzypp 17.38.15

repodownloaderwf.cc
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
9#include "repodownloaderwf.h"
10#include <fstream>
11#include <utility>
12
13#include <zypp-common/PublicKey.h>
14#include <zypp-core/ng/pipelines/mtry.h>
15#include <zypp-media/ng/ProvideSpec>
16
17#include <zypp/KeyRing.h>
18#include <zypp/ZConfig.h>
19#include <zypp-core/base/LogTools.h>
20
21#include <zypp/ng/Context>
22#include <zypp/ng/media/Provide>
23#include <zypp/ng/repo/Downloader>
24#include <zypp/ng/repo/workflows/plaindir.h>
25#include <zypp/ng/repo/workflows/rpmmd.h>
26#include <zypp/ng/repo/workflows/susetags.h>
27#include <zypp/ng/reporthelper.h>
28
29#include <zypp-core/ng/pipelines/transform.h>
30#include <zypp/ng/workflows/repoinfowf.h>
31#include <zypp/ng/workflows/signaturecheckwf.h>
32
33#include <zypp/parser/yum/RepomdFileReader.h>
34#include <zypp/repo/RepoException.h>
35#include <zypp/repo/RepoMirrorList.h>
36#include <zypp/repo/PluginSigcheck.h>
37
38#undef ZYPP_BASE_LOGGER_LOGGROUP
39#define ZYPP_BASE_LOGGER_LOGGROUP "zypp::repomanager"
40
41
42namespace zyppng {
43 namespace {
44
45 using namespace zyppng::operators;
46
47 struct DownloadMasterIndexLogic
48 {
49 public:
50 using MediaHandle = typename Provide::MediaHandle;
51 using ProvideRes = typename Provide::Res;
52
53 DownloadMasterIndexLogic( repo::DownloadContextRef &&ctxRef, MediaHandle &&mediaHandle, zypp::filesystem::Pathname &&masterIndex_r )
54 : _dlContext( std::move(ctxRef) )
55 , _media(std::move( mediaHandle ))
56 , _masterIndex(std::move( masterIndex_r ))
57 { }
58
59 public:
60 MaybeAwaitable<expected<repo::DownloadContextRef>> execute( ) {
61 BLOCKTRACE("DownloadMasterIndexLogic");
62 zypp::RepoInfo ri = _dlContext->repoInfo();
63 // always download them, even if repoGpgCheck is disabled
64 _sigpath = _masterIndex.extend( ".asc" );
65 _keypath = _masterIndex.extend( ".key" );
66 _destdir = _dlContext->destDir();
67
68 static const std::string rinfoSigcheckTag { "repo_sigcheck_plugin" };
69 if ( ri.hasExtraValue( rinfoSigcheckTag ) ) {
70 zypp::Pathname rmRoot { _dlContext->zyppContext()->config().repoManagerRoot() };
71 zypp::Pathname plugindir { _dlContext->zyppContext()->config().pluginsPath() };
72 _sigcheckPlugins = zypp::SigcheckPlugins( ri.extraValue( rinfoSigcheckTag ), plugindir );
73 if ( _sigcheckPlugins ) {
74 try {
75 _sigcheckPlugins.launch( rmRoot );
76 } catch ( ... ) {
77 return expected<repo::DownloadContextRef>::error( std::current_exception() );
78 }
79 }
80 }
81
82 auto providerRef = _dlContext->zyppContext()->provider();
83 return provider()->provide( _media, _masterIndex, ProvideFileSpec().setDownloadSize( zypp::ByteCount( 20, zypp::ByteCount::MB ) ).setMirrorsAllowed( false ) )
84 | and_then( [this]( ProvideRes && masterres ) {
85 // update the gpg keys provided by the repo
86 return RepoInfoWorkflow::fetchGpgKeys( _dlContext->zyppContext(), _dlContext->repoInfo() )
87 | and_then( [this](){
88 // fetch signature and maybe key file
89 return provider()->provide( _media, _sigpath, ProvideFileSpec().setOptional( true ).setDownloadSize( zypp::ByteCount( 20, zypp::ByteCount::MB ) ).setMirrorsAllowed( false ) )
90
91 | and_then( Provide::copyResultToDest ( provider(), _destdir / _sigpath ) )
92
93 | [this]( expected<zypp::ManagedFile> sigFile ) {
94 zypp::Pathname sigpathLocal { _destdir/_sigpath };
95 if ( !sigFile.is_valid () || !zypp::PathInfo(sigpathLocal).isExist() ) {
96 return makeReadyTask(expected<void>::success()); // no sigfile, valid result
97 }
98 _dlContext->files().push_back( std::move(*sigFile) );
99
100 // check if we got the key, if not we fall back to downloading the .key file
101 auto expKeyId = mtry( &KeyRing::readSignatureKeyId, _dlContext->zyppContext()->keyRing(), sigpathLocal );
102 if ( expKeyId && !_dlContext->zyppContext()->keyRing()->isKeyKnown(*expKeyId) ) {
103
104 bool needsMirrorToFetchKey = _dlContext->repoInfo().baseUrlsEmpty() && _dlContext->repoInfo().mirrorListUrl().isValid() ;
105 if ( needsMirrorToFetchKey ) {
106 // when dealing with mirrors we notify the user to use gpgKeyUrl instead of
107 // fetching the gpg key from any mirror
108 JobReportHelper( _dlContext->zyppContext() ).warning(_("Downloading signature key via mirrors, consider explicitly setting gpgKeyUrl via the repository configuration instead."));
109 }
110
111 // we did not get the key via gpgUrl downloads, lets fallback
112 return provider()->provide( _media, _keypath, ProvideFileSpec().setOptional( true ).setDownloadSize( zypp::ByteCount( 20, zypp::ByteCount::MB ) ).setMirrorsAllowed(needsMirrorToFetchKey) )
113 | and_then( Provide::copyResultToDest ( provider(), _destdir / _keypath ) )
114 | and_then( [this]( zypp::ManagedFile keyFile ) {
115
116 _dlContext->files().push_back( std::move(keyFile));
117 return expected<void>::success();
118 });
119 }
120
121 // we should not reach this line, but if we do we continue and fail later if its required
122 return makeReadyTask(expected<void>::success());
123 };
124 })
125 | [masterres=std::move(masterres)]( expected<void> ) {
126 return make_expected_success( std::move(masterres) );
127 };
128
129 } )
130
131 // copy everything into a directory
132 | and_then( Provide::copyResultToDest ( providerRef, _destdir / _masterIndex ) )
133 | and_then( [this]( zypp::ManagedFile &&masterIndex ) {
134 _masterIndexFile = std::move(masterIndex);
135 return expected<void>::success();
136 } )
137
138 // execute plugin verification if there is one
139 | and_then( std::bind( &DownloadMasterIndexLogic::pluginVerification, this ) )
140
141 // signature check plugins
142 | and_then( std::bind( &DownloadMasterIndexLogic::executeSigcheckPlugins, this ) )
143
144 // signature checking
145 | and_then( std::bind( &DownloadMasterIndexLogic::signatureCheck, this ) )
146
147 // final tasks
148 | and_then([this]() {
149 // Accepted!
150 _dlContext->repoInfo().setMetadataPath( _destdir );
151 _dlContext->repoInfo().setValidRepoSignature( _repoSigValidated );
152
153 // release the media handle
154 _media = MediaHandle();
155 auto &allFiles = _dlContext->files();
156
157 // make sure the masterIndex is in front
158 allFiles.insert( allFiles.begin(), std::move(_masterIndexFile) );
159 return make_expected_success( std::move(_dlContext) );
160 });
161 }
162
163
164 private:
165 ProvideRef provider () {
166 return _dlContext->zyppContext()->provider();
167 }
168
169 MaybeAwaitable<expected<void>> executeSigcheckPlugins()
170 {
171 // If no plugins, wrap the result in a task that is already finished.
172 if ( !_sigcheckPlugins ) {
173 return makeReadyTask( expected<void>::success() );
174 }
175 BLOCKTRACE("executeSigcheckPlugins");
176
177 MaybeAwaitable<expected<void>> chain = makeReadyTask( expected<void>::success() );
178
179 for ( auto & plugin : _sigcheckPlugins.plugins() ) {
180 auto * pluginPtr = &plugin; // Get the stable address
181 for ( const auto & ext : { plugin.sigExtension(), plugin.keyExtension() } ) {
182 if ( ext.empty() )
183 continue;
184 zypp::Pathname extpath { _masterIndex.extend( ext ) };
185 zypp::Pathname extdest { _destdir / extpath };
186
187 // Chain the next download to the previous one
188 chain = std::move(chain) | and_then([this, extpath, extdest, pluginPtr]() {
189 return provider()->provide( _media, extpath, ProvideFileSpec().setOptional( false ).setMirrorsAllowed( false ) )
190 | and_then( Provide::copyResultToDest( provider(), extdest ) )
191 | and_then( [this]( zypp::ManagedFile downloaded_r ) {
192 _dlContext->files().push_back( std::move(downloaded_r) );
193 return expected<void>::success();
194 });
195 });
196 }
197
198 // now verify
199 chain = std::move(chain) | and_then([this, pluginPtr]() {
200 const zypp::Pathname masterIndexLocal { _destdir / _masterIndex };
201 zypp::Pathname sig;
202 if ( not pluginPtr->sigExtension().empty() ) {
203 sig = _destdir / _masterIndex.extend( pluginPtr->sigExtension() );
204 }
205 zypp::Pathname key;
206 if ( not pluginPtr->keyExtension().empty() ) {
207 key = _destdir / _masterIndex.extend( pluginPtr->keyExtension() );
208 }
209 try {
210 pluginPtr->sigcheck( masterIndexLocal, sig, key );
211 } catch ( ... ) {
212 return expected<void>::error( std::current_exception() );
213 }
214 return expected<void>::success();
215 });
216 }
217 return chain;
218 }
219
220 // Traditional gpg sigcheck
221 MaybeAwaitable<expected<void>> signatureCheck () {
222 BLOCKTRACE("signatureCheck");
223
224 if ( _dlContext->repoInfo().repoGpgCheck() ) {
225
226 // The local files are in destdir_r, if they were present on the server
227 zypp::Pathname masterIndexLocal { _destdir/_masterIndex };
228 zypp::Pathname sigpathLocal { _destdir/_sigpath };
229 zypp::Pathname keypathLocal { _destdir/_keypath };
230 bool isSigned = zypp::PathInfo(sigpathLocal).isExist();
231
232 if ( isSigned || _dlContext->repoInfo().repoGpgCheckIsMandatory() ) {
233
234 auto verifyCtx = zypp::keyring::VerifyFileContext( masterIndexLocal );
235
236 // only add the signature if it exists
237 if ( isSigned )
238 verifyCtx.signature( sigpathLocal );
239
240 // only add the key if it exists
241 if ( zypp::PathInfo(keypathLocal).isExist() ) {
242 try {
243 _dlContext->zyppContext()->keyRing()->importKey( zypp::PublicKey(keypathLocal), false );
244 } catch (...) {
245 return makeReadyTask( expected<void>::error( ZYPP_FWD_CURRENT_EXCPT() ) );
246 }
247 }
248
249 // set the checker context even if the key is not known
250 // (unsigned repo, key file missing; bnc #495977)
251 verifyCtx.keyContext( _dlContext->repoInfo() );
252
253 return getExtraKeysInRepomd()
254 | and_then([this, vCtx = std::move(verifyCtx) ]() mutable {
255 for ( const auto &keyData : _buddyKeys ) {
256 DBG << "Keyhint remember buddy " << keyData << std::endl;
257 vCtx.addBuddyKey( keyData.id() );
258 }
259
260 return SignatureFileCheckWorkflow::verifySignature( _dlContext->zyppContext(), std::move(vCtx))
261 | and_then([ this ]( zypp::keyring::VerifyFileContext verRes ){
262 // remember the validation status
263 _repoSigValidated = verRes.fileValidated();
264 return expected<void>::success();
265 });
266 });
267
268 } else {
269 WAR << "Accept unsigned repository because repoGpgCheck is not mandatory for " << _dlContext->repoInfo().alias() << std::endl;
270 }
271 } else {
272 WAR << "Signature checking disabled in config of repository " << _dlContext->repoInfo().alias() << std::endl;
273 }
274 return makeReadyTask(expected<void>::success());
275 }
276
277 // execute the repo verification if there is one
278 expected<void> pluginVerification () {
279 zypp::Pathname masterIndexLocal { _destdir/_masterIndex };
280 // The local files are in destdir_r, if they were present on the server
281 zypp::Pathname sigpathLocal { _destdir/_sigpath };
282 zypp::Pathname keypathLocal { _destdir/_keypath };
283
284 if ( _dlContext->pluginRepoverification() && _dlContext->pluginRepoverification()->isNeeded() ) {
285 try {
286
287 if ( zypp::PathInfo(sigpathLocal).isExist() && !zypp::PathInfo(keypathLocal).isExist() ) {
288 auto kr = _dlContext->zyppContext()->keyRing();
289 // if we have a signature but no keyfile, we need to export it from the keyring
290 auto expKeyId = mtry( &KeyRing::readSignatureKeyId, kr.get(), sigpathLocal );
291 if ( !expKeyId ) {
292 MIL << "Failed to read signature from file: " << sigpathLocal << std::endl;
293 } else {
294 std::ofstream os( keypathLocal.c_str() );
295 if ( kr->isKeyKnown(*expKeyId) ) {
296 kr->dumpPublicKey(
297 *expKeyId,
298 kr->isKeyTrusted(*expKeyId),
299 os
300 );
301 }
302 }
303 }
304
305 _dlContext->pluginRepoverification()->getChecker( sigpathLocal, keypathLocal, _dlContext->repoInfo() )( masterIndexLocal );
306 } catch ( ... ) {
307 return expected<void>::error( std::current_exception () );
308 }
309 }
310 return expected<void>::success();
311 }
312
317 MaybeAwaitable<expected<void>> getExtraKeysInRepomd () {
318 BLOCKTRACE("getExtraKeysInRepomd");
319 const zypp::Pathname masterIndexLocal { _destdir / _masterIndex };
320
321 if ( _masterIndex.basename() != "repomd.xml" ) {
322 return makeReadyTask( expected<void>::success() );
323 }
324
325 std::vector<std::pair<std::string,std::string>> keyhints { zypp::parser::yum::RepomdFileReader(masterIndexLocal).keyhints() };
326 if ( keyhints.empty() )
327 return makeReadyTask( expected<void>::success() );
328 DBG << "Check keyhints: " << keyhints.size() << std::endl;
329
330 auto keyRing { _dlContext->zyppContext()->keyRing() };
331 return std::move( keyhints )
332 | transform( [this, keyRing]( std::pair<std::string, std::string> val ) {
333
334 const auto& [ file, keyid ] = val;
335 if ( not zypp::PublicKey::isSafeKeyId( keyid ) ) {
336 const std::string str { zypp::str::Str() << "Keyhint is too short to safely identify a gpg key. Skip auto import:" << keyid << " (" << file << ")" };
337 WAR << str << std::endl;
338 return makeReadyTask(expected<zypp::PublicKeyData>::error( std::make_exception_ptr( zypp::Exception(str)) ));
339 }
340
341 auto keyData = keyRing->trustedPublicKeyData( keyid );
342 if ( keyData ) {
343 DBG << "Keyhint is already trusted: " << keyid << " (" << file << ")" << std::endl;
344 return makeReadyTask ( expected<zypp::PublicKeyData>::success(keyData) ); // already a trusted key
345 }
346
347 DBG << "Keyhint search key " << keyid << " (" << file << ")" << std::endl;
348
349 keyData = keyRing->publicKeyData( keyid );
350 if ( keyData )
351 return makeReadyTask( expected<zypp::PublicKeyData>::success(keyData) );
352
353 // TODO: Enhance the key caching in general...
354 const zypp::ZConfig & conf = _dlContext->zyppContext()->config();
355 zypp::Pathname cacheFile = conf.repoManagerRoot() / conf.pubkeyCachePath() / file;
356
357 return zypp::PublicKey::noThrow(cacheFile)
358 | [ keyid = keyid ]( auto &&key ){
359 if ( key.fileProvidesKey( keyid ) )
360 return make_expected_success( std::forward<decltype(key)>(key) );
361 else
362 return expected<zypp::PublicKey>::error( std::make_exception_ptr (zypp::Exception("File does not provide key")));
363 }
364 | or_else ([ this, file = file, keyid = keyid, cacheFile ] ( auto ) mutable -> MaybeAwaitable<expected<zypp::PublicKey>> {
365 auto providerRef = _dlContext->zyppContext()->provider();
366 return providerRef->provide( _media, file, ProvideFileSpec().setOptional(true).setMirrorsAllowed(false) )
367 | and_then( Provide::copyResultToDest( providerRef, _destdir / file ) )
368 | and_then( [this, providerRef, file, keyid , cacheFile = std::move(cacheFile)]( zypp::ManagedFile &&res ) {
369
370 // remember we downloaded the file
371 _dlContext->files().push_back ( std::move(res) );
372
373 auto key = zypp::PublicKey::noThrow( _dlContext->files().back() );
374 if ( not key.fileProvidesKey( keyid ) ) {
375 const std::string str = (zypp::str::Str() << "Keyhint " << file << " does not contain a key with id " << keyid << ". Skipping it.");
376 WAR << str << std::endl;
377 return makeReadyTask(expected<zypp::PublicKey>::error( std::make_exception_ptr( zypp::Exception(str)) ));
378 }
379
380 // Try to cache it...
381 zypp::filesystem::assert_dir( cacheFile.dirname() );
382 return providerRef->copyFile( key.path(), cacheFile )
383 | [ key ]( expected<zypp::ManagedFile> res ) mutable {
384 if ( res ) {
385 // do not delete from cache
386 res->resetDispose ();
387 }
388 return expected<zypp::PublicKey>::success( std::move(key) );
389 };
390 });
391 })
392 | and_then( [ keyRing, keyid = keyid ]( zypp::PublicKey key ){
393 keyRing->importKey( key, false ); // store in general keyring (not trusted!)
394 return expected<zypp::PublicKeyData>::success(keyRing->publicKeyData( keyid )); // fetch back from keyring in case it was a hidden key
395 });
396 })
397 | [this] ( std::vector<expected<zypp::PublicKeyData>> &&keyHints ) mutable {
398 std::for_each( keyHints.begin(), keyHints.end(), [this]( expected<zypp::PublicKeyData> &keyData ){
399 if ( keyData && *keyData ) {
400 _buddyKeys.push_back ( std::move(keyData.get()) );
401 }
402 });
403
404 MIL << "Check keyhints done. Buddy keys: " << _buddyKeys.size() << std::endl;
405 return expected<void>::success();
406 };
407 }
408
409 repo::DownloadContextRef _dlContext;
410 MediaHandle _media;
411 zypp::Pathname _masterIndex;
412
413 zypp::Pathname _destdir;
414 zypp::Pathname _sigpath;
415 zypp::Pathname _keypath;
416 zypp::ManagedFile _masterIndexFile;
417 zypp::TriBool _repoSigValidated = zypp::indeterminate;
418
419 std::vector<zypp::PublicKeyData> _buddyKeys;
420
421 zypp::SigcheckPlugins _sigcheckPlugins;
422 };
423
424 }
425
426 MaybeAwaitable<expected<repo::DownloadContextRef> > RepoDownloaderWorkflow::downloadMasterIndex(repo::DownloadContextRef dl, ProvideMediaHandle mediaHandle, zypp::Pathname masterIndex_r)
427 {
428 DownloadMasterIndexLogic impl( std::move(dl), std::move(mediaHandle), std::move(masterIndex_r) );
429 zypp_co_return zypp_co_await( impl.execute() );
430 }
431
432 MaybeAwaitable<expected<repo::DownloadContextRef>> RepoDownloaderWorkflow::downloadMasterIndex ( repo::DownloadContextRef dl, LazyMediaHandle<Provide> mediaHandle, zypp::filesystem::Pathname masterIndex_r )
433 {
434 using namespace zyppng::operators;
435 return dl->zyppContext()->provider()->attachMediaIfNeeded( mediaHandle )
436 | and_then([ dl, mi = std::move(masterIndex_r) ]( ProvideMediaHandle handle ) mutable {
437 return downloadMasterIndex( std::move(dl), std::move(handle), std::move(mi) );
438 });
439 }
440
441
442 namespace {
443 auto statusImpl ( repo::DownloadContextRef dlCtx, ProvideMediaHandle &&mediaHandle ) {
444 const auto finalizeStatus = [ dlCtx ]( zypp::RepoStatus status ){
445 return expected<zypp::RepoStatus>::success( zypp::RepoStatus( dlCtx->repoInfo()) && status );
446 };
447
448 switch( dlCtx->repoInfo().type().toEnum()) {
449 case zypp::repo::RepoType::RPMMD_e:
450 return RpmmdWorkflows::repoStatus( dlCtx, std::forward<ProvideMediaHandle>(mediaHandle) ) | and_then( std::move(finalizeStatus) );
451 case zypp::repo::RepoType::YAST2_e:
452 return SuseTagsWorkflows::repoStatus( dlCtx, std::forward<ProvideMediaHandle>(mediaHandle) ) | and_then( std::move(finalizeStatus) );
453 case zypp::repo::RepoType::RPMPLAINDIR_e:
454 return PlaindirWorkflows::repoStatus ( dlCtx, std::forward<ProvideMediaHandle>(mediaHandle) ) | and_then( std::move(finalizeStatus) );
455 case zypp::repo::RepoType::NONE_e:
456 break;
457 }
458
459 return makeReadyTask<expected<zypp::RepoStatus>>( expected<zypp::RepoStatus>::error( ZYPP_EXCPT_PTR (zypp::repo::RepoUnknownTypeException(dlCtx->repoInfo()))) );
460 }
461 }
462
463 MaybeAwaitable<expected<zypp::RepoStatus> > RepoDownloaderWorkflow::repoStatus(repo::DownloadContextRef dl, ProvideMediaHandle mediaHandle) {
464 return statusImpl( dl, std::move(mediaHandle) );
465 }
466
467 MaybeAwaitable<expected<zypp::RepoStatus> > RepoDownloaderWorkflow::repoStatus( repo::DownloadContextRef dl, LazyMediaHandle<Provide> mediaHandle ) {
468 using namespace zyppng::operators;
469 return dl->zyppContext()->provider()->attachMediaIfNeeded( mediaHandle )
470 | and_then([ dl ]( ProvideMediaHandle handle ) {
471 return repoStatus( dl, std::move(handle) );
472 });
473 }
474
475 namespace {
476 auto downloadImpl ( repo::DownloadContextRef dlCtx, ProvideMediaHandle &&mediaHandle, ProgressObserverRef &&progressObserver ) {
477 switch( dlCtx->repoInfo().type().toEnum()) {
478 case zypp::repo::RepoType::RPMMD_e:
479 return RpmmdWorkflows::download( std::move(dlCtx), std::forward<ProvideMediaHandle>(mediaHandle), std::move(progressObserver) );
480 case zypp::repo::RepoType::YAST2_e:
481 return SuseTagsWorkflows::download( std::move(dlCtx), std::forward<ProvideMediaHandle>(mediaHandle), std::move(progressObserver) );
482 case zypp::repo::RepoType::RPMPLAINDIR_e:
483 return PlaindirWorkflows::download ( std::move(dlCtx), std::forward<ProvideMediaHandle>(mediaHandle) );
484 case zypp::repo::RepoType::NONE_e:
485 break;
486 }
487
488 return makeReadyTask<expected<repo::DownloadContextRef> >( expected<repo::DownloadContextRef>::error( ZYPP_EXCPT_PTR (zypp::repo::RepoUnknownTypeException(dlCtx->repoInfo()))) );
489 }
490 }
491
492 MaybeAwaitable<expected<repo::DownloadContextRef> > RepoDownloaderWorkflow::download(repo::DownloadContextRef dl, ProvideMediaHandle mediaHandle, ProgressObserverRef progressObserver)
493 {
494 return downloadImpl( dl, std::move(mediaHandle), std::move(progressObserver) );
495 }
496
497 MaybeAwaitable<expected<repo::DownloadContextRef> > RepoDownloaderWorkflow::download(repo::DownloadContextRef dl, LazyMediaHandle<Provide> mediaHandle, ProgressObserverRef progressObserver)
498 {
499 using namespace zyppng::operators;
500 return dl->zyppContext()->provider()->attachMediaIfNeeded( mediaHandle )
501 | and_then([ dl, po = std::move(progressObserver) ]( ProvideMediaHandle handle ) mutable {
502 return downloadImpl( dl, std::move(handle), std::move(po) );
503 });
504 }
505}
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
KeyRing.h
LogTools.h
DBG
#define DBG
Definition Logger.h:129
MIL
#define MIL
Definition Logger.h:130
WAR
#define WAR
Definition Logger.h:131
BLOCKTRACE
#define BLOCKTRACE(M)
Definition Logger.h:51
PluginSigcheck.h
PublicKey.h
RepoException.h
RepoMirrorList.h
RepomdFileReader.h
Interface of repomd.xml file reader.
ZConfig.h
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:196
zypp::PublicKey
Class representing one GPG Public Key (PublicKeyData + ASCII armored in a tempfile).
Definition PublicKey.h:378
zypp::PublicKey::isSafeKeyId
static bool isSafeKeyId(const std::string &id_r)
!<
Definition PublicKey.h:445
zypp::PublicKey::noThrow
static PublicKey noThrow(const Pathname &keyFile_r)
Static ctor returning an empty PublicKey rather than throwing.
Definition PublicKey.cc:637
zypp::RepoInfo
What is known about a repository.
Definition RepoInfo.h:72
zypp::RepoInfo::hasExtraValue
bool hasExtraValue(const std::string &key_r) const
Whether an extra value for key_r is set.
Definition RepoInfo.cc:1248
zypp::RepoInfo::extraValue
std::string extraValue(const std::string &key_r) const
Return extra value for key_r or throws std::out_of_range.
Definition RepoInfo.cc:1251
zypp::RepoStatus
Track changing files or directories.
Definition RepoStatus.h:41
zypp::SigcheckPlugins
Handle a bunch of SigcheckPlugins.
Definition PluginSigcheck.h:105
zypp::ZConfig
Interim helper class to collect global options and settings.
Definition ZConfig.h:82
zypp::ZConfig::repoManagerRoot
Pathname repoManagerRoot() const
The RepoManager root directory.
Definition ZConfig.cc:834
zypp::ZConfig::pubkeyCachePath
Pathname pubkeyCachePath() const
Path where the pubkey caches.
Definition ZConfig.cc:928
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:48
zypp::filesystem::Pathname::extend
Pathname extend(const std::string &r) const
Append string r to the last component of the path.
Definition Pathname.h:192
zypp::filesystem::Pathname::dirname
Pathname dirname() const
Return all but the last component od this path.
Definition Pathname.h:133
zypp::filesystem::Pathname::c_str
const char * c_str() const
String representation.
Definition Pathname.h:113
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:226
zypp::repo::RepoUnknownTypeException
thrown when it was impossible to determine this repo type.
Definition RepoException.h:143
zyppng::JobReportHelper::JobReportHelper
JobReportHelper(ContextRef r)
Definition reporthelper.h:135
zyppng::LazyMediaHandle
Definition lazymediahandle.h:20
zyppng::ProvideFileSpec::ProvideFileSpec
ProvideFileSpec()
Definition providespec.cc:192
zyppng::ProvideMediaHandle
Definition provide.h:27
zyppng::ProvideRes
Definition provide.h:44
zyppng::Provide::Res
ProvideRes Res
Definition provide.h:111
zyppng::Provide::copyResultToDest
static auto copyResultToDest(ProvideRef provider, const zypp::Pathname &targetPath)
Definition provide.h:139
zyppng::Provide::MediaHandle
ProvideMediaHandle MediaHandle
Definition provide.h:109
zyppng::expected
Definition expected.h:56
zyppng::expected::success
static expected success(ConsParams &&...params)
Definition expected.h:178
zyppng::expected::error
static expected error(ConsParams &&...params)
Definition expected.h:189
zyppng::expected::error
E & error()
Definition expected.h:288
zypp::TriBool
boost::logic::tribool TriBool
3-state boolean logic (true, false and indeterminate).
Definition String.h:31
mtry.h
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:338
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
zyppng::PlaindirWorkflows::download
MaybeAwaitable< expected< repo::DownloadContextRef > > download(repo::DownloadContextRef dl, ProvideMediaHandle mediaHandle, ProgressObserverRef progressObserver)
Definition plaindir.cc:75
zyppng::PlaindirWorkflows::repoStatus
MaybeAwaitable< expected< zypp::RepoStatus > > repoStatus(repo::DownloadContextRef dl, ProvideMediaHandle mediaHandle)
Definition plaindir.cc:38
zyppng::RepoDownloaderWorkflow::repoStatus
MaybeAwaitable< expected< zypp::RepoStatus > > repoStatus(repo::DownloadContextRef dl, ProvideMediaHandle mediaHandle)
Definition repodownloaderwf.cc:463
zyppng::RepoDownloaderWorkflow::download
MaybeAwaitable< expected< repo::DownloadContextRef > > download(repo::DownloadContextRef dl, ProvideMediaHandle mediaHandle, ProgressObserverRef progressObserver=nullptr)
Definition repodownloaderwf.cc:492
zyppng::RepoDownloaderWorkflow::downloadMasterIndex
MaybeAwaitable< expected< repo::DownloadContextRef > > downloadMasterIndex(repo::DownloadContextRef dl, ProvideMediaHandle mediaHandle, zypp::filesystem::Pathname masterIndex_r)
Definition repodownloaderwf.cc:426
zyppng::RepoInfoWorkflow::fetchGpgKeys
MaybeAwaitable< expected< void > > fetchGpgKeys(ContextRef ctx, zypp::RepoInfo info)
Definition repoinfowf.cc:130
zyppng::RpmmdWorkflows::download
MaybeAwaitable< expected< repo::DownloadContextRef > > download(repo::DownloadContextRef dl, ProvideMediaHandle mediaHandle, ProgressObserverRef progressObserver)
Definition rpmmd.cc:155
zyppng::RpmmdWorkflows::repoStatus
MaybeAwaitable< expected< zypp::RepoStatus > > repoStatus(repo::DownloadContextRef dl, ProvideMediaHandle mediaHandle)
Definition rpmmd.cc:68
zyppng::SignatureFileCheckWorkflow::verifySignature
MaybeAwaitable< expected< zypp::keyring::VerifyFileContext > > verifySignature(ContextRef ctx, zypp::keyring::VerifyFileContext context)
Definition signaturecheckwf.cc:54
zyppng::SuseTagsWorkflows::download
MaybeAwaitable< expected< repo::DownloadContextRef > > download(repo::DownloadContextRef dl, ProvideMediaHandle mediaHandle, ProgressObserverRef progressObserver)
Definition susetags.cc:312
zyppng::SuseTagsWorkflows::repoStatus
MaybeAwaitable< expected< zypp::RepoStatus > > repoStatus(repo::DownloadContextRef dl, ProvideMediaHandle mediaHandle)
Definition susetags.cc:78
zyppng::operators
Definition expected.h:699
zyppng::operators::or_else
auto or_else(Fun &&function)
Definition expected.h:715
zyppng::operators::and_then
auto and_then(Fun &&function)
Definition expected.h:708
zyppng::operators::transform
auto transform(Transformation &&transformation)
Definition transform.h:95
zyppng::operators::mtry
auto mtry(Fun &&function)
Definition mtry.h:71
zyppng
Definition MediaNetworkRequestExecutor.h:16
zyppng::and_then
ResultType and_then(const expected< T, E > &exp, Function &&f)
Definition expected.h:520
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
susetags.h
transform.h