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;
90 else if (
_report.askUserToAcceptWrongDigest(
_file,
_checksum.checksum(), real_checksum.checksum() ) )
92 WAR <<
"User accepted " <<
_file <<
" with WRONG CHECKSUM." << std::endl;
93 exceptions[real_checksum.checksum()] =
_checksum.checksum();
127 using zyppng::operators::operator|;
141 using zyppng::operators::operator|;
Store and operate on date (time_t).
static const ValueType hour
static Date now()
Return the current time.
A ProvideRes object is a reference counted ownership of a resource in the cache provided by a Provide...
static expected success(ConsParams &&...params)
static expected error(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
MediaSyncFacade::Res SyncProvideRes
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.