11#include <zypp-core/zyppng/ui/ProgressObserver>
12#include <zypp-media/ng/ProvideSpec>
13#include <zypp/ng/Context>
15#include <zypp-core/parser/ParseException>
36 template<
class Executor,
class OpType>
37 struct StatusLogic :
public LogicBase<Executor, OpType>{
43 using ZyppContextType =
typename DlContextRefType::element_type::ContextType;
44 using ProvideType =
typename ZyppContextType::ProvideType;
45 using MediaHandle =
typename ProvideType::MediaHandle;
48 StatusLogic( DlContextRefType
ctx, MediaHandle &&media )
63 if ( !status.
empty() ) {
107 template<
class Executor,
class OpType>
108 struct DlLogic :
public LogicBase<Executor, OpType> {
114 using ZyppContextType =
typename DlContextRefType::element_type::ContextType;
115 using ProvideType =
typename ZyppContextType::ProvideType;
116 using MediaHandle =
typename ProvideType::MediaHandle;
119 DlLogic( DlContextRefType
ctx, MediaHandle &&mediaHandle, ProgressObserverRef &&
progressObserver )
131 if ( mediaInfo )
_ctx->files().push_back ( std::move(mediaInfo.get()) );
137 |
and_then( [
this] ( DlContextRefType && ) {
147 MIL <<
"Consuming repo index" << std::endl;
150 content.
parse( inputfile );
152 if ( ! _repoindex ) {
157 if (
_repoindex->metaFileChecksums.empty() ) {
162 WAR <<
"No signing keys defined." << std::endl;
184 else if ( what[4] ==
"FL" )
196 }
else if (
it->first ==
"patterns.pat"
197 ||
it->first ==
"patterns.pat.gz" ) {
219 if ( !
patarch.compatibleWith(
zConfig().systemArchitecture() ) ) {
221 MIL <<
"Discarding pattern " <<
it->first << std::endl;
226 WAR <<
"Pattern file name does not contain recognizable architecture: " <<
it->first << std::endl;
232 MIL <<
"adding job " <<
it->first << std::endl;
247 auto mit(
it->second );
248 MIL <<
"adding job " <<
mit->first << std::endl;
263 for(
const auto &
it :
_repoindex->mediaFileChecksums ) {
265 if (
it.first !=
"license.tar.gz" )
268 MIL <<
"adding job " <<
it.first << std::endl;
275 MIL <<
"adding job " <<
it.first << std::endl;
277 location.setChecksum(
it.second );
309 return _ctx->repoInfo();
313 return _ctx->deltaDir();
317 return _ctx->zyppContext()->config();
320 DlContextRefType
_ctx;
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
Base class for Exception.
'Language[_Country]' codes.
What is known about a repository.
Track changing files or directories.
bool empty() const
Whether the status is empty (empty checksum)
Interim helper class to collect global options and settings.
Wrapper class for stat/lstat.
std::string basename() const
Return the last component of this path.
Parse repoindex part from a content file.
virtual void parse(const InputStream &imput_r, const ProgressData::ReceiverFnc &fnc_r=ProgressData::ReceiverFnc())
Parse the stream.
void setRepoIndexConsumer(const RepoIndexConsumer &fnc_r)
Consumer to call when repo index was parsed.
Regular expression match result.
A ProvideRes object is a reference counted ownership of a resource in the cache provided by a Provide...
static expected success(ConsParams &&...params)
#define ZYPP_ENABLE_LOGIC_BASE(Executor, OpType)
typename conditional< B, T, F >::type conditional_t
bool hasPrefix(const C_Str &str_r, const C_Str &prefix_r)
Return whether str_r has prefix prefix_r.
bool endsWith(const C_Str &str_r, const C_Str &prefix_r)
alias for hasSuffix
bool regex_match(const std::string &s, smatch &matches, const regex ®ex)
\relates regex \ingroup ZYPP_STR_REGEX \relates regex \ingroup ZYPP_STR_REGEX
unsigned split(const C_Str &line_r, TOutputIterator result_r, const C_Str &sepchars_r=" \t", const Trim trim_r=NO_TRIM)
Split line_r into words.
AsyncOpRef< expected< zypp::ManagedFile > > provideToCacheDir(AsyncCacheProviderContextRef cacheContext, ProvideMediaHandle medium, zypp::Pathname file, ProvideFileSpec filespec)
AsyncOpRef< expected< repo::AsyncDownloadContextRef > > downloadMasterIndex(repo::AsyncDownloadContextRef dl, ProvideMediaHandle mediaHandle, zypp::filesystem::Pathname masterIndex_r)
auto downloadMediaInfo(MediaHandle &&mediaHandle, const zypp::filesystem::Pathname &destdir)
auto transform_collect(Transformation &&f)
auto and_then(Fun &&function)
auto finishProgress(ProgressObserverRef progressObserver)
auto incProgress(ProgressObserverRef progressObserver, double progrIncrease=1.0, std::optional< std::string > newStr={})
auto inspect(Fun &&function)
std::conditional_t< isAsync, AsyncOpRef< T >, T > makeReadyResult(T &&result)
static expected< std::decay_t< Type >, Err > make_expected_success(Type &&t)
ProgressObserverRef _progressObserver
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
#define ZYPP_CAUGHT(EXCPT)
Drops a logline telling the Exception was caught (in order to handle it).
#define ZYPP_THROW(EXCPT)
Drops a logline and throws the Exception.