libzypp  17.37.5
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 ) ) )
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 ) ) )
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  if ( _dlContext->repoInfo().mirrorListUrl().isValid() ) {
95  // when dealing with mirror lists we notify the user to use gpgKeyUrl instead of
96  // fetching the gpg key from any mirror
97  JobReportHelper( _dlContext->zyppContext() ).warning(_("Downloading signature key via mirrors, consider explicitely setting gpgKeyUrl via the repository configuration instead."));
98  }
99 
100  // we did not get the key via gpgUrl downloads, lets fallback
101  return provider()->provide( _media, _keypath, ProvideFileSpec().setOptional( true ).setDownloadSize( zypp::ByteCount( 20, zypp::ByteCount::MB ) ) )
102  | and_then( ProvideType::copyResultToDest ( provider(), _destdir / _keypath ) )
103  | and_then( [this]( zypp::ManagedFile keyFile ) {
104  _dlContext->files().push_back( std::move(keyFile));
105  return expected<void>::success();
106  });
107  }
108 
109  // we should not reach this line, but if we do we continue and fail later if its required
111  };
112  })
113  | [this,masterres=std::move(masterres)]( expected<void> ) {
114  return make_expected_success( std::move(masterres) );
115  };
116 
117  } )
118  // execute plugin verification if there is one
119  | and_then( std::bind( &DownloadMasterIndexLogic::pluginVerification, this, std::placeholders::_1 ) )
120 
121  // signature checking
122  | and_then( std::bind( &DownloadMasterIndexLogic::signatureCheck, this, std::placeholders::_1 ) )
123 
124  // copy everything into a directory
125  | and_then( ProvideType::copyResultToDest ( providerRef, _destdir / _masterIndex ) )
126 
127  // final tasks
128  | and_then([this]( zypp::ManagedFile &&masterIndex ) {
129  // Accepted!
130  _dlContext->repoInfo().setMetadataPath( _destdir );
131  _dlContext->repoInfo().setValidRepoSignature( _repoSigValidated );
132 
133  // release the media handle
134  _media = MediaHandle();
135  auto &allFiles = _dlContext->files();
136 
137  // make sure the masterIndex is in front
138  allFiles.insert( allFiles.begin (), std::move(masterIndex) );
139  return make_expected_success( std::move(_dlContext) );
140  });
141  }
142 
143 
144  private:
145  auto provider () {
146  return _dlContext->zyppContext()->provider();
147  }
148 
149  MaybeAsyncRef<expected<ProvideRes>> signatureCheck ( ProvideRes &&res ) {
150 
151  if ( _dlContext->repoInfo().repoGpgCheck() ) {
152 
153  // The local files are in destdir_r, if they were present on the server
154  zypp::Pathname sigpathLocal { _destdir/_sigpath };
155  zypp::Pathname keypathLocal { _destdir/_keypath };
156  bool isSigned = zypp::PathInfo(sigpathLocal).isExist();
157 
158  if ( isSigned || _dlContext->repoInfo().repoGpgCheckIsMandatory() ) {
159 
160  auto verifyCtx = zypp::keyring::VerifyFileContext( res.file() );
161 
162  // only add the signature if it exists
163  if ( isSigned )
164  verifyCtx.signature( sigpathLocal );
165 
166  // only add the key if it exists
167  if ( zypp::PathInfo(keypathLocal).isExist() ) {
168  try {
169  _dlContext->zyppContext()->keyRing()->importKey( zypp::PublicKey(keypathLocal), false );
170  } catch (...) {
172  }
173  }
174 
175  // set the checker context even if the key is not known
176  // (unsigned repo, key file missing; bnc #495977)
177  verifyCtx.keyContext( _dlContext->repoInfo() );
178 
179  return getExtraKeysInRepomd( std::move(res ) )
180  | and_then([this, vCtx = std::move(verifyCtx) ]( ProvideRes &&res ) mutable {
181  for ( const auto &keyData : _buddyKeys ) {
182  DBG << "Keyhint remember buddy " << keyData << std::endl;
183  vCtx.addBuddyKey( keyData.id() );
184  }
185 
186  return SignatureFileCheckWorkflow::verifySignature( _dlContext->zyppContext(), std::move(vCtx))
187  | and_then([ this, res = std::move(res) ]( zypp::keyring::VerifyFileContext verRes ){
188  // remember the validation status
189  _repoSigValidated = verRes.fileValidated();
190  return make_expected_success(std::move(res));
191  });
192  });
193 
194  } else {
195  WAR << "Accept unsigned repository because repoGpgCheck is not mandatory for " << _dlContext->repoInfo().alias() << std::endl;
196  }
197  } else {
198  WAR << "Signature checking disabled in config of repository " << _dlContext->repoInfo().alias() << std::endl;
199  }
201  }
202 
203  // execute the repo verification if there is one
204  expected<ProvideRes> pluginVerification ( ProvideRes &&prevRes ) {
205  // The local files are in destdir_r, if they were present on the server
206  zypp::Pathname sigpathLocal { _destdir/_sigpath };
207  zypp::Pathname keypathLocal { _destdir/_keypath };
208 
209  if ( _dlContext->pluginRepoverification() && _dlContext->pluginRepoverification()->isNeeded() ) {
210  try {
211 
212  if ( zypp::PathInfo(sigpathLocal).isExist() && !zypp::PathInfo(keypathLocal).isExist() ) {
213  auto kr = _dlContext->zyppContext()->keyRing();
214  // if we have a signature but no keyfile, we need to export it from the keyring
215  auto expKeyId = mtry( &KeyRing::readSignatureKeyId, kr.get(), sigpathLocal );
216  if ( !expKeyId ) {
217  MIL << "Failed to read signature from file: " << sigpathLocal << std::endl;
218  } else {
219  std::ofstream os( keypathLocal.c_str() );
220  if ( kr->isKeyKnown(*expKeyId) ) {
221  kr->dumpPublicKey(
222  *expKeyId,
223  kr->isKeyTrusted(*expKeyId),
224  os
225  );
226  }
227  }
228  }
229 
230  _dlContext->pluginRepoverification()->getChecker( sigpathLocal, keypathLocal, _dlContext->repoInfo() )( prevRes.file() );
231  } catch ( ... ) {
232  return expected<ProvideRes>::error( std::current_exception () );
233  }
234  }
235  return make_expected_success(std::move(prevRes));
236  }
237 
242  MaybeAsyncRef<expected<ProvideRes>> getExtraKeysInRepomd ( ProvideRes &&res ) {
243 
244  if ( _masterIndex.basename() != "repomd.xml" ) {
245  return makeReadyResult( expected<ProvideRes>::success( std::move(res) ) );
246  }
247 
248  std::vector<std::pair<std::string,std::string>> keyhints { zypp::parser::yum::RepomdFileReader(res.file()).keyhints() };
249  if ( keyhints.empty() )
250  return makeReadyResult( expected<ProvideRes>::success( std::move(res) ) );
251  DBG << "Check keyhints: " << keyhints.size() << std::endl;
252 
253  auto keyRing { _dlContext->zyppContext()->keyRing() };
254  return zypp::parser::yum::RepomdFileReader(res.file()).keyhints()
255  | transform([this, keyRing]( std::pair<std::string, std::string> val ) {
256 
257  const auto& [ file, keyid ] = val;
258  auto keyData = keyRing->trustedPublicKeyData( keyid );
259  if ( keyData ) {
260  DBG << "Keyhint is already trusted: " << keyid << " (" << file << ")" << std::endl;
261  return makeReadyResult ( expected<zypp::PublicKeyData>::success(keyData) ); // already a trusted key
262  }
263 
264  DBG << "Keyhint search key " << keyid << " (" << file << ")" << std::endl;
265 
266  keyData = keyRing->publicKeyData( keyid );
267  if ( keyData )
269 
270  // TODO: Enhance the key caching in general...
271  const zypp::ZConfig & conf = _dlContext->zyppContext()->config();
272  zypp::Pathname cacheFile = conf.repoManagerRoot() / conf.pubkeyCachePath() / file;
273 
274  return zypp::PublicKey::noThrow(cacheFile)
275  | [ keyid = keyid ]( auto &&key ){
276  if ( key.fileProvidesKey( keyid ) )
277  return make_expected_success( std::forward<decltype(key)>(key) );
278  else
279  return expected<zypp::PublicKey>::error( std::make_exception_ptr (zypp::Exception("File does not provide key")));
280  }
281  | or_else ([ this, file = file, keyid = keyid, cacheFile ] ( auto ) mutable -> MaybeAsyncRef<expected<zypp::PublicKey>> {
282  auto providerRef = _dlContext->zyppContext()->provider();
283  return providerRef->provide( _media, file, ProvideFileSpec().setOptional(true) )
284  | and_then( ProvideType::copyResultToDest( providerRef, _destdir / file ) )
285  | and_then( [this, providerRef, file, keyid , cacheFile = std::move(cacheFile)]( zypp::ManagedFile &&res ) {
286 
287  // remember we downloaded the file
288  _dlContext->files().push_back ( std::move(res) );
289 
290  auto key = zypp::PublicKey::noThrow( _dlContext->files().back() );
291  if ( not key.fileProvidesKey( keyid ) ) {
292  const std::string str = (zypp::str::Str() << "Keyhint " << file << " does not contain a key with id " << keyid << ". Skipping it.");
293  WAR << str << std::endl;
294  return makeReadyResult(expected<zypp::PublicKey>::error( std::make_exception_ptr( zypp::Exception(str)) ));
295  }
296 
297  // Try to cache it...
298  zypp::filesystem::assert_dir( cacheFile.dirname() );
299  return providerRef->copyFile( key.path(), cacheFile )
300  | [ key ]( expected<zypp::ManagedFile> res ) mutable {
301  if ( res ) {
302  // do not delete from cache
303  res->resetDispose ();
304  }
305  return expected<zypp::PublicKey>::success( std::move(key) );
306  };
307  });
308  })
309  | and_then( [ keyRing, keyid = keyid ]( zypp::PublicKey key ){
310  keyRing->importKey( key, false ); // store in general keyring (not trusted!)
311  return expected<zypp::PublicKeyData>::success(keyRing->publicKeyData( keyid )); // fetch back from keyring in case it was a hidden key
312  });
313  })
314  | [this, res = res] ( std::vector<expected<zypp::PublicKeyData>> &&keyHints ) mutable {
315  std::for_each( keyHints.begin(), keyHints.end(), [this]( expected<zypp::PublicKeyData> &keyData ){
316  if ( keyData && *keyData ) {
317  if ( not zypp::PublicKey::isSafeKeyId( keyData->id() ) ) {
318  WAR << "Keyhint " << keyData->id() << " for " << *keyData << " is not strong enough for auto import. Just caching it." << std::endl;
319  return;
320  }
321  _buddyKeys.push_back ( std::move(keyData.get()) );
322  }
323  });
324 
325  MIL << "Check keyhints done. Buddy keys: " << _buddyKeys.size() << std::endl;
326  return expected<ProvideRes>::success (std::move(res));
327  };
328  }
329 
330  DlContextRefType _dlContext;
331  MediaHandle _media;
333 
337  zypp::TriBool _repoSigValidated = zypp::indeterminate;
338 
339  std::vector<zypp::PublicKeyData> _buddyKeys;
340  };
341 
342  }
343 
345  {
346  return SimpleExecutor<DownloadMasterIndexLogic, AsyncOp<expected<repo::AsyncDownloadContextRef>>>::run( std::move(dl), std::move(mediaHandle), std::move(masterIndex_r) );
347  }
348 
350  {
351  return SimpleExecutor<DownloadMasterIndexLogic, SyncOp<expected<repo::SyncDownloadContextRef>>>::run( std::move(dl), std::move(mediaHandle), std::move(masterIndex_r) );
352  }
353 
355  {
356  using namespace zyppng::operators;
357  return dl->zyppContext()->provider()->attachMediaIfNeeded( mediaHandle )
358  | and_then([ dl, mi = std::move(masterIndex_r) ]( ProvideMediaHandle handle ) mutable {
359  return downloadMasterIndex( std::move(dl), std::move(handle), std::move(mi) );
360  });
361  }
362 
364  {
365  using namespace zyppng::operators;
366  return dl->zyppContext()->provider()->attachMediaIfNeeded( mediaHandle )
367  | and_then([ dl, mi = std::move(masterIndex_r) ]( SyncMediaHandle handle ) mutable {
368  return downloadMasterIndex( std::move(dl), std::move(handle), std::move(mi) );
369  });
370  }
371 
372 
373  namespace {
374  template <class DlContextRefType, class MediaHandleType>
375  auto statusImpl ( DlContextRefType dlCtx, MediaHandleType &&mediaHandle ) {
376 
377  constexpr bool isAsync = std::is_same_v<DlContextRefType,repo::AsyncDownloadContextRef>;
378 
379  const auto finalizeStatus = [ dlCtx ]( zypp::RepoStatus status ){
380  return expected<zypp::RepoStatus>::success( zypp::RepoStatus( dlCtx->repoInfo()) && status );
381  };
382 
383  switch( dlCtx->repoInfo().type().toEnum()) {
385  return RpmmdWorkflows::repoStatus( dlCtx, std::forward<MediaHandleType>(mediaHandle) ) | and_then( std::move(finalizeStatus) );
387  return SuseTagsWorkflows::repoStatus( dlCtx, std::forward<MediaHandleType>(mediaHandle) ) | and_then( std::move(finalizeStatus) );
389  return PlaindirWorkflows::repoStatus ( dlCtx, std::forward<MediaHandleType>(mediaHandle) ) | and_then( std::move(finalizeStatus) );
391  break;
392  }
393 
394  return makeReadyResult<expected<zypp::RepoStatus>, isAsync >( expected<zypp::RepoStatus>::error( ZYPP_EXCPT_PTR (zypp::repo::RepoUnknownTypeException(dlCtx->repoInfo()))) );
395  }
396  }
397 
399  return statusImpl( dl, std::move(mediaHandle) );
400  }
401 
402  expected<zypp::RepoStatus> RepoDownloaderWorkflow::repoStatus(repo::SyncDownloadContextRef dl, SyncMediaHandle mediaHandle) {
403  return statusImpl( dl, std::move(mediaHandle) );
404  }
405 
407  using namespace zyppng::operators;
408  return dl->zyppContext()->provider()->attachMediaIfNeeded( mediaHandle )
409  | and_then([ dl ]( ProvideMediaHandle handle ) {
410  return repoStatus( dl, std::move(handle) );
411  });
412  }
413 
415  using namespace zyppng::operators;
416  return dl->zyppContext()->provider()->attachMediaIfNeeded( mediaHandle )
417  | and_then([ dl ]( SyncMediaHandle handle ) {
418  return repoStatus( dl, std::move(handle) );
419  });
420  }
421 
422 
423  namespace {
424  template <class DlContextRefType, class MediaHandleType>
425  auto downloadImpl ( DlContextRefType dlCtx, MediaHandleType &&mediaHandle, ProgressObserverRef &&progressObserver ) {
426 
427  constexpr bool isAsync = std::is_same_v<DlContextRefType,repo::AsyncDownloadContextRef>;
428 
429  switch( dlCtx->repoInfo().type().toEnum()) {
431  return RpmmdWorkflows::download( std::move(dlCtx), std::forward<MediaHandleType>(mediaHandle), std::move(progressObserver) );
433  return SuseTagsWorkflows::download( std::move(dlCtx), std::forward<MediaHandleType>(mediaHandle), std::move(progressObserver) );
435  return PlaindirWorkflows::download ( std::move(dlCtx), std::forward<MediaHandleType>(mediaHandle) );
437  break;
438  }
439 
440  return makeReadyResult<expected<DlContextRefType>, isAsync >( expected<DlContextRefType>::error( ZYPP_EXCPT_PTR (zypp::repo::RepoUnknownTypeException(dlCtx->repoInfo()))) );
441  }
442  }
443 
444  AsyncOpRef<expected<repo::AsyncDownloadContextRef> > RepoDownloaderWorkflow::download(repo::AsyncDownloadContextRef dl, ProvideMediaHandle mediaHandle, ProgressObserverRef progressObserver)
445  {
446  return downloadImpl( dl, std::move(mediaHandle), std::move(progressObserver) );
447  }
448 
449  expected<repo::SyncDownloadContextRef> RepoDownloaderWorkflow::download(repo::SyncDownloadContextRef dl, SyncMediaHandle mediaHandle, ProgressObserverRef progressObserver)
450  {
451  return downloadImpl( dl, std::move(mediaHandle), std::move(progressObserver) );
452  }
453 
454  AsyncOpRef<expected<repo::AsyncDownloadContextRef> > RepoDownloaderWorkflow::download(repo::AsyncDownloadContextRef dl, AsyncLazyMediaHandle mediaHandle, ProgressObserverRef progressObserver)
455  {
456  using namespace zyppng::operators;
457  return dl->zyppContext()->provider()->attachMediaIfNeeded( mediaHandle )
458  | and_then([ dl, po = std::move(progressObserver) ]( ProvideMediaHandle handle ) mutable {
459  return downloadImpl( dl, std::move(handle), std::move(po) );
460  });
461  }
462 
463  expected<repo::SyncDownloadContextRef> RepoDownloaderWorkflow::download(repo::SyncDownloadContextRef dl, SyncLazyMediaHandle mediaHandle, ProgressObserverRef progressObserver)
464  {
465  using namespace zyppng::operators;
466  return dl->zyppContext()->provider()->attachMediaIfNeeded( mediaHandle )
467  | and_then([ dl, po = std::move(progressObserver) ]( SyncMediaHandle handle ) mutable {
468  return downloadImpl( dl, std::move(handle), std::move(po) );
469  });
470  }
471 }
#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