libzypp 17.38.8
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
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
89 // fetch signature and maybe key file
90 return provider()->provide( _media, _sigpath, ProvideFileSpec().setOptional( true ).setDownloadSize( zypp::ByteCount( 20, zypp::ByteCount::MB ) ).setMirrorsAllowed( false ) )
91
92 | and_then( Provide::copyResultToDest ( provider(), _destdir / _sigpath ) )
93
94 | [this]( expected<zypp::ManagedFile> sigFile ) {
95 zypp::Pathname sigpathLocal { _destdir/_sigpath };
96 if ( !sigFile.is_valid () || !zypp::PathInfo(sigpathLocal).isExist() ) {
97 return makeReadyTask(expected<void>::success()); // no sigfile, valid result
98 }
99 _dlContext->files().push_back( std::move(*sigFile) );
100
101 // check if we got the key, if not we fall back to downloading the .key file
102 auto expKeyId = mtry( &KeyRing::readSignatureKeyId, _dlContext->zyppContext()->keyRing(), sigpathLocal );
103 if ( expKeyId && !_dlContext->zyppContext()->keyRing()->isKeyKnown(*expKeyId) ) {
104
105 bool needsMirrorToFetchKey = _dlContext->repoInfo().baseUrlsEmpty() && _dlContext->repoInfo().mirrorListUrl().isValid() ;
106 if ( needsMirrorToFetchKey ) {
107 // when dealing with mirrors we notify the user to use gpgKeyUrl instead of
108 // fetching the gpg key from any mirror
109 JobReportHelper( _dlContext->zyppContext() ).warning(_("Downloading signature key via mirrors, consider explicitly setting gpgKeyUrl via the repository configuration instead."));
110 }
111
112 // we did not get the key via gpgUrl downloads, lets fallback
113 return provider()->provide( _media, _keypath, ProvideFileSpec().setOptional( true ).setDownloadSize( zypp::ByteCount( 20, zypp::ByteCount::MB ) ).setMirrorsAllowed(needsMirrorToFetchKey) )
114 | and_then( Provide::copyResultToDest ( provider(), _destdir / _keypath ) )
115 | and_then( [this]( zypp::ManagedFile keyFile ) {
116
117 _dlContext->files().push_back( std::move(keyFile));
119 });
120 }
121
122 // we should not reach this line, but if we do we continue and fail later if its required
123 return makeReadyTask(expected<void>::success());
124 };
125 })
126 | [masterres=std::move(masterres)]( expected<void> ) {
127 return make_expected_success( std::move(masterres) );
128 };
129
130 } )
131
132 // copy everything into a directory
133 | and_then( Provide::copyResultToDest ( providerRef, _destdir / _masterIndex ) )
134 | and_then( [this]( zypp::ManagedFile &&masterIndex ) {
135 _masterIndexFile = std::move(masterIndex);
137 } )
138
139 // execute plugin verification if there is one
140 | and_then( std::bind( &DownloadMasterIndexLogic::pluginVerification, this ) )
141
142 // signature check plugins
143 | and_then( std::bind( &DownloadMasterIndexLogic::executeSigcheckPlugins, this ) )
144
145 // signature checking
146 | and_then( std::bind( &DownloadMasterIndexLogic::signatureCheck, this ) )
147
148 // final tasks
149 | and_then([this]() {
150 // Accepted!
151 _dlContext->repoInfo().setMetadataPath( _destdir );
152 _dlContext->repoInfo().setValidRepoSignature( _repoSigValidated );
153
154 // release the media handle
155 _media = MediaHandle();
156 auto &allFiles = _dlContext->files();
157
158 // make sure the masterIndex is in front
159 allFiles.insert( allFiles.begin(), std::move(_masterIndexFile) );
160 return make_expected_success( std::move(_dlContext) );
161 });
162 }
163
164
165 private:
166 ProvideRef provider () {
167 return _dlContext->zyppContext()->provider();
168 }
169
170 MaybeAwaitable<expected<void>> executeSigcheckPlugins()
171 {
172 // If no plugins, wrap the result in a task that is already finished.
173 if ( !_sigcheckPlugins ) {
174 return makeReadyTask( expected<void>::success() );
175 }
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
223 if ( _dlContext->repoInfo().repoGpgCheck() ) {
224
225 // The local files are in destdir_r, if they were present on the server
226 zypp::Pathname masterIndexLocal { _destdir/_masterIndex };
227 zypp::Pathname sigpathLocal { _destdir/_sigpath };
228 zypp::Pathname keypathLocal { _destdir/_keypath };
229 bool isSigned = zypp::PathInfo(sigpathLocal).isExist();
230
231 if ( isSigned || _dlContext->repoInfo().repoGpgCheckIsMandatory() ) {
232
233 auto verifyCtx = zypp::keyring::VerifyFileContext( masterIndexLocal );
234
235 // only add the signature if it exists
236 if ( isSigned )
237 verifyCtx.signature( sigpathLocal );
238
239 // only add the key if it exists
240 if ( zypp::PathInfo(keypathLocal).isExist() ) {
241 try {
242 _dlContext->zyppContext()->keyRing()->importKey( zypp::PublicKey(keypathLocal), false );
243 } catch (...) {
244 return makeReadyTask( expected<void>::error( ZYPP_FWD_CURRENT_EXCPT() ) );
245 }
246 }
247
248 // set the checker context even if the key is not known
249 // (unsigned repo, key file missing; bnc #495977)
250 verifyCtx.keyContext( _dlContext->repoInfo() );
251
252 return getExtraKeysInRepomd()
253 | and_then([this, vCtx = std::move(verifyCtx) ]() mutable {
254 for ( const auto &keyData : _buddyKeys ) {
255 DBG << "Keyhint remember buddy " << keyData << std::endl;
256 vCtx.addBuddyKey( keyData.id() );
257 }
258
259 return SignatureFileCheckWorkflow::verifySignature( _dlContext->zyppContext(), std::move(vCtx))
260 | and_then([ this ]( zypp::keyring::VerifyFileContext verRes ){
261 // remember the validation status
262 _repoSigValidated = verRes.fileValidated();
264 });
265 });
266
267 } else {
268 WAR << "Accept unsigned repository because repoGpgCheck is not mandatory for " << _dlContext->repoInfo().alias() << std::endl;
269 }
270 } else {
271 WAR << "Signature checking disabled in config of repository " << _dlContext->repoInfo().alias() << std::endl;
272 }
273 return makeReadyTask(expected<void>::success());
274 }
275
276 // execute the repo verification if there is one
277 expected<void> pluginVerification () {
278 zypp::Pathname masterIndexLocal { _destdir/_masterIndex };
279 // The local files are in destdir_r, if they were present on the server
280 zypp::Pathname sigpathLocal { _destdir/_sigpath };
281 zypp::Pathname keypathLocal { _destdir/_keypath };
282
283 if ( _dlContext->pluginRepoverification() && _dlContext->pluginRepoverification()->isNeeded() ) {
284 try {
285
286 if ( zypp::PathInfo(sigpathLocal).isExist() && !zypp::PathInfo(keypathLocal).isExist() ) {
287 auto kr = _dlContext->zyppContext()->keyRing();
288 // if we have a signature but no keyfile, we need to export it from the keyring
289 auto expKeyId = mtry( &KeyRing::readSignatureKeyId, kr.get(), sigpathLocal );
290 if ( !expKeyId ) {
291 MIL << "Failed to read signature from file: " << sigpathLocal << std::endl;
292 } else {
293 std::ofstream os( keypathLocal.c_str() );
294 if ( kr->isKeyKnown(*expKeyId) ) {
295 kr->dumpPublicKey(
296 *expKeyId,
297 kr->isKeyTrusted(*expKeyId),
298 os
299 );
300 }
301 }
302 }
303
304 _dlContext->pluginRepoverification()->getChecker( sigpathLocal, keypathLocal, _dlContext->repoInfo() )( masterIndexLocal );
305 } catch ( ... ) {
306 return expected<void>::error( std::current_exception () );
307 }
308 }
310 }
311
316 MaybeAwaitable<expected<void>> getExtraKeysInRepomd () {
317 const zypp::Pathname masterIndexLocal { _destdir / _masterIndex };
318
319 if ( _masterIndex.basename() != "repomd.xml" ) {
320 return makeReadyTask( expected<void>::success() );
321 }
322
323 std::vector<std::pair<std::string,std::string>> keyhints { zypp::parser::yum::RepomdFileReader(masterIndexLocal).keyhints() };
324 if ( keyhints.empty() )
325 return makeReadyTask( expected<void>::success() );
326 DBG << "Check keyhints: " << keyhints.size() << std::endl;
327
328 auto keyRing { _dlContext->zyppContext()->keyRing() };
329 return std::move( keyhints )
330 | transform( [this, keyRing]( std::pair<std::string, std::string> val ) {
331
332 const auto& [ file, keyid ] = val;
333 auto keyData = keyRing->trustedPublicKeyData( keyid );
334 if ( keyData ) {
335 DBG << "Keyhint is already trusted: " << keyid << " (" << file << ")" << std::endl;
336 return makeReadyTask ( expected<zypp::PublicKeyData>::success(keyData) ); // already a trusted key
337 }
338
339 DBG << "Keyhint search key " << keyid << " (" << file << ")" << std::endl;
340
341 keyData = keyRing->publicKeyData( keyid );
342 if ( keyData )
343 return makeReadyTask( expected<zypp::PublicKeyData>::success(keyData) );
344
345 // TODO: Enhance the key caching in general...
346 const zypp::ZConfig & conf = _dlContext->zyppContext()->config();
347 zypp::Pathname cacheFile = conf.repoManagerRoot() / conf.pubkeyCachePath() / file;
348
349 return zypp::PublicKey::noThrow(cacheFile)
350 | [ keyid = keyid ]( auto &&key ){
351 if ( key.fileProvidesKey( keyid ) )
352 return make_expected_success( std::forward<decltype(key)>(key) );
353 else
354 return expected<zypp::PublicKey>::error( std::make_exception_ptr (zypp::Exception("File does not provide key")));
355 }
356 | or_else ([ this, file = file, keyid = keyid, cacheFile ] ( auto ) mutable -> MaybeAwaitable<expected<zypp::PublicKey>> {
357 auto providerRef = _dlContext->zyppContext()->provider();
358 return providerRef->provide( _media, file, ProvideFileSpec().setOptional(true).setMirrorsAllowed(false) )
359 | and_then( Provide::copyResultToDest( providerRef, _destdir / file ) )
360 | and_then( [this, providerRef, file, keyid , cacheFile = std::move(cacheFile)]( zypp::ManagedFile &&res ) {
361
362 // remember we downloaded the file
363 _dlContext->files().push_back ( std::move(res) );
364
365 auto key = zypp::PublicKey::noThrow( _dlContext->files().back() );
366 if ( not key.fileProvidesKey( keyid ) ) {
367 const std::string str = (zypp::str::Str() << "Keyhint " << file << " does not contain a key with id " << keyid << ". Skipping it.");
368 WAR << str << std::endl;
369 return makeReadyTask(expected<zypp::PublicKey>::error( std::make_exception_ptr( zypp::Exception(str)) ));
370 }
371
372 // Try to cache it...
374 return providerRef->copyFile( key.path(), cacheFile )
375 | [ key ]( expected<zypp::ManagedFile> res ) mutable {
376 if ( res ) {
377 // do not delete from cache
378 res->resetDispose ();
379 }
380 return expected<zypp::PublicKey>::success( std::move(key) );
381 };
382 });
383 })
384 | and_then( [ keyRing, keyid = keyid ]( zypp::PublicKey key ){
385 keyRing->importKey( key, false ); // store in general keyring (not trusted!)
386 return expected<zypp::PublicKeyData>::success(keyRing->publicKeyData( keyid )); // fetch back from keyring in case it was a hidden key
387 });
388 })
389 | [this] ( std::vector<expected<zypp::PublicKeyData>> &&keyHints ) mutable {
390 std::for_each( keyHints.begin(), keyHints.end(), [this]( expected<zypp::PublicKeyData> &keyData ){
391 if ( keyData && *keyData ) {
392 if ( not zypp::PublicKey::isSafeKeyId( keyData->id() ) ) {
393 WAR << "Keyhint " << keyData->id() << " for " << *keyData << " is not strong enough for auto import. Just caching it." << std::endl;
394 return;
395 }
396 _buddyKeys.push_back ( std::move(keyData.get()) );
397 }
398 });
399
400 MIL << "Check keyhints done. Buddy keys: " << _buddyKeys.size() << std::endl;
402 };
403 }
404
405 repo::DownloadContextRef _dlContext;
406 MediaHandle _media;
407 zypp::Pathname _masterIndex;
408
409 zypp::Pathname _destdir;
410 zypp::Pathname _sigpath;
411 zypp::Pathname _keypath;
412 zypp::ManagedFile _masterIndexFile;
413 zypp::TriBool _repoSigValidated = zypp::indeterminate;
414
415 std::vector<zypp::PublicKeyData> _buddyKeys;
416
417 zypp::SigcheckPlugins _sigcheckPlugins;
418 };
419
420 }
421
422 MaybeAwaitable<expected<repo::DownloadContextRef> > RepoDownloaderWorkflow::downloadMasterIndex(repo::DownloadContextRef dl, ProvideMediaHandle mediaHandle, zypp::Pathname masterIndex_r)
423 {
424 DownloadMasterIndexLogic impl( std::move(dl), std::move(mediaHandle), std::move(masterIndex_r) );
425 zypp_co_return zypp_co_await( impl.execute() );
426 }
427
428 MaybeAwaitable<expected<repo::DownloadContextRef>> RepoDownloaderWorkflow::downloadMasterIndex ( repo::DownloadContextRef dl, LazyMediaHandle<Provide> mediaHandle, zypp::filesystem::Pathname masterIndex_r )
429 {
430 using namespace zyppng::operators;
431 return dl->zyppContext()->provider()->attachMediaIfNeeded( mediaHandle )
432 | and_then([ dl, mi = std::move(masterIndex_r) ]( ProvideMediaHandle handle ) mutable {
433 return downloadMasterIndex( std::move(dl), std::move(handle), std::move(mi) );
434 });
435 }
436
437
438 namespace {
439 auto statusImpl ( repo::DownloadContextRef dlCtx, ProvideMediaHandle &&mediaHandle ) {
440 const auto finalizeStatus = [ dlCtx ]( zypp::RepoStatus status ){
441 return expected<zypp::RepoStatus>::success( zypp::RepoStatus( dlCtx->repoInfo()) && status );
442 };
443
444 switch( dlCtx->repoInfo().type().toEnum()) {
446 return RpmmdWorkflows::repoStatus( dlCtx, std::forward<ProvideMediaHandle>(mediaHandle) ) | and_then( std::move(finalizeStatus) );
448 return SuseTagsWorkflows::repoStatus( dlCtx, std::forward<ProvideMediaHandle>(mediaHandle) ) | and_then( std::move(finalizeStatus) );
450 return PlaindirWorkflows::repoStatus ( dlCtx, std::forward<ProvideMediaHandle>(mediaHandle) ) | and_then( std::move(finalizeStatus) );
452 break;
453 }
454
455 return makeReadyTask<expected<zypp::RepoStatus>>( expected<zypp::RepoStatus>::error( ZYPP_EXCPT_PTR (zypp::repo::RepoUnknownTypeException(dlCtx->repoInfo()))) );
456 }
457 }
458
459 MaybeAwaitable<expected<zypp::RepoStatus> > RepoDownloaderWorkflow::repoStatus(repo::DownloadContextRef dl, ProvideMediaHandle mediaHandle) {
460 return statusImpl( dl, std::move(mediaHandle) );
461 }
462
463 MaybeAwaitable<expected<zypp::RepoStatus> > RepoDownloaderWorkflow::repoStatus( repo::DownloadContextRef dl, LazyMediaHandle<Provide> mediaHandle ) {
464 using namespace zyppng::operators;
465 return dl->zyppContext()->provider()->attachMediaIfNeeded( mediaHandle )
466 | and_then([ dl ]( ProvideMediaHandle handle ) {
467 return repoStatus( dl, std::move(handle) );
468 });
469 }
470
471 namespace {
472 auto downloadImpl ( repo::DownloadContextRef dlCtx, ProvideMediaHandle &&mediaHandle, ProgressObserverRef &&progressObserver ) {
473 switch( dlCtx->repoInfo().type().toEnum()) {
475 return RpmmdWorkflows::download( std::move(dlCtx), std::forward<ProvideMediaHandle>(mediaHandle), std::move(progressObserver) );
477 return SuseTagsWorkflows::download( std::move(dlCtx), std::forward<ProvideMediaHandle>(mediaHandle), std::move(progressObserver) );
479 return PlaindirWorkflows::download ( std::move(dlCtx), std::forward<ProvideMediaHandle>(mediaHandle) );
481 break;
482 }
483
484 return makeReadyTask<expected<repo::DownloadContextRef> >( expected<repo::DownloadContextRef>::error( ZYPP_EXCPT_PTR (zypp::repo::RepoUnknownTypeException(dlCtx->repoInfo()))) );
485 }
486 }
487
488 MaybeAwaitable<expected<repo::DownloadContextRef> > RepoDownloaderWorkflow::download(repo::DownloadContextRef dl, ProvideMediaHandle mediaHandle, ProgressObserverRef progressObserver)
489 {
490 return downloadImpl( dl, std::move(mediaHandle), std::move(progressObserver) );
491 }
492
493 MaybeAwaitable<expected<repo::DownloadContextRef> > RepoDownloaderWorkflow::download(repo::DownloadContextRef dl, LazyMediaHandle<Provide> mediaHandle, ProgressObserverRef progressObserver)
494 {
495 using namespace zyppng::operators;
496 return dl->zyppContext()->provider()->attachMediaIfNeeded( mediaHandle )
497 | and_then([ dl, po = std::move(progressObserver) ]( ProvideMediaHandle handle ) mutable {
498 return downloadImpl( dl, std::move(handle), std::move(po) );
499 });
500 }
501}
#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:102
#define MIL
Definition Logger.h:103
#define WAR
Definition Logger.h:104
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:796
Pathname pubkeyCachePath() const
Path where the pubkey caches.
Definition ZConfig.cc:890
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:182
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