libzypp 17.38.14
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
15#include <zypp-media/ng/ProvideSpec>
16
17#include <zypp/KeyRing.h>
18#include <zypp/ZConfig.h>
20
21#include <zypp/ng/Context>
22#include <zypp/ng/media/Provide>
23#include <zypp/ng/repo/Downloader>
28
32
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));
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);
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) );
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 }
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();
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 }
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 auto keyData = keyRing->trustedPublicKeyData( keyid );
336 if ( keyData ) {
337 DBG << "Keyhint is already trusted: " << keyid << " (" << file << ")" << std::endl;
338 return makeReadyTask ( expected<zypp::PublicKeyData>::success(keyData) ); // already a trusted key
339 }
340
341 DBG << "Keyhint search key " << keyid << " (" << file << ")" << std::endl;
342
343 keyData = keyRing->publicKeyData( keyid );
344 if ( keyData )
345 return makeReadyTask( expected<zypp::PublicKeyData>::success(keyData) );
346
347 // TODO: Enhance the key caching in general...
348 const zypp::ZConfig & conf = _dlContext->zyppContext()->config();
349 zypp::Pathname cacheFile = conf.repoManagerRoot() / conf.pubkeyCachePath() / file;
350
351 return zypp::PublicKey::noThrow(cacheFile)
352 | [ keyid = keyid ]( auto &&key ){
353 if ( key.fileProvidesKey( keyid ) )
354 return make_expected_success( std::forward<decltype(key)>(key) );
355 else
356 return expected<zypp::PublicKey>::error( std::make_exception_ptr (zypp::Exception("File does not provide key")));
357 }
358 | or_else ([ this, file = file, keyid = keyid, cacheFile ] ( auto ) mutable -> MaybeAwaitable<expected<zypp::PublicKey>> {
359 auto providerRef = _dlContext->zyppContext()->provider();
360 return providerRef->provide( _media, file, ProvideFileSpec().setOptional(true).setMirrorsAllowed(false) )
361 | and_then( Provide::copyResultToDest( providerRef, _destdir / file ) )
362 | and_then( [this, providerRef, file, keyid , cacheFile = std::move(cacheFile)]( zypp::ManagedFile &&res ) {
363
364 // remember we downloaded the file
365 _dlContext->files().push_back ( std::move(res) );
366
367 auto key = zypp::PublicKey::noThrow( _dlContext->files().back() );
368 if ( not key.fileProvidesKey( keyid ) ) {
369 const std::string str = (zypp::str::Str() << "Keyhint " << file << " does not contain a key with id " << keyid << ". Skipping it.");
370 WAR << str << std::endl;
371 return makeReadyTask(expected<zypp::PublicKey>::error( std::make_exception_ptr( zypp::Exception(str)) ));
372 }
373
374 // Try to cache it...
376 return providerRef->copyFile( key.path(), cacheFile )
377 | [ key ]( expected<zypp::ManagedFile> res ) mutable {
378 if ( res ) {
379 // do not delete from cache
380 res->resetDispose ();
381 }
382 return expected<zypp::PublicKey>::success( std::move(key) );
383 };
384 });
385 })
386 | and_then( [ keyRing, keyid = keyid ]( zypp::PublicKey key ){
387 keyRing->importKey( key, false ); // store in general keyring (not trusted!)
388 return expected<zypp::PublicKeyData>::success(keyRing->publicKeyData( keyid )); // fetch back from keyring in case it was a hidden key
389 });
390 })
391 | [this] ( std::vector<expected<zypp::PublicKeyData>> &&keyHints ) mutable {
392 std::for_each( keyHints.begin(), keyHints.end(), [this]( expected<zypp::PublicKeyData> &keyData ){
393 if ( keyData && *keyData ) {
394 if ( not zypp::PublicKey::isSafeKeyId( keyData->id() ) ) {
395 WAR << "Keyhint " << keyData->id() << " for " << *keyData << " is not strong enough for auto import. Just caching it." << std::endl;
396 return;
397 }
398 _buddyKeys.push_back ( std::move(keyData.get()) );
399 }
400 });
401
402 MIL << "Check keyhints done. Buddy keys: " << _buddyKeys.size() << std::endl;
404 };
405 }
406
407 repo::DownloadContextRef _dlContext;
408 MediaHandle _media;
409 zypp::Pathname _masterIndex;
410
411 zypp::Pathname _destdir;
412 zypp::Pathname _sigpath;
413 zypp::Pathname _keypath;
414 zypp::ManagedFile _masterIndexFile;
415 zypp::TriBool _repoSigValidated = zypp::indeterminate;
416
417 std::vector<zypp::PublicKeyData> _buddyKeys;
418
419 zypp::SigcheckPlugins _sigcheckPlugins;
420 };
421
422 }
423
424 MaybeAwaitable<expected<repo::DownloadContextRef> > RepoDownloaderWorkflow::downloadMasterIndex(repo::DownloadContextRef dl, ProvideMediaHandle mediaHandle, zypp::Pathname masterIndex_r)
425 {
426 DownloadMasterIndexLogic impl( std::move(dl), std::move(mediaHandle), std::move(masterIndex_r) );
427 zypp_co_return zypp_co_await( impl.execute() );
428 }
429
430 MaybeAwaitable<expected<repo::DownloadContextRef>> RepoDownloaderWorkflow::downloadMasterIndex ( repo::DownloadContextRef dl, LazyMediaHandle<Provide> mediaHandle, zypp::filesystem::Pathname masterIndex_r )
431 {
432 using namespace zyppng::operators;
433 return dl->zyppContext()->provider()->attachMediaIfNeeded( mediaHandle )
434 | and_then([ dl, mi = std::move(masterIndex_r) ]( ProvideMediaHandle handle ) mutable {
435 return downloadMasterIndex( std::move(dl), std::move(handle), std::move(mi) );
436 });
437 }
438
439
440 namespace {
441 auto statusImpl ( repo::DownloadContextRef dlCtx, ProvideMediaHandle &&mediaHandle ) {
442 const auto finalizeStatus = [ dlCtx ]( zypp::RepoStatus status ){
443 return expected<zypp::RepoStatus>::success( zypp::RepoStatus( dlCtx->repoInfo()) && status );
444 };
445
446 switch( dlCtx->repoInfo().type().toEnum()) {
448 return RpmmdWorkflows::repoStatus( dlCtx, std::forward<ProvideMediaHandle>(mediaHandle) ) | and_then( std::move(finalizeStatus) );
450 return SuseTagsWorkflows::repoStatus( dlCtx, std::forward<ProvideMediaHandle>(mediaHandle) ) | and_then( std::move(finalizeStatus) );
452 return PlaindirWorkflows::repoStatus ( dlCtx, std::forward<ProvideMediaHandle>(mediaHandle) ) | and_then( std::move(finalizeStatus) );
454 break;
455 }
456
457 return makeReadyTask<expected<zypp::RepoStatus>>( expected<zypp::RepoStatus>::error( ZYPP_EXCPT_PTR (zypp::repo::RepoUnknownTypeException(dlCtx->repoInfo()))) );
458 }
459 }
460
461 MaybeAwaitable<expected<zypp::RepoStatus> > RepoDownloaderWorkflow::repoStatus(repo::DownloadContextRef dl, ProvideMediaHandle mediaHandle) {
462 return statusImpl( dl, std::move(mediaHandle) );
463 }
464
465 MaybeAwaitable<expected<zypp::RepoStatus> > RepoDownloaderWorkflow::repoStatus( repo::DownloadContextRef dl, LazyMediaHandle<Provide> mediaHandle ) {
466 using namespace zyppng::operators;
467 return dl->zyppContext()->provider()->attachMediaIfNeeded( mediaHandle )
468 | and_then([ dl ]( ProvideMediaHandle handle ) {
469 return repoStatus( dl, std::move(handle) );
470 });
471 }
472
473 namespace {
474 auto downloadImpl ( repo::DownloadContextRef dlCtx, ProvideMediaHandle &&mediaHandle, ProgressObserverRef &&progressObserver ) {
475 switch( dlCtx->repoInfo().type().toEnum()) {
477 return RpmmdWorkflows::download( std::move(dlCtx), std::forward<ProvideMediaHandle>(mediaHandle), std::move(progressObserver) );
479 return SuseTagsWorkflows::download( std::move(dlCtx), std::forward<ProvideMediaHandle>(mediaHandle), std::move(progressObserver) );
481 return PlaindirWorkflows::download ( std::move(dlCtx), std::forward<ProvideMediaHandle>(mediaHandle) );
483 break;
484 }
485
486 return makeReadyTask<expected<repo::DownloadContextRef> >( expected<repo::DownloadContextRef>::error( ZYPP_EXCPT_PTR (zypp::repo::RepoUnknownTypeException(dlCtx->repoInfo()))) );
487 }
488 }
489
490 MaybeAwaitable<expected<repo::DownloadContextRef> > RepoDownloaderWorkflow::download(repo::DownloadContextRef dl, ProvideMediaHandle mediaHandle, ProgressObserverRef progressObserver)
491 {
492 return downloadImpl( dl, std::move(mediaHandle), std::move(progressObserver) );
493 }
494
495 MaybeAwaitable<expected<repo::DownloadContextRef> > RepoDownloaderWorkflow::download(repo::DownloadContextRef dl, LazyMediaHandle<Provide> mediaHandle, ProgressObserverRef progressObserver)
496 {
497 using namespace zyppng::operators;
498 return dl->zyppContext()->provider()->attachMediaIfNeeded( mediaHandle )
499 | and_then([ dl, po = std::move(progressObserver) ]( ProvideMediaHandle handle ) mutable {
500 return downloadImpl( dl, std::move(handle), std::move(po) );
501 });
502 }
503}
#define ZYPP_EXCPT_PTR(EXCPT)
Drops a logline and returns Exception as a std::exception_ptr.
Definition Exception.h:463
#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
#define DBG
Definition Logger.h:129
#define MIL
Definition Logger.h:130
#define WAR
Definition Logger.h:131
#define BLOCKTRACE(M)
Definition Logger.h:51
Interface of repomd.xml file reader.
Store and operate with byte count.
Definition ByteCount.h:32
static const Unit MB
1000^2 Byte
Definition ByteCount.h:61
Base class for Exception.
Definition Exception.h:153
std::string readSignatureKeyId(const Pathname &signature)
reads the public key id from a signature
Definition KeyRing.cc:196
Class representing one GPG Public Key (PublicKeyData + ASCII armored in a tempfile).
Definition PublicKey.h:375
static PublicKey noThrow(const Pathname &keyFile_r)
Static ctor returning an empty PublicKey rather than throwing.
Definition PublicKey.cc:634
What is known about a repository.
Definition RepoInfo.h:72
bool hasExtraValue(const std::string &key_r) const
Whether an extra value for key_r is set.
Definition RepoInfo.cc:1263
std::string extraValue(const std::string &key_r) const
Return extra value for key_r or throws std::out_of_range.
Definition RepoInfo.cc:1266
Track changing files or directories.
Definition RepoStatus.h:41
Handle a bunch of SigcheckPlugins.
Interim helper class to collect global options and settings.
Definition ZConfig.h:82
Pathname repoManagerRoot() const
The RepoManager root directory.
Definition ZConfig.cc:834
Pathname pubkeyCachePath() const
Path where the pubkey caches.
Definition ZConfig.cc:928
Wrapper class for stat/lstat.
Definition PathInfo.h:226
bool isExist() const
Return whether valid stat info exists.
Definition PathInfo.h:286
Pathname extend(const std::string &r) const
Append string r to the last component of the path.
Definition Pathname.h:192
Pathname dirname() const
Return all but the last component od this path.
Definition Pathname.h:133
const char * c_str() const
String representation.
Definition Pathname.h:113
I/O context for KeyRing::verifyFileSignatureWorkflow.
bool fileValidated() const
Whether the signature was actually successfully verified.
Reads through a repomd.xml file and collects type, location, checksum and other data about metadata f...
std::vector< std::pair< std::string, std::string > > keyhints() const
gpg key hits shipped in keywords (bsc#1184326)
thrown when it was impossible to determine this repo type.
bool warning(std::string msg_r, UserData userData_r=UserData())
send warning text
ProvideRes Res
Definition provide.h:111
static auto copyResultToDest(ProvideRef provider, const zypp::Pathname &targetPath)
Definition provide.h:139
ProvideMediaHandle MediaHandle
Definition provide.h:109
static expected success(ConsParams &&...params)
Definition expected.h:178
static expected error(ConsParams &&...params)
Definition expected.h:189
boost::logic::tribool TriBool
3-state boolean logic (true, false and indeterminate).
Definition String.h:31
String related utilities and Regular expression matching.
int assert_dir(const Pathname &path, unsigned mode)
Like 'mkdir -p'.
Definition PathInfo.cc:338
AutoDispose< const Pathname > ManagedFile
A Pathname plus associated cleanup code to be executed when path is no longer needed.
Definition ManagedFile.h:27
MaybeAwaitable< expected< repo::DownloadContextRef > > download(repo::DownloadContextRef dl, ProvideMediaHandle mediaHandle, ProgressObserverRef progressObserver)
Definition plaindir.cc:75
MaybeAwaitable< expected< zypp::RepoStatus > > repoStatus(repo::DownloadContextRef dl, ProvideMediaHandle mediaHandle)
Definition plaindir.cc:38
MaybeAwaitable< expected< zypp::RepoStatus > > repoStatus(repo::DownloadContextRef dl, ProvideMediaHandle mediaHandle)
MaybeAwaitable< expected< repo::DownloadContextRef > > download(repo::DownloadContextRef dl, ProvideMediaHandle mediaHandle, ProgressObserverRef progressObserver=nullptr)
MaybeAwaitable< expected< repo::DownloadContextRef > > downloadMasterIndex(repo::DownloadContextRef dl, ProvideMediaHandle mediaHandle, zypp::filesystem::Pathname masterIndex_r)
MaybeAwaitable< expected< void > > fetchGpgKeys(ContextRef ctx, zypp::RepoInfo info)
MaybeAwaitable< expected< repo::DownloadContextRef > > download(repo::DownloadContextRef dl, ProvideMediaHandle mediaHandle, ProgressObserverRef progressObserver)
Definition rpmmd.cc:155
MaybeAwaitable< expected< zypp::RepoStatus > > repoStatus(repo::DownloadContextRef dl, ProvideMediaHandle mediaHandle)
Definition rpmmd.cc:68
MaybeAwaitable< expected< zypp::keyring::VerifyFileContext > > verifySignature(ContextRef ctx, zypp::keyring::VerifyFileContext context)
MaybeAwaitable< expected< repo::DownloadContextRef > > download(repo::DownloadContextRef dl, ProvideMediaHandle mediaHandle, ProgressObserverRef progressObserver)
Definition susetags.cc:312
MaybeAwaitable< expected< zypp::RepoStatus > > repoStatus(repo::DownloadContextRef dl, ProvideMediaHandle mediaHandle)
Definition susetags.cc:78
auto and_then(Fun &&function)
Definition expected.h:708
static expected< std::decay_t< Type >, Err > make_expected_success(Type &&t)
Definition expected.h:470
ResultType or_else(const expected< T, E > &exp, Function &&f)
Definition expected.h:554
ResultType and_then(const expected< T, E > &exp, Function &&f)
Definition expected.h:520
auto transform(Container< Msg, CArgs... > &&val, Transformation &&transformation)
Definition transform.h:64
auto mtry(F &&f, Args &&...args)
Definition mtry.h:50
Convenient building of std::string via std::ostringstream Basically a std::ostringstream autoconverti...
Definition String.h:213