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"
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 
30 
31 // sync workflow helpers
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
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 (...) {
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  }
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 )
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;
334 
338  zypp::TriBool _repoSigValidated = zypp::indeterminate;
339 
340  std::vector<zypp::PublicKeyData> _buddyKeys;
341  };
342 
343  }
344 
346  {
347  return SimpleExecutor<DownloadMasterIndexLogic, AsyncOp<expected<repo::AsyncDownloadContextRef>>>::run( std::move(dl), std::move(mediaHandle), std::move(masterIndex_r) );
348  }
349 
351  {
352  return SimpleExecutor<DownloadMasterIndexLogic, SyncOp<expected<repo::SyncDownloadContextRef>>>::run( std::move(dl), std::move(mediaHandle), std::move(masterIndex_r) );
353  }
354 
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 
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()) {
386  return RpmmdWorkflows::repoStatus( dlCtx, std::forward<MediaHandleType>(mediaHandle) ) | and_then( std::move(finalizeStatus) );
388  return SuseTagsWorkflows::repoStatus( dlCtx, std::forward<MediaHandleType>(mediaHandle) ) | and_then( std::move(finalizeStatus) );
390  return PlaindirWorkflows::repoStatus ( dlCtx, std::forward<MediaHandleType>(mediaHandle) ) | and_then( std::move(finalizeStatus) );
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 
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 
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 
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()) {
432  return RpmmdWorkflows::download( std::move(dlCtx), std::forward<MediaHandleType>(mediaHandle), std::move(progressObserver) );
434  return SuseTagsWorkflows::download( std::move(dlCtx), std::forward<MediaHandleType>(mediaHandle), std::move(progressObserver) );
436  return PlaindirWorkflows::download ( std::move(dlCtx), std::forward<MediaHandleType>(mediaHandle) );
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 }
#define MIL
Definition: Logger.h:100
AsyncOpRef< expected< repo::AsyncDownloadContextRef > > download(repo::AsyncDownloadContextRef dl, ProvideMediaHandle mediaHandle, ProgressObserverRef progressObserver=nullptr)
auto mtry(Fun &&function)
Definition: mtry.h:58
boost::logic::tribool TriBool
3-state boolean logic (true, false and indeterminate).
Definition: String.h:31
thrown when it was impossible to determine this repo type.
auto transform(Transformation &&transformation)
Definition: transform.h:70
int assert_dir(const Pathname &path, unsigned mode)
Like &#39;mkdir -p&#39;.
Definition: PathInfo.cc:324
#define _(MSG)
Definition: Gettext.h:39
AsyncOpRef< expected< repo::AsyncDownloadContextRef > > download(repo::AsyncDownloadContextRef dl, ProvideMediaHandle mediaHandle, ProgressObserverRef progressObserver)
Definition: susetags.cc:330
Store and operate with byte count.
Definition: ByteCount.h:31
Pathname pubkeyCachePath() const
Path where the pubkey caches.
Definition: ZConfig.cc:1075
Pathname extend(const std::string &r) const
Append string r to the last component of the path.
Definition: Pathname.h:175
zypp::Pathname _masterIndex
zypp::Pathname _keypath
String related utilities and Regular expression matching.
zypp::TriBool _repoSigValidated
What is known about a repository.
Definition: RepoInfo.h:71
static expected< std::decay_t< Type >, Err > make_expected_success(Type &&t)
Definition: expected.h:397
I/O context for KeyRing::verifyFileSignatureWorkflow.
static const Unit MB
1000^2 Byte
Definition: ByteCount.h:61
std::string basename() const
Return the last component of this path.
Definition: Pathname.h:130
zypp::Pathname _sigpath
#define ZYPP_EXCPT_PTR(EXCPT)
Drops a logline and returns Exception as a std::exception_ptr.
Definition: Exception.h:463
expected< void > fetchGpgKeys(SyncContextRef ctx, zypp::RepoInfo info)
Definition: repoinfowf.cc:136
Pathname repoManagerRoot() const
The RepoManager root directory.
Definition: ZConfig.cc:980
AsyncOpRef< expected< repo::AsyncDownloadContextRef > > download(repo::AsyncDownloadContextRef dl, ProvideMediaHandle mediaHandle, ProgressObserverRef progressObserver)
Definition: plaindir.cc:88
MediaHandle _media
auto or_else(Fun &&function)
Definition: expected.h:630
const Pathname & signature() const
Detached signature or empty.
Convenient building of std::string via std::ostringstream Basically a std::ostringstream autoconverti...
Definition: String.h:212
bool isExist() const
Return whether valid stat info exists.
Definition: PathInfo.h:286
Pathname dirname() const
Return all but the last component od this path.
Definition: Pathname.h:126
Interim helper class to collect global options and settings.
Definition: ZConfig.h:68
#define WAR
Definition: Logger.h:101
#define ZYPP_ENABLE_LOGIC_BASE(Executor, OpType)
Definition: logichelpers.h:223
AsyncOpRef< expected< repo::AsyncDownloadContextRef > > downloadMasterIndex(repo::AsyncDownloadContextRef dl, ProvideMediaHandle mediaHandle, zypp::filesystem::Pathname masterIndex_r)
AsyncOpRef< expected< zypp::RepoStatus > > repoStatus(repo::AsyncDownloadContextRef dl, ProvideMediaHandle mediaHandle)
Definition: plaindir.cc:42
DlContextRefType _dlContext
typename conditional< B, T, F >::type conditional_t
Definition: TypeTraits.h:39
std::conditional_t< isAsync, AsyncOpRef< T >, T > makeReadyResult(T &&result)
Definition: asyncop.h:297
static expected success(ConsParams &&...params)
Definition: expected.h:115
std::shared_ptr< AsyncOp< T > > AsyncOpRef
Definition: asyncop.h:255
Reads through a repomd.xml file and collects type, location, checksum and other data about metadata f...
AsyncOpRef< expected< zypp::RepoStatus > > repoStatus(repo::AsyncDownloadContextRef dl, ProvideMediaHandle mediaHandle)
Base class for Exception.
Definition: Exception.h:152
expected< zypp::keyring::VerifyFileContext > verifySignature(SyncContextRef ctx, zypp::keyring::VerifyFileContext context)
AsyncOpRef< expected< zypp::RepoStatus > > repoStatus(repo::AsyncDownloadContextRef dl, ProvideMediaHandle mediaHandle)
Definition: rpmmd.cc:74
AsyncOpRef< expected< zypp::RepoStatus > > repoStatus(repo::AsyncDownloadContextRef dl, ProvideMediaHandle mediaHandle)
Definition: susetags.cc:84
auto and_then(Fun &&function)
Definition: expected.h:623
Wrapper class for ::stat/::lstat.
Definition: PathInfo.h:225
Interface of repomd.xml file reader.
AsyncOpRef< expected< repo::AsyncDownloadContextRef > > download(repo::AsyncDownloadContextRef dl, ProvideMediaHandle mediaHandle, ProgressObserverRef progressObserver)
Definition: rpmmd.cc:171
ResultType and_then(const expected< T, E > &exp, Function &&f)
Definition: expected.h:423
Track changing files or directories.
Definition: RepoStatus.h:40
#define ZYPP_FWD_CURRENT_EXCPT()
Drops a logline and returns the current Exception as a std::exception_ptr.
Definition: Exception.h:471
std::string readSignatureKeyId(const Pathname &signature)
reads the public key id from a signature
Definition: KeyRing.cc:195
#define DBG
Definition: Logger.h:99
zypp::Pathname _destdir
std::vector< zypp::PublicKeyData > _buddyKeys