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 )
52 :
_ctx(std::move(ctx))
56 MaybeAsyncRef<expected<zypp::RepoStatus>> execute() {
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 && ) {
143 std::vector<zypp::OnMediaLocation> requiredFiles;
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;
172 std::map<std::string,zypp::parser::susetags::RepoIndex::FileChecksumMap::const_iterator> availablePackageTranslations;
179 static const zypp::str::regex rx_packages(
"^packages((.gz)?|(.([^.]*))(.gz)?)$" );
187 else if ( what[4] ==
"FL" )
192 availablePackageTranslations[what[4]] = it;
199 }
else if ( it->first ==
"patterns.pat"
200 || it->first ==
"patterns.pat.gz" ) {
212 std::vector<std::string> patparts;
213 unsigned archpos = 2;
215 unsigned count =
zypp::str::split( it->first, std::back_inserter(patparts),
"." );
216 if ( patparts[count-1] ==
"gz" )
219 if ( count > archpos ) {
221 zypp::Arch patarch( patparts[count-archpos] );
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;
238 .
setDeltafile( search_deltafile(
_ctx->deltaDir() + descr_dir, it->first) );
240 requiredFiles.push_back( std::move(location) );
246 auto fnc_checkTransaltions( [&](
const zypp::Locale & locale_r ) {
248 auto it( availablePackageTranslations.find( toGet.code() ) );
249 if ( it != availablePackageTranslations.end() ) {
250 auto mit( it->second );
251 MIL <<
"adding job " << mit->first << std::endl;
254 .
setDeltafile( search_deltafile( deltaDir() + descr_dir, mit->first) ));
260 for (
const zypp::Locale & it : zConfig().repoRefreshLocales() ) {
261 fnc_checkTransaltions( it );
263 fnc_checkTransaltions( zConfig().textLocale() );
266 for(
const auto &it :
_repoindex->mediaFileChecksums ) {
268 if ( it.first !=
"license.tar.gz" )
271 MIL <<
"adding job " << it.first << std::endl;
274 .
setDeltafile( search_deltafile( deltaDir(), it.first ) ));
277 for(
const auto &it :
_repoindex->signingKeys ) {
278 MIL <<
"adding job " << it.first << std::endl;
280 location.setChecksum( it.second );
281 requiredFiles.push_back( std::move(location) );
299 }) |
and_then ( [
this]( std::vector<zypp::ManagedFile> &&dlFiles ) {
300 auto &downloadedFiles =
_ctx->files();
301 downloadedFiles.insert( downloadedFiles.end(), std::make_move_iterator(dlFiles.begin()), std::make_move_iterator(dlFiles.end()) );
312 return _ctx->repoInfo();
316 return _ctx->deltaDir();
320 return _ctx->zyppContext()->config();
323 DlContextRefType
_ctx;
Track changing files or directories.
bool empty() const
Whether the status is empty (empty checksum)