19#include <zypp-core/zyppng/pipelines/Expected>
20#include <zypp-media/FileCheckException>
21#include <zypp-media/ng/Provide>
23#include <zypp/ng/Context>
25#include <zypp/ng/UserRequest>
33 template <
class Executor,
class OpType >
56 MIL <<
"File " <<
_file <<
" has no checksum available." << std::endl;
58 MIL <<
"User accepted " <<
_file <<
" with no checksum." << std::endl;
78 static std::map<std::string,std::string> exceptions;
84 WAR <<
"File " <<
_file <<
" has wrong checksum " << real_checksum <<
" (expected " <<
_checksum <<
")" << std::endl;
85 if ( !exceptions.empty() && exceptions[real_checksum.checksum()] ==
_checksum.
checksum() )
87 WAR <<
"User accepted " <<
_file <<
" with WRONG CHECKSUM. (remembered)" << std::endl;
92 WAR <<
"User accepted " <<
_file <<
" with WRONG CHECKSUM." << std::endl;
127 using zyppng::operators::operator|;
141 using zyppng::operators::operator|;
std::string checksum() const
Store and operate on date (time_t).
static const ValueType hour
static Date now()
Return the current time.
std::string basename() const
Return the last component of this path.
bool askUserToAcceptWrongDigest(const zypp::Pathname &file, const std::string &requested, const std::string &found)
bool askUserToAcceptNoDigest(const zypp::Pathname &file)
A ProvideRes object is a reference counted ownership of a resource in the cache provided by a Provide...
static expected success(ConsParams &&...params)
std::function< AsyncOpRef< expected< ProvideRes > >(ProvideRes &&)> checksumFileChecker(ContextRef zyppCtx, zypp::CheckSum checksum)
expected< void > verifyChecksum(SyncContextRef zyppCtx, zypp::CheckSum checksum, zypp::Pathname file)
std::shared_ptr< AsyncOp< T > > AsyncOpRef
typename remove_smart_ptr< T >::type remove_smart_ptr_t
std::conditional_t< detail::is_async_op_v< OpType >, ContextRef, SyncContextRef > MaybeAsyncContextRef
typename ZyppContextType::ProvideType ProvideType
typename ProvideType::MediaHandle MediaHandle
ZYPP_ENABLE_LOGIC_BASE(Executor, OpType)
MaybeAsyncContextRef< OpType > ZyppContextRefType
typename ProvideType::Res ProvideRes
ZyppContextRefType _context
DigestReportHelper< ZyppContextRefType > _report
remove_smart_ptr_t< ZyppContextRefType > ZyppContextType
CheckSumWorkflowLogic(ZyppContextRefType zyppContext, zypp::CheckSum &&checksum, zypp::Pathname file)
auto makeReadyResult(T &&res)
#define ZYPP_EXCPT_PTR(EXCPT)
Drops a logline and returns Exception as a std::exception_ptr.