libzypp 17.37.17
zypp::repo::PackageProviderImpl< TPackage > Class Template Reference
Inheritance diagram for zypp::repo::PackageProviderImpl< TPackage >:

Public Member Functions

 PackageProviderImpl (RepoMediaAccess &access_r, TPackagePtr &&package_r, PackageProviderPolicy &&policy_r)
 Ctor taking the Package to provide.
 PackageProviderImpl (const PackageProviderImpl &)=delete
 PackageProviderImpl (PackageProviderImpl &&)=delete
PackageProviderImploperator= (const PackageProviderImpl &)=delete
PackageProviderImploperator= (PackageProviderImpl &&)=delete
 ~PackageProviderImpl () override
ManagedFile providePackage () const override
 Provide the package.
ManagedFile providePackageFromCache () const override
 Provide the package if it is cached.
bool isCached () const override
 Whether the package is cached.
Public Member Functions inherited from zypp::repo::PackageProvider::Impl
 Impl ()
 Impl (const Impl &)=delete
 Impl (Impl &&)=delete
Imploperator= (const Impl &)=delete
Imploperator= (Impl &&)=delete
virtual ~Impl ()

Protected Types

using Base = PackageProviderImpl<TPackage>
using Report = callback::SendReport<repo::DownloadResolvableReport>

Protected Member Functions

ManagedFile doProvidePackageFromCache () const
 Lookup the final rpm in cache.
virtual ManagedFile doProvidePackage () const
 Actually provide the final rpm.
Reportreport () const
 Access to the DownloadResolvableReport.
bool progressPackageDownload (int value) const
 Redirect ProvideFilePolicy package download progress to this.

Private Types

using TPackagePtr = typename TPackage::constPtr
using UserData = callback::UserData

Validate a rpm packages signature.

This is the FileChecker passed down to the Fetcher to validate a provided rpm package.

This builtin checker includes the workflow communicating with the user in case of a problem with the package signature.

Exceptions
RpmSigCheckExceptionif the package is not accepted, propagating the users decision how to proceed (DownloadResolvableReport::Action).
Note
This check is also needed, if the the rpm is built locally by using delta rpms! \see RpmPackageProvider
using ScopedGuard = shared_ptr<void>
using RpmDb = target::rpm::RpmDb
PackageProviderPolicy _policy
TPackagePtr _package
RepoMediaAccess_access
bool _retry
shared_ptr< Report_report
Target_Ptr _target
void rpmSigFileChecker (const Pathname &file_r) const
RpmDb::CheckPackageResult packageSigCheck (const Pathname &path_r, bool isMandatory_r, UserData &userData) const
 Actual rpm package signature check.
void resolveSignatureErrorAction (repo::DownloadResolvableReport::Action action_r) const
 React on signature verification error user action.
void defaultReportSignatureError (RpmDb::CheckPackageResult ret, const std::string &detail_r=std::string()) const
 Default signature verification error handling.
ScopedGuard newReport () const

Detailed Description

template<class TPackage>
class zypp::repo::PackageProviderImpl< TPackage >

Definition at line 112 of file PackageProvider.cc.

Member Typedef Documentation

◆ TPackagePtr

template<class TPackage>
using zypp::repo::PackageProviderImpl< TPackage >::TPackagePtr = typename TPackage::constPtr
private

Definition at line 114 of file PackageProvider.cc.

◆ UserData

template<class TPackage>
using zypp::repo::PackageProviderImpl< TPackage >::UserData = callback::UserData
private

Definition at line 115 of file PackageProvider.cc.

◆ Base

template<class TPackage>
using zypp::repo::PackageProviderImpl< TPackage >::Base = PackageProviderImpl<TPackage>
protected

Definition at line 154 of file PackageProvider.cc.

◆ Report

template<class TPackage>
using zypp::repo::PackageProviderImpl< TPackage >::Report = callback::SendReport<repo::DownloadResolvableReport>
protected

Definition at line 155 of file PackageProvider.cc.

◆ RpmDb

template<class TPackage>
using zypp::repo::PackageProviderImpl< TPackage >::RpmDb = target::rpm::RpmDb
protected

Definition at line 294 of file PackageProvider.cc.

◆ ScopedGuard

template<class TPackage>
using zypp::repo::PackageProviderImpl< TPackage >::ScopedGuard = shared_ptr<void>
private

Definition at line 356 of file PackageProvider.cc.

Constructor & Destructor Documentation

◆ PackageProviderImpl() [1/3]

template<class TPackage>
zypp::repo::PackageProviderImpl< TPackage >::PackageProviderImpl ( RepoMediaAccess & access_r,
TPackagePtr && package_r,
PackageProviderPolicy && policy_r )
inline

Ctor taking the Package to provide.

Definition at line 118 of file PackageProvider.cc.

◆ PackageProviderImpl() [2/3]

template<class TPackage>
zypp::repo::PackageProviderImpl< TPackage >::PackageProviderImpl ( const PackageProviderImpl< TPackage > & )
delete

◆ PackageProviderImpl() [3/3]

template<class TPackage>
zypp::repo::PackageProviderImpl< TPackage >::PackageProviderImpl ( PackageProviderImpl< TPackage > && )
delete

◆ ~PackageProviderImpl()

template<class TPackage>
zypp::repo::PackageProviderImpl< TPackage >::~PackageProviderImpl ( )
inlineoverride

Definition at line 131 of file PackageProvider.cc.

Member Function Documentation

◆ operator=() [1/2]

template<class TPackage>
PackageProviderImpl & zypp::repo::PackageProviderImpl< TPackage >::operator= ( const PackageProviderImpl< TPackage > & )
delete

◆ operator=() [2/2]

template<class TPackage>
PackageProviderImpl & zypp::repo::PackageProviderImpl< TPackage >::operator= ( PackageProviderImpl< TPackage > && )
delete

◆ providePackage()

template<class TPackage>
ManagedFile zypp::repo::PackageProviderImpl< TPackage >::providePackage ( ) const
overridevirtual

Provide the package.

The basic workflow.

Exceptions
Exception.

Implements zypp::repo::PackageProvider::Impl.

Definition at line 376 of file PackageProvider.cc.

◆ providePackageFromCache()

template<class TPackage>
ManagedFile zypp::repo::PackageProviderImpl< TPackage >::providePackageFromCache ( ) const
inlineoverridevirtual

Provide the package if it is cached.

Implements zypp::repo::PackageProvider::Impl.

Definition at line 141 of file PackageProvider.cc.

◆ isCached()

template<class TPackage>
bool zypp::repo::PackageProviderImpl< TPackage >::isCached ( ) const
inlineoverridevirtual

Whether the package is cached.

Implements zypp::repo::PackageProvider::Impl.

Definition at line 150 of file PackageProvider.cc.

◆ doProvidePackageFromCache()

template<class TPackage>
ManagedFile zypp::repo::PackageProviderImpl< TPackage >::doProvidePackageFromCache ( ) const
inlineprotected

Lookup the final rpm in cache.

A cache hit will return a non empty ManagedFile and an empty one on cache miss.

Note
File disposal depending on the repos effectiveKeepPackages setting are not set here, but in providePackage or providePackageFromCache.

Definition at line 164 of file PackageProvider.cc.

◆ doProvidePackage()

template<class TPackage>
virtual ManagedFile zypp::repo::PackageProviderImpl< TPackage >::doProvidePackage ( ) const
inlineprotectedvirtual

Actually provide the final rpm.

Report start/problem/finish and retry loop are hadled by providePackage. Here you trigger just progress and delta/plugin callbacks as needed.

Proxy method for progressPackageDownload is provided here.

policy.progressCB( bind( &Base::progressPackageDownload, this, _1 ) );
return _access.provideFile( _package->repoInfo(), loc, policy );
Policy for provideFile and RepoMediaAccess.
ProvideFilePolicy & progressCB(ProgressCB progressCB_r)
Set callback.
Note
The provided default implementation retrieves the packages default location.

Reimplemented in zypp::repo::RpmPackageProvider.

Definition at line 181 of file PackageProvider.cc.

◆ report()

template<class TPackage>
Report & zypp::repo::PackageProviderImpl< TPackage >::report ( ) const
inlineprotected

Access to the DownloadResolvableReport.

Definition at line 194 of file PackageProvider.cc.

◆ progressPackageDownload()

template<class TPackage>
bool zypp::repo::PackageProviderImpl< TPackage >::progressPackageDownload ( int value) const
inlineprotected

Redirect ProvideFilePolicy package download progress to this.

Definition at line 198 of file PackageProvider.cc.

◆ rpmSigFileChecker()

template<class TPackage>
void zypp::repo::PackageProviderImpl< TPackage >::rpmSigFileChecker ( const Pathname & file_r) const
inlineprotected

Definition at line 216 of file PackageProvider.cc.

◆ packageSigCheck()

template<class TPackage>
RpmDb::CheckPackageResult zypp::repo::PackageProviderImpl< TPackage >::packageSigCheck ( const Pathname & path_r,
bool isMandatory_r,
UserData & userData ) const
inlineprotected

Actual rpm package signature check.

Definition at line 297 of file PackageProvider.cc.

◆ resolveSignatureErrorAction()

template<class TPackage>
void zypp::repo::PackageProviderImpl< TPackage >::resolveSignatureErrorAction ( repo::DownloadResolvableReport::Action action_r) const
inlineprotected

React on signature verification error user action.

Note
: IGNORE == accept insecure file (no SkipRequestException!)

Definition at line 324 of file PackageProvider.cc.

◆ defaultReportSignatureError()

template<class TPackage>
void zypp::repo::PackageProviderImpl< TPackage >::defaultReportSignatureError ( RpmDb::CheckPackageResult ret,
const std::string & detail_r = std::string() ) const
inlineprotected

Default signature verification error handling.

Definition at line 340 of file PackageProvider.cc.

◆ newReport()

template<class TPackage>
ScopedGuard zypp::repo::PackageProviderImpl< TPackage >::newReport ( ) const
inlineprivate

Definition at line 358 of file PackageProvider.cc.

Member Data Documentation

◆ _policy

template<class TPackage>
PackageProviderPolicy zypp::repo::PackageProviderImpl< TPackage >::_policy
protected

Definition at line 351 of file PackageProvider.cc.

◆ _package

template<class TPackage>
TPackagePtr zypp::repo::PackageProviderImpl< TPackage >::_package
protected

Definition at line 352 of file PackageProvider.cc.

◆ _access

template<class TPackage>
RepoMediaAccess& zypp::repo::PackageProviderImpl< TPackage >::_access
protected

Definition at line 353 of file PackageProvider.cc.

◆ _retry

template<class TPackage>
bool zypp::repo::PackageProviderImpl< TPackage >::_retry
mutableprivate

Definition at line 369 of file PackageProvider.cc.

◆ _report

template<class TPackage>
shared_ptr<Report> zypp::repo::PackageProviderImpl< TPackage >::_report
mutableprivate

Definition at line 370 of file PackageProvider.cc.

◆ _target

template<class TPackage>
Target_Ptr zypp::repo::PackageProviderImpl< TPackage >::_target
mutableprivate

Definition at line 371 of file PackageProvider.cc.


The documentation for this class was generated from the following file: