19#include <zypp-core/zyppng/pipelines/Expected>
20#include <zypp-media/FileCheckException>
21#include <zypp-media/ng/Provide>
23#include <zypp/ng/Context>
24#include <zypp/ng/UserRequest>
32 template <
class Executor,
class OpType >
54 MIL <<
"File " <<
_file <<
" has no checksum available." << std::endl;
56 MIL <<
"User accepted " <<
_file <<
" with no checksum." << std::endl;
76 static std::map<std::string,std::string>
exceptions;
85 WAR <<
"User accepted " <<
_file <<
" with WRONG CHECKSUM. (remembered)" << std::endl;
90 WAR <<
"User accepted " <<
_file <<
" with WRONG CHECKSUM." << std::endl;
120 return req->choice ();
126 return req->choice ();
132 return req->choice ();
146 return report->askUserToAcceptNoDigest(file);
150 return report->askUserToAccepUnknownDigest( file, name );
154 return report->askUserToAcceptWrongDigest( file,
requested,
found );
170 using zyppng::operators::operator|;
184 using zyppng::operators::operator|;
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
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.
A ProvideRes object is a reference counted ownership of a resource in the cache provided by a Provide...
static expected success(ConsParams &&...params)
String related utilities and Regular expression matching.
std::string checksum(const Pathname &file, const std::string &algorithm)
Compute a files checksum.
UserData makeData(const zypp::Pathname &p)
UserData makeData(const zypp::Pathname &p, const std::string &name)
UserData makeData(const zypp::Pathname &p, const std::string &requested, const std::string &found)
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
bool askUserToAcceptNoDigest(const zypp::Pathname &file)
bool askUserToAcceptWrongDigest(const zypp::Pathname &file, const std::string &requested, const std::string &found)
bool askUserToAccepUnknownDigest(const zypp::Pathname &file, const std::string &name)
typename ZyppContextType::ProvideType ProvideType
typename ProvideType::MediaHandle MediaHandle
ZYPP_ENABLE_LOGIC_BASE(Executor, OpType)
MaybeAsyncContextRef< OpType > ZyppContextRefType
typename ProvideType::Res ProvideRes
ZyppContextRefType _context
CheckSumWorkflowLogic(ZyppContextRefType zyppContext, zypp::CheckSum &&checksum, zypp::Pathname file)
bool askUserToAcceptNoDigest(const zypp::Pathname &file)
bool askUserToAcceptWrongDigest(const zypp::Pathname &file, const std::string &requested, const std::string &found)
bool askUserToAccepUnknownDigest(const zypp::Pathname &file, const std::string &name)
zypp::CheckSum checksumFromFile(SyncContextRef &, const zypp::Pathname &path, const std::string &checksumType)
static std::enable_if_t< detail::is_async_op_v< FOpType >, AsyncOpRef< Result > > run(Args &&...args)
auto makeReadyResult(T &&res)
#define ZYPP_EXCPT_PTR(EXCPT)
Drops a logline and returns Exception as a std::exception_ptr.