23 using namespace zypp::xml;
24 using namespace zypp::parser::yum;
33 Downloader::Downloader(
const RepoInfo &repoinfo ,
const Pathname &delta_dir)
34 : repo::
Downloader(repoinfo), _delta_dir(delta_dir), _media_ptr(0L)
47 const Pathname & prefix)
49 if (prefix.empty() || prefix ==
"/")
61 if (!PathInfo(dir).isDir())
63 string base = file.basename();
64 size_t hypoff = base.find(
"-");
65 if (hypoff != string::npos)
66 base.replace(0, hypoff + 1,
"");
67 size_t basesize = base.size();
68 std::list<Pathname> retlist;
71 for_( it, retlist.begin(), retlist.end() )
73 string fn = it->asString();
74 if (fn.size() >= basesize && fn.substr(fn.size() - basesize, basesize) == base)
85 MIL <<
id <<
" : " << loc_with_path << endl;
94 MIL << dtype <<
" : " << loc_with_path << endl;
100 MIL <<
"Skipping other.xml" << endl;
106 MIL <<
"Skipping filelists.xml.gz" << endl;
128 const Pathname &dest_dir,
131 Pathname masterIndex(
repoInfo().path() /
"/repodata/repomd.xml" );
139 start( dest_dir, media );
void defaultDownloadMasterIndex(MediaSetAccess &media_r, const Pathname &destdir_r, const Pathname &masterIndex_r)
Common workflow downloading a (signed) master index file.
static const ResourceType PATCHES
RepoStatus status(MediaSetAccess &media)
Status of the remote repository.
static const ResourceType OTHER
bool patches_Callback(const OnMediaLocation &loc, const std::string &id)
Iterates through a patches.xml file giving on each iteration a OnMediaLocation object with the resour...
What is known about a repository.
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
MediaSetAccess * _media_ptr
const RepoInfo & repoInfo() const
function< bool(const ProgressData &)> ReceiverFnc
Most simple version of progress reporting The percentage in most cases.
void enqueueDigested(const OnMediaLocation &resource, const FileChecker &checker=FileChecker(), const Pathname &deltafile=Pathname())
Enqueue a object for transferal, they will not be transferred until start() is called.
bool repomd_Callback(const OnMediaLocation &loc, const ResourceType &dtype)
Interface of patches.xml file reader.
void start(const Pathname &dest_dir, MediaSetAccess &media, const ProgressData::ReceiverFnc &progress=ProgressData::ReceiverFnc())
start the transfer to a destination directory dest_dir You have to provde a media set access media to...
static Pathname search_deltafile(const Pathname &dir, const Pathname &file)
int readdir(std::list< std::string > &retlist_r, const Pathname &path_r, bool dots_r)
Return content of directory via retlist.
Reads through a repomd.xml file and collects type, location, checksum and other data about metadata f...
static OnMediaLocation loc_with_path_prefix(const OnMediaLocation &loc, const Pathname &prefix)
void download(MediaSetAccess &media, const Pathname &dest_dir, const ProgressData::ReceiverFnc &progress=ProgressData::ReceiverFnc())
Download metadata to a local directory.
Interface of repomd.xml file reader.
Track changing files or directories.
static const ResourceType FILELISTS
function< void(const Pathname &file)> FileChecker
Functor signature used to check files.
Downloader for YUM (rpm-nmd) repositories Encapsulates all the knowledge of which files have to be do...