libzypp  16.13.0
PackageProvider.cc
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #include <iostream>
13 #include <fstream>
14 #include <sstream>
15 #include "zypp/repo/PackageDelta.h"
16 #include "zypp/base/Logger.h"
17 #include "zypp/base/Gettext.h"
19 #include "zypp/base/NonCopyable.h"
22 #include "zypp/repo/PackageDelta.h"
23 
24 #include "zypp/TmpPath.h"
25 #include "zypp/ZConfig.h"
26 #include "zypp/RepoInfo.h"
27 #include "zypp/RepoManager.h"
28 #include "zypp/SrcPackage.h"
29 
30 #include "zypp/ZYppFactory.h"
31 #include "zypp/Target.h"
32 #include "zypp/target/rpm/RpmDb.h"
33 #include "zypp/FileChecker.h"
34 
35 using std::endl;
36 
38 namespace zypp
39 {
40  namespace env
41  {
43  {
44  static const char * envp = getenv( "YAST_IS_RUNNING" );
45  return envp && *envp;
46  }
47  }
48 
50  namespace repo
51  {
53  // class PackageProviderPolicy
55 
56  bool PackageProviderPolicy::queryInstalled( const std::string & name_r,
57  const Edition & ed_r,
58  const Arch & arch_r ) const
59  {
60  if ( _queryInstalledCB )
61  return _queryInstalledCB( name_r, ed_r, arch_r );
62  return false;
63  }
64 
70  {
71  Impl() {}
72  virtual ~Impl() {}
73 
78  virtual ManagedFile providePackage() const = 0;
79 
81  virtual ManagedFile providePackageFromCache() const = 0;
82 
84  virtual bool isCached() const = 0;
85  };
86 
91  template <class TPackage>
93  {
94  typedef typename TPackage::constPtr TPackagePtr; // Package or SrcPackage
96  public:
98  PackageProviderImpl( RepoMediaAccess & access_r, const TPackagePtr & package_r,
99  const PackageProviderPolicy & policy_r )
100  : _policy( policy_r )
101  , _package( package_r )
102  , _access( access_r )
103  , _retry(false)
104  {}
105 
106  virtual ~PackageProviderImpl() {}
107 
108  public:
113  virtual ManagedFile providePackage() const;
114 
117  {
118  ManagedFile ret( doProvidePackageFromCache() );
119  if ( ! ( ret->empty() || _package->repoInfo().keepPackages() ) )
121  return ret;
122  }
123 
125  virtual bool isCached() const
126  { return ! doProvidePackageFromCache()->empty(); }
127 
128  protected:
131 
140  { return ManagedFile( _package->cachedLocation() ); }
141 
157  {
158  ManagedFile ret;
159  OnMediaLocation loc = _package->location();
160 
161  ProvideFilePolicy policy;
162  policy.progressCB( bind( &Base::progressPackageDownload, this, _1 ) );
163  return _access.provideFile( _package->repoInfo(), loc, policy );
164  }
165 
166  protected:
168  Report & report() const
169  { return *_report; }
170 
172  bool progressPackageDownload( int value ) const
173  { return report()->progress( value, _package ); }
174 
176 
177  RpmDb::CheckPackageResult packageSigCheck( const Pathname & path_r, UserData & userData ) const
178  {
179  if ( !_target )
180  _target = getZYpp()->getTarget();
181 
182  RpmDb::CheckPackageResult ret = RpmDb::CHK_ERROR;
184  if ( _target )
185  ret = _target->rpmDb().checkPackage( path_r, detail );
186  else
187  detail.push_back( RpmDb::CheckPackageDetail::value_type( ret, "OOps. Target is not initialized!" ) );
188 
189  userData.set( "CheckPackageResult", ret );
190  userData.set( "CheckPackageDetail", std::move(detail) );
191  return ret;
192  }
193 
198  {
199  switch ( action_r )
200  {
202  _retry = true;
203  break;
205  WAR << _package->asUserString() << ": " << "User requested to accept insecure file" << endl;
206  break;
207  default:
209  ZYPP_THROW(AbortRequestException("User requested to abort"));
210  break;
211  }
212  }
213 
215  void defaultReportSignatureError( RpmDb::CheckPackageResult ret, const std::string & detail_r = std::string() ) const
216  {
217  str::Str msg;
218  msg << _package->asUserString() << ": " << _("Signature verification failed") << " " << ret;
219  if ( ! detail_r.empty() )
220  msg << "\n" << detail_r;
221  resolveSignatureErrorAction( report()->problem( _package, repo::DownloadResolvableReport::INVALID, msg.str() ) );
222  }
223 
224  protected:
226  TPackagePtr _package;
228 
229  private:
230  typedef shared_ptr<void> ScopedGuard;
231 
232  ScopedGuard newReport() const
233  {
234  _report.reset( new Report );
235  // Use a custom deleter calling _report.reset() when guard goes out of
236  // scope (cast required as reset is overloaded). We want report to end
237  // when leaving providePackage and not wait for *this going out of scope.
238  return shared_ptr<void>( static_cast<void*>(0),
239  bind( mem_fun_ref( static_cast<void (shared_ptr<Report>::*)()>(&shared_ptr<Report>::reset) ),
240  ref(_report) ) );
241  }
242 
243  mutable bool _retry;
244  mutable shared_ptr<Report> _report;
246  };
248 
249  template <class TPackage>
251  {
252  ScopedGuard guardReport( newReport() );
253 
254  // check for cache hit:
255  ManagedFile ret( providePackageFromCache() );
256  if ( ! ret->empty() )
257  {
258  MIL << "provided Package from cache " << _package << " at " << ret << endl;
259  report()->infoInCache( _package, ret );
260  return ret; // <-- cache hit
261  }
262 
263  // HERE: cache misss, check toplevel cache or do download:
264  RepoInfo info = _package->repoInfo();
265 
266  // Check toplevel cache
267  {
268  RepoManagerOptions topCache;
269  if ( info.packagesPath().dirname() != topCache.repoPackagesCachePath ) // not using toplevel cache
270  {
271  const OnMediaLocation & loc( _package->location() );
272  if ( ! loc.checksum().empty() ) // no cache hit without checksum
273  {
274  PathInfo pi( topCache.repoPackagesCachePath / info.packagesPath().basename() / loc.filename() );
275  if ( pi.isExist() && loc.checksum() == CheckSum( loc.checksum().type(), std::ifstream( pi.c_str() ) ) )
276  {
277  report()->start( _package, pi.path().asFileUrl() );
278  const Pathname & dest( info.packagesPath() / loc.filename() );
279  if ( filesystem::assert_dir( dest.dirname() ) == 0 && filesystem::hardlinkCopy( pi.path(), dest ) == 0 )
280  {
281  ret = ManagedFile( dest );
282  if ( ! info.keepPackages() )
284 
285  MIL << "provided Package from toplevel cache " << _package << " at " << ret << endl;
286  report()->finish( _package, repo::DownloadResolvableReport::NO_ERROR, std::string() );
287  return ret; // <-- toplevel cache hit
288  }
289  }
290  }
291  }
292  }
293 
294  // FIXME we only support the first url for now.
295  if ( info.baseUrlsEmpty() )
296  ZYPP_THROW(Exception("No url in repository."));
297 
298  MIL << "provide Package " << _package << endl;
299  Url url = * info.baseUrlsBegin();
300  do {
301  _retry = false;
302  if ( ! ret->empty() )
303  {
305  ret.reset();
306  }
307  report()->start( _package, url );
308  try
309  {
310  ret = doProvidePackage();
311 
312  if ( info.pkgGpgCheck()
313 #warning bsc1037210 disabled SrcPackage signature check if YAST_IS_RUNNING - waiting for yast to be fixed
314  && !( env::YAST_IS_RUNNING() && isKind<SrcPackage>( _package ) ) )
315  {
316  UserData userData( "pkgGpgCheck" );
317  ResObject::constPtr roptr( _package ); // gcc6 needs it more explcit. Has problem deducing
318  userData.set( "ResObject", roptr ); // a type for '_package->asKind<ResObject>()'...
319  /*legacy:*/userData.set( "Package", roptr->asKind<Package>() );
320  userData.set( "Localpath", ret.value() );
321  RpmDb::CheckPackageResult res = packageSigCheck( ret, userData );
322  // publish the checkresult, even if it is OK. Apps may want to report something...
323  report()->pkgGpgCheck( userData );
324  DBG << "CHK: " << res << endl;
325 
326  if ( res != RpmDb::CHK_OK )
327  {
328  if ( userData.hasvalue( "Action" ) ) // pkgGpgCheck report provided an user error action
329  {
330  resolveSignatureErrorAction( userData.get( "Action", repo::DownloadResolvableReport::ABORT ) );
331  }
332  else if ( userData.haskey( "Action" ) ) // pkgGpgCheck requests the default problem report (wo. details)
333  {
334  defaultReportSignatureError( res );
335  }
336  else // no advice from user => usedefaults
337  {
338  switch ( res )
339  {
340  case RpmDb::CHK_OK: // Signature is OK
341  break;
342 
343  case RpmDb::CHK_NOKEY: // Public key is unavailable
344  case RpmDb::CHK_NOTFOUND: // Signature is unknown type
345  case RpmDb::CHK_FAIL: // Signature does not verify
346  case RpmDb::CHK_NOTTRUSTED: // Signature is OK, but key is not trusted
347  case RpmDb::CHK_ERROR: // File does not exist or can't be opened
348  default:
349  // report problem (w. details), throw if to abort, else retry/ignore
350  defaultReportSignatureError( res, str::Str() << userData.get<RpmDb::CheckPackageDetail>( "CheckPackageDetail" ) );
351  break;
352  }
353  }
354  }
355  }
356  }
357  catch ( const UserRequestException & excpt )
358  {
359  ERR << "Failed to provide Package " << _package << endl;
360  if ( ! _retry )
361  ZYPP_RETHROW( excpt );
362  }
363  catch ( const FileCheckException & excpt )
364  {
365  ERR << "Failed to provide Package " << _package << endl;
366  if ( ! _retry )
367  {
368  const std::string & package_str = _package->asUserString();
369  // TranslatorExplanation %s = package being checked for integrity
370  switch ( report()->problem( _package, repo::DownloadResolvableReport::INVALID, str::form(_("Package %s seems to be corrupted during transfer. Do you want to retry retrieval?"), package_str.c_str() ) ) )
371  {
373  _retry = true;
374  break;
376  ZYPP_THROW(SkipRequestException("User requested skip of corrupted file"));
377  break;
379  ZYPP_THROW(AbortRequestException("User requested to abort"));
380  break;
381  default:
382  break;
383  }
384  }
385  }
386  catch ( const Exception & excpt )
387  {
388  ERR << "Failed to provide Package " << _package << endl;
389  if ( ! _retry )
390  {
391  // Aything else gets reported
392  const std::string & package_str = _package->asUserString();
393 
394  // TranslatorExplanation %s = name of the package being processed.
395  std::string detail_str( str::form(_("Failed to provide Package %s. Do you want to retry retrieval?"), package_str.c_str() ) );
396  detail_str += str::form( "\n\n%s", excpt.asUserHistory().c_str() );
397 
398  switch ( report()->problem( _package, repo::DownloadResolvableReport::IO, detail_str.c_str() ) )
399  {
401  _retry = true;
402  break;
404  ZYPP_THROW(SkipRequestException("User requested skip of file", excpt));
405  break;
407  ZYPP_THROW(AbortRequestException("User requested to abort", excpt));
408  break;
409  default:
410  ZYPP_RETHROW( excpt );
411  break;
412  }
413  }
414  }
415  } while ( _retry );
416 
417  report()->finish( _package, repo::DownloadResolvableReport::NO_ERROR, std::string() );
418  MIL << "provided Package " << _package << " at " << ret << endl;
419  return ret;
420  }
421 
422 
427  class RpmPackageProvider : public PackageProviderImpl<Package>
428  {
429  public:
431  const Package::constPtr & package_r,
432  const DeltaCandidates & deltas_r,
433  const PackageProviderPolicy & policy_r )
434  : PackageProviderImpl<Package>( access_r, package_r, policy_r )
435  , _deltas( deltas_r )
436  {}
437 
438  protected:
439  virtual ManagedFile doProvidePackage() const;
440 
441  private:
443 
444  ManagedFile tryDelta( const DeltaRpm & delta_r ) const;
445 
446  bool progressDeltaDownload( int value ) const
447  { return report()->progressDeltaDownload( value ); }
448 
449  void progressDeltaApply( int value ) const
450  { return report()->progressDeltaApply( value ); }
451 
452  bool queryInstalled( const Edition & ed_r = Edition() ) const
453  { return _policy.queryInstalled( _package->name(), ed_r, _package->arch() ); }
454 
455  private:
457  };
459 
460  ManagedFile RpmPackageProvider::doProvidePackage() const
461  {
462  Url url;
463  RepoInfo info = _package->repoInfo();
464  // FIXME we only support the first url for now.
465  if ( info.baseUrlsEmpty() )
466  ZYPP_THROW(Exception("No url in repository."));
467  else
468  url = * info.baseUrlsBegin();
469 
470  // check whether to process patch/delta rpms
471  if ( ZConfig::instance().download_use_deltarpm()
473  {
474  std::list<DeltaRpm> deltaRpms;
475  _deltas.deltaRpms( _package ).swap( deltaRpms );
476 
477  if ( ! deltaRpms.empty() && queryInstalled() && applydeltarpm::haveApplydeltarpm() )
478  {
479  for_( it, deltaRpms.begin(), deltaRpms.end())
480  {
481  DBG << "tryDelta " << *it << endl;
482  ManagedFile ret( tryDelta( *it ) );
483  if ( ! ret->empty() )
484  return ret;
485  }
486  }
487  }
488 
489  // no patch/delta -> provide full package
490  return Base::doProvidePackage();
491  }
492 
493  ManagedFile RpmPackageProvider::tryDelta( const DeltaRpm & delta_r ) const
494  {
495  if ( delta_r.baseversion().edition() != Edition::noedition
496  && ! queryInstalled( delta_r.baseversion().edition() ) )
497  return ManagedFile();
498 
499  if ( ! applydeltarpm::quickcheck( delta_r.baseversion().sequenceinfo() ) )
500  return ManagedFile();
501 
502  report()->startDeltaDownload( delta_r.location().filename(),
503  delta_r.location().downloadSize() );
504  ManagedFile delta;
505  try
506  {
507  ProvideFilePolicy policy;
508  policy.progressCB( bind( &RpmPackageProvider::progressDeltaDownload, this, _1 ) );
509  delta = _access.provideFile( delta_r.repository().info(), delta_r.location(), policy );
510  }
511  catch ( const Exception & excpt )
512  {
513  report()->problemDeltaDownload( excpt.asUserHistory() );
514  return ManagedFile();
515  }
516  report()->finishDeltaDownload();
517 
518  report()->startDeltaApply( delta );
519  if ( ! applydeltarpm::check( delta_r.baseversion().sequenceinfo() ) )
520  {
521  report()->problemDeltaApply( _("applydeltarpm check failed.") );
522  return ManagedFile();
523  }
524 
525  // build the package and put it into the cache
526  Pathname destination( _package->repoInfo().packagesPath() / _package->location().filename() );
527 
528  if ( ! applydeltarpm::provide( delta, destination,
529  bind( &RpmPackageProvider::progressDeltaApply, this, _1 ) ) )
530  {
531  report()->problemDeltaApply( _("applydeltarpm failed.") );
532  return ManagedFile();
533  }
534  report()->finishDeltaApply();
535 
536  return ManagedFile( destination, filesystem::unlink );
537  }
538 
540  // class PackageProvider
542  namespace factory
543  {
544  inline PackageProvider::Impl * make( RepoMediaAccess & access_r, const PoolItem & pi_r,
545  const DeltaCandidates & deltas_r,
546  const PackageProviderPolicy & policy_r )
547  {
548  if ( pi_r.isKind<Package>() )
549  return new RpmPackageProvider( access_r, pi_r->asKind<Package>(), deltas_r, policy_r );
550  else if ( pi_r.isKind<SrcPackage>() )
551  return new PackageProviderImpl<SrcPackage>( access_r, pi_r->asKind<SrcPackage>(), policy_r );
552  else
553  ZYPP_THROW( Exception( str::Str() << "Don't know how to cache non-package " << pi_r.asUserString() ) );
554  }
555 
556  inline PackageProvider::Impl * make( RepoMediaAccess & access_r, const PoolItem & pi_r,
557  const PackageProviderPolicy & policy_r )
558  {
559  if ( pi_r.isKind<Package>() )
560  return new PackageProviderImpl<Package>( access_r, pi_r->asKind<Package>(), policy_r );
561  else if ( pi_r.isKind<SrcPackage>() )
562  return new PackageProviderImpl<SrcPackage>( access_r, pi_r->asKind<SrcPackage>(), policy_r );
563  else
564  ZYPP_THROW( Exception( str::Str() << "Don't know how to cache non-package " << pi_r.asUserString() ) );
565  }
566 
567  inline PackageProvider::Impl * make( RepoMediaAccess & access_r, const Package::constPtr & package_r,
568  const DeltaCandidates & deltas_r,
569  const PackageProviderPolicy & policy_r )
570  { return new RpmPackageProvider( access_r, package_r, deltas_r, policy_r ); }
571 
572  } // namespace factory
574 
575  PackageProvider::PackageProvider( RepoMediaAccess & access_r, const PoolItem & pi_r,
576  const DeltaCandidates & deltas_r, const PackageProviderPolicy & policy_r )
577 
578  : _pimpl( factory::make( access_r, pi_r, deltas_r, policy_r ) )
579  {}
580 
582  const PackageProviderPolicy & policy_r )
583  : _pimpl( factory::make( access_r, pi_r, policy_r ) )
584  {}
585 
586  /* legacy */
588  const Package::constPtr & package_r,
589  const DeltaCandidates & deltas_r,
590  const PackageProviderPolicy & policy_r )
591  : _pimpl( factory::make( access_r, package_r, deltas_r, policy_r ) )
592  {}
593 
595  {}
596 
598  { return _pimpl->providePackage(); }
599 
601  { return _pimpl->providePackageFromCache(); }
602 
604  { return _pimpl->isCached(); }
605 
606  } // namespace repo
608 } // namespace zypp
PackageProvider implementation interface.
virtual bool isCached() const
Whether the package is cached.
Candidate delta and patches for a package.
virtual ManagedFile providePackageFromCache() const
Provide the package if it is cached.
int assert_dir(const Pathname &path, unsigned mode)
Like &#39;mkdir -p&#39;.
Definition: PathInfo.cc:320
RepoInfo info() const
Return any associated RepoInfo.
Definition: Repository.cc:273
Interface to gettext.
Interface to the rpm program.
Definition: RpmDb.h:47
#define MIL
Definition: Logger.h:64
const Repository & repository() const
Definition: PackageDelta.h:70
#define ZYPP_THROW(EXCPT)
Drops a logline and throws the Exception.
Definition: Exception.h:321
Describes a path on a certain media amongs as the information required to download it...
bool hasvalue(const std::string &key_r) const
Whether key_r is in data and value is not empty.
Definition: UserData.h:101
static ZConfig & instance()
Singleton ctor.
Definition: Resolver.cc:125
const BaseVersion & baseversion() const
Definition: PackageDelta.h:69
bool isCached() const
Whether the package is cached.
callback::SendReport< repo::DownloadResolvableReport > Report
Architecture.
Definition: Arch.h:36
void reset()
Reset to default Ctor values.
Definition: AutoDispose.h:145
urls_const_iterator baseUrlsBegin() const
iterator that points at begin of repository urls
Definition: RepoInfo.cc:489
Policies and options for PackageProvider.
bool haveApplydeltarpm()
Test whether an execuatble applydeltarpm program is available.
bool pkgGpgCheck() const
Whether the signature of rpm packages should be checked for this repo.
Definition: RepoInfo.cc:344
What is known about a repository.
Definition: RepoInfo.h:71
AutoDispose< const Pathname > ManagedFile
A Pathname plus associated cleanup code to be executed when path is no longer needed.
Definition: ManagedFile.h:27
Url url
Definition: MediaCurl.cc:196
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
Definition: Easy.h:27
Edition represents [epoch:]version[-release]
Definition: Edition.h:60
bool YAST_IS_RUNNING()
bool progressPackageDownload(int value) const
Redirect ProvideFilePolicy package download progress to this.
void progressDeltaApply(int value) const
TraitsType::constPtrType constPtr
Definition: ResObject.h:44
std::string form(const char *format,...) __attribute__((format(printf
Printf style construction of std::string.
Definition: String.cc:36
bool isKind(const ResKind &kind_r) const
Definition: SolvableType.h:64
Pathname packagesPath() const
Path where this repo packages are cached.
Definition: RepoInfo.cc:438
virtual ManagedFile providePackage() const =0
Provide the package.
Report & report() const
Access to the DownloadResolvableReport.
#define ERR
Definition: Logger.h:66
bool queryInstalled(const Edition &ed_r=Edition()) const
PackageProvider implementation for Package and SrcPackage.
Repo manager settings.
Definition: RepoManager.h:53
Policy for provideFile.
std::string str() const
Definition: String.h:221
virtual bool isCached() const =0
Whether the package is cached.
PackageProvider(RepoMediaAccess &access, const PoolItem &pi_r, const PackageProviderPolicy &policy_r=PackageProviderPolicy())
Ctor taking the package to provide.
#define ZYPP_RETHROW(EXCPT)
Drops a logline and rethrows, updating the CodeLocation.
Definition: Exception.h:329
RW_pointer< Impl > _pimpl
Implementation class.
const Tp & get(const std::string &key_r) const
Pass back a const Tp & reference to key_r value.
Definition: UserData.h:175
packagedelta::DeltaRpm DeltaRpm
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
Definition: NonCopyable.h:26
bool keepPackages() const
Whether packages downloaded from this repository will be kept in local cache.
Definition: RepoInfo.cc:432
Convenient building of std::string via std::ostringstream Basically a std::ostringstream autoconverti...
Definition: String.h:210
int unlink(const Pathname &path)
Like &#39;unlink&#39;.
Definition: PathInfo.cc:653
ManagedFile providePackageFromCache() const
Provide the package if it is cached.
bool set(const std::string &key_r, AnyType val_r)
Set the value for key (nonconst version always returns true).
Definition: UserData.h:118
PackageProviderImpl(RepoMediaAccess &access_r, const TPackagePtr &package_r, const PackageProviderPolicy &policy_r)
Ctor taking the Package to provide.
Package interface.
Definition: Package.h:32
ManagedFile doProvidePackageFromCache() const
Lookup the final rpm in cache.
PackageProviderImpl< TPackage > Base
#define WAR
Definition: Logger.h:65
Detailed rpm signature check log messages A single multiline message if CHK_OK.
Definition: RpmDb.h:443
virtual ManagedFile providePackageFromCache() const =0
Provide the package if it is cached.
ResTraits< TRes >::PtrType make(const sat::Solvable &solvable_r)
Directly create a certain kind of ResObject from sat::Solvable.
Definition: ResObject.h:119
int hardlinkCopy(const Pathname &oldpath, const Pathname &newpath)
Create newpath as hardlink or copy of oldpath.
Definition: PathInfo.cc:808
RpmDb::CheckPackageResult packageSigCheck(const Pathname &path_r, UserData &userData) const
RpmPackageProvider(RepoMediaAccess &access_r, const Package::constPtr &package_r, const DeltaCandidates &deltas_r, const PackageProviderPolicy &policy_r)
#define _(MSG)
Definition: Gettext.h:29
reference value() const
Reference to the Tp object.
Definition: AutoDispose.h:133
void defaultReportSignatureError(RpmDb::CheckPackageResult ret, const std::string &detail_r=std::string()) const
Default signature verification error handling.
const OnMediaLocation & location() const
Definition: PackageDelta.h:68
Provides files from different repos.
virtual ManagedFile doProvidePackage() const
Actually provide the final rpm.
bool baseUrlsEmpty() const
whether repository urls are available
Definition: RepoInfo.cc:498
void setDispose(const Dispose &dispose_r)
Set a new dispose function.
Definition: AutoDispose.h:158
SrcPackage interface.
Definition: SrcPackage.h:29
const std::string & sequenceinfo() const
Definition: PackageDelta.h:46
Base class for Exception.
Definition: Exception.h:143
ProvideFilePolicy & progressCB(ProgressCB progressCB_r)
Set callback.
void resolveSignatureErrorAction(repo::DownloadResolvableReport::Action action_r) const
React on signature verification error user action.
callback::SendReport< DownloadProgressReport > * report
Definition: MediaCurl.cc:199
const Pathname & filename() const
The path to the resource relatve to the url and path.
ManagedFile providePackage() const
Provide the package.
Typesafe passing of user data via callbacks.
Definition: UserData.h:38
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
Definition: AutoDispose.h:92
shared_ptr< MediaSetAccess > _access
RPM PackageProvider implementation (with deltarpm processing).
Pathname repoPackagesCachePath
Definition: RepoManager.h:82
std::string asUserHistory() const
A single (multiline) string composed of asUserString and historyAsString.
Definition: Exception.cc:75
CheckPackageResult
checkPackage result
Definition: RpmDb.h:429
bool quickcheck(const std::string &sequenceinfo_r)
Quick via check sequence info.
Definition: Applydeltarpm.h:48
bool check(const std::string &sequenceinfo_r, bool quick_r)
Check via sequence info.
bool haskey(const std::string &key_r) const
Whether key_r is in data.
Definition: UserData.h:97
Combining sat::Solvable and ResStatus.
Definition: PoolItem.h:50
bool progressDeltaDownload(int value) const
Base for exceptions caused by explicit user request.
static bool schemeIsDownloading(const std::string &scheme_r)
http https ftp sftp tftp
Definition: Url.cc:474
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:1
const ByteCount & downloadSize() const
The size of the resource on the server.
bool provide(const Pathname &delta_r, const Pathname &new_r, const Progress &report_r)
Apply a binary delta to on-disk data to re-create a new rpm.
Url manipulation class.
Definition: Url.h:87
std::string asUserString() const
Definition: SolvableType.h:88
TraitsType::constPtrType constPtr
Definition: Package.h:38
bool download_use_deltarpm_always() const
Whether to consider using a deltarpm even when rpm is local.
Definition: ZConfig.cc:969
#define DBG
Definition: Logger.h:63
static const Edition noedition
Value representing noedition ("") This is in fact a valid Edition.
Definition: Edition.h:73