26 using namespace zypp::xml;
27 using namespace zypp::parser::yum;
36 Downloader::Downloader(
const RepoInfo &repoinfo ,
const Pathname &delta_dir)
37 : repo::
Downloader(repoinfo), _delta_dir(delta_dir), _media_ptr(0L)
50 const Pathname & prefix)
52 if (prefix.empty() || prefix ==
"/")
64 if (!PathInfo(dir).isDir())
66 string base = file.basename();
67 size_t hypoff = base.find(
"-");
68 if (hypoff != string::npos)
69 base.replace(0, hypoff + 1,
"");
70 size_t basesize = base.size();
71 std::list<Pathname> retlist;
74 for_( it, retlist.begin(), retlist.end() )
76 string fn = it->asString();
77 if (fn.size() >= basesize && fn.substr(fn.size() - basesize, basesize) == base)
88 MIL <<
id <<
" : " << loc_with_path << endl;
97 MIL << dtype <<
" : " << loc_with_path << endl;
103 MIL <<
"Skipping other.xml" << endl;
109 MIL <<
"Skipping filelists.xml.gz" << endl;
130 const Pathname &dest_dir,
133 Pathname repomdpath =
repoInfo().
path() +
"/repodata/repomd.xml";
134 Pathname keypath =
repoInfo().
path() +
"/repodata/repomd.xml.key";
135 Pathname sigpath =
repoInfo().
path() +
"/repodata/repomd.xml.asc";
140 progress.
sendTo(progressrcv);
147 #warning Do we need SignatureFileChecker(string descr)?
153 if ( PathInfo(dest_dir / sigpath).isExist() )
163 if ( PathInfo(dest_dir / keypath).isExist() )
172 if ( ! progress.
tick() )
176 WAR <<
"Signature checking disabled in config of repository " <<
repoInfo().
alias() << endl;
182 if ( ! progress.
tick() )
187 Reader reader( dest_dir +
repoInfo().path() +
"/repodata/repomd.xml" );
Checks for nothing Used as the default checker.
std::string alias() const
unique identifier for this source.
static const ResourceType PATCHES
RepoStatus status(MediaSetAccess &media)
Status of the remote repository.
static const ResourceType OTHER
void sendTo(const ReceiverFnc &fnc_r)
Set ReceiverFnc.
#define ZYPP_THROW(EXCPT)
Drops a logline and throws the Exception.
Checks for the validity of a signature.
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...
bool toMax()
Set counter value to current max value (unless no range).
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 addPublicKey(const PublicKey &publickey, const KeyContext &keycontext=KeyContext())
add a public key to the list of known keys
void enqueueDigested(const OnMediaLocation &resource, const FileChecker &checker=FileChecker(), const Pathname &deltafile=Pathname())
Enqueue a object for transferal, they will not be transfered until start() is called.
bool toMin()
Set counter value to current min value.
void reset()
Reset the transfer (jobs) list.
bool repomd_Callback(const OnMediaLocation &loc, const ResourceType &dtype)
bool gpgCheck() const
Whether to check or not this repository with gpg.
Maintain [min,max] and counter (value) for progress counting.
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.
bool tick()
Leave counter value unchanged (still alive).
Interface of repomd.xml file reader.
Local facts about a repository This class represents the status of a repository on the system...
static const ResourceType FILELISTS
function< void(const Pathname &file)> FileChecker
Functor signature used to check files.
void setRepoInfo(const RepoInfo &repoinfo)
Downloader for YUM (rpm-nmd) repositories Encapsulates all the knowledge of which files have to be do...
void enqueue(const OnMediaLocation &resource, const FileChecker &checker=FileChecker())
Enqueue a object for transferal, they will not be transfered until start() is called.
Pathname path() const
Repository path.
void setKeyContext(const KeyContext &keycontext)
Set context for this checker.
xmlTextReader based interface to iterate xml streams.