26 Downloader::Downloader()
29 Downloader::Downloader(
const RepoInfo & repoinfo) : _repoinfo(repoinfo)
38 WAR <<
"Non implemented" << endl;
43 const Pathname &dest_dir,
46 WAR <<
"Non implemented" << endl;
51 Pathname sigpath = masterIndex_r.extend(
".asc" );
52 Pathname keypath = masterIndex_r.extend(
".key" );
57 start( destdir_r, media_r );
62 bool isSigned = PathInfo(destdir_r / sigpath).isExist();
66 if ( isSigned ||
repoInfo().repoGpgCheckIsMandatory() )
75 if ( PathInfo(destdir_r / keypath).isExist() )
86 WAR <<
"Accept unsigned repository because repoGpgCheck is not mandatory for " <<
repoInfo().
alias() << endl;
91 WAR <<
"Signature checking disabled in config of repository " <<
repoInfo().
alias() << endl;
95 start( destdir_r, media_r );
Checks for nothing Used as the default checker.
std::string alias() const
unique identifier for this source.
void defaultDownloadMasterIndex(MediaSetAccess &media_r, const Pathname &destdir_r, const Pathname &masterIndex_r)
Common workflow downloading a (signed) master index file.
Checks for the validity of a signature.
Store and operate with byte count.
What is known about a repository.
static const Unit MB
1000^2 Byte
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 setValidRepoSignature(TriBool value_r)
Set the value for validRepoSignature (or indeterminate if unsigned).
void reset()
Reset the transfer (jobs) list.
void setMetadataPath(const Pathname &path)
Set the path where the local metadata is stored.
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...
virtual void download(MediaSetAccess &media, const Pathname &dest_dir, const ProgressData::ReceiverFnc &progress=ProgressData::ReceiverFnc())
Download metadata to a local directory.
bool fileValidated() const
Return whether the last file passed to operator() was actually sucessfully verified.
Track changing files or directories.
function< void(const Pathname &file)> FileChecker
Functor signature used to check files.
virtual RepoStatus status(MediaSetAccess &media)
Status of the remote repository.
void setRepoInfo(const RepoInfo &repoinfo)
void enqueue(const OnMediaLocation &resource, const FileChecker &checker=FileChecker())
Enqueue a object for transferal, they will not be transferred until start() is called.
void setKeyContext(const KeyContext &keycontext)
Set context for this checker.