11#include <zypp-core/zyppng/ui/ProgressObserver>
12#include <zypp-media/ng/ProvideSpec>
13#include <zypp/ng/Context>
15#include <zypp-core/parser/ParseException>
25#undef ZYPP_BASE_LOGGER_LOGGROUP
26#define ZYPP_BASE_LOGGER_LOGGROUP "zypp::repomanager"
39 template<
class Executor,
class OpType>
40 struct StatusLogic :
public LogicBase<Executor, OpType>{
46 using ZyppContextType =
typename DlContextRefType::element_type::ContextType;
47 using ProvideType =
typename ZyppContextType::ProvideType;
48 using MediaHandle =
typename ProvideType::MediaHandle;
51 StatusLogic( DlContextRefType
ctx, MediaHandle &&media )
66 if ( !status.
empty() ) {
110 template<
class Executor,
class OpType>
111 struct DlLogic :
public LogicBase<Executor, OpType> {
117 using ZyppContextType =
typename DlContextRefType::element_type::ContextType;
118 using ProvideType =
typename ZyppContextType::ProvideType;
119 using MediaHandle =
typename ProvideType::MediaHandle;
122 DlLogic( DlContextRefType
ctx, MediaHandle &&mediaHandle, ProgressObserverRef &&
progressObserver )
134 if ( mediaInfo )
_ctx->files().push_back ( std::move(mediaInfo.get()) );
140 |
and_then( [
this] ( DlContextRefType && ) {
150 MIL <<
"Consuming repo index" << std::endl;
153 content.
parse( inputfile );
155 if ( ! _repoindex ) {
160 if (
_repoindex->metaFileChecksums.empty() ) {
165 WAR <<
"No signing keys defined." << std::endl;
187 else if ( what[4] ==
"FL" )
199 }
else if (
it->first ==
"patterns.pat"
200 ||
it->first ==
"patterns.pat.gz" ) {
222 if ( !
patarch.compatibleWith(
zConfig().systemArchitecture() ) ) {
224 MIL <<
"Discarding pattern " <<
it->first << std::endl;
229 WAR <<
"Pattern file name does not contain recognizable architecture: " <<
it->first << std::endl;
235 MIL <<
"adding job " <<
it->first << std::endl;
250 auto mit(
it->second );
251 MIL <<
"adding job " <<
mit->first << std::endl;
266 for(
const auto &
it :
_repoindex->mediaFileChecksums ) {
268 if (
it.first !=
"license.tar.gz" )
271 MIL <<
"adding job " <<
it.first << std::endl;
278 MIL <<
"adding job " <<
it.first << std::endl;
280 location.setChecksum(
it.second );
312 return _ctx->repoInfo();
316 return _ctx->deltaDir();
320 return _ctx->zyppContext()->config();
323 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, ProgressObserver::FinishResult result=ProgressObserver::Success)
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_FWD_CURRENT_EXCPT()
Drops a logline and returns the current Exception as a std::exception_ptr.
#define ZYPP_THROW(EXCPT)
Drops a logline and throws the Exception.