11#include <solv/solvversion.h>
12#include <zypp/base/String.h>
13#include <zypp/base/LogTools.h>
14#include <zypp/base/Function.h>
20#include <zypp-core/base/UserRequestException>
38 if ( ! prefix_r.
empty() && prefix_r !=
"/" )
52 std::string base { file.
basename() };
53 size_t hypoff = base.find(
"-" );
54 if ( hypoff != std::string::npos )
55 base.replace( 0, hypoff + 1,
"" );
57 std::list<std::string> retlist;
60 for (
const auto & fn : retlist )
112#if defined(LIBSOLVEXT_FEATURE_ZCHUNK_COMPRESSION)
113 const std::string & basetype { zchk ? typestr_r.substr( 0, typestr_r.size()-4 ) : typestr_r };
117 const std::string & basetype { typestr_r };
121 if ( basetype ==
"other" || basetype ==
"filelists" )
183 , _deltaDir { deltaDir_r }
197 Impl pimpl( *
this, media_r, destDir_r );
209 if ( !ret.empty() && ri.requireStatusWithMediaFile() )
Interface of repomd.xml file reader.
void start(const Pathname &dest_dir, const ProgressData::ReceiverFnc &progress=ProgressData::ReceiverFnc())
start the transfer to a destination directory dest_dir The media has to be provides with setMediaSetA...
void enqueueDigested(const OnMediaLocation &resource, const FileChecker &checker=FileChecker())
Enqueue a object for transferal, they will not be transferred until start() is called.
void setMediaSetAccess(MediaSetAccess &media)
Sets the media set access that will be used to precache and to download the files when start is calle...
'Language[_Country]' codes.
Locale fallback() const
Return the fallback locale for this locale, if no fallback exists the empty Locale::noCode.
function< bool(const ProgressData &)> ReceiverFnc
Most simple version of progress reporting The percentage in most cases.
What is known about a repository.
Pathname path() const
Repository path.
Track changing files or directories.
static ZConfig & instance()
Singleton ctor.
Wrapper class for stat/lstat.
std::string basename() const
Return the last component of this path.
bool empty() const
Test for an empty path.
Reads through a repomd.xml file and collects type, location, checksum and other data about metadata f...
const RepoInfo & repoInfo() const
void defaultDownloadMasterIndex(MediaSetAccess &media_r, const Pathname &destdir_r, const Pathname &masterIndex_r)
Common workflow downloading a (signed) master index file.
Downloader for YUM (rpm-nmd) repositories Encapsulates all the knowledge of which files have to be do...
void download(MediaSetAccess &media_r, const Pathname &destDir_r, const ProgressData::ReceiverFnc &progress_r=ProgressData::ReceiverFnc()) override
Download metadata to a local directory.
RepoStatus status(MediaSetAccess &media_r) override
Status of the remote repository.
int readdir(std::list< std::string > &retlist_r, const Pathname &path_r, bool dots_r)
Return content of directory via retlist.
void downloadMediaInfo(const Pathname &dest_dir, MediaSetAccess &media, const ProgressData::ReceiverFnc &progressrcv)
Downloads the media info (/media.1) to a local directory.
bool startsWith(const C_Str &str_r, const C_Str &prefix_r)
alias for hasPrefix
bool endsWith(const C_Str &str_r, const C_Str &prefix_r)
alias for hasSuffix
Easy-to use interface to the ZYPP dependency resolver.
std::unordered_set< Locale > LocaleSet
function< void(const Pathname &file)> FileChecker
Functor signature used to check files.
Helper filtering the files offered by a RepomdFileReader.
LocaleSet _wantedLocales
Locales do download.
const Pathname & deltaDir() const
const Pathname & _destDir
bool wantLocale(const Locale &locale_r) const
void addWantedLocale(Locale locale_r)
std::map< std::string, OnMediaLocation > _wantedFiles
bool operator()(const OnMediaLocation &loc_r, const std::string &typestr_r)
The callback invoked by the RepomdFileReader.
Impl(Downloader &downloader_r, MediaSetAccess &media_r, const Pathname &destDir_r)