Public Member Functions | |
Impl () | |
~Impl () | |
void | setOptions (Fetcher::Options options) |
Fetcher::Options | options () const |
void | addIndex (const OnMediaLocation &resource) |
void | enqueueDir (const OnMediaLocation &resource, bool recursive, const FileChecker &checker=FileChecker()) |
void | enqueueDigestedDir (const OnMediaLocation &resource, bool recursive, const FileChecker &checker=FileChecker()) |
void | enqueue (const OnMediaLocation &resource, const FileChecker &checker=FileChecker()) |
void | enqueueDigested (const OnMediaLocation &resource, const FileChecker &checker=FileChecker()) |
void | addCachePath (const Pathname &cache_dir) |
void | reset () |
void | start (const Pathname &dest_dir, MediaSetAccess &media, const ProgressData::ReceiverFnc &progress_receiver) |
Static Public Member Functions | |
static shared_ptr< Impl > | nullimpl () |
Offer default Impl. | |
Private Member Functions | |
void | downloadAndReadIndexList (MediaSetAccess &media, const Pathname &dest_dir) |
download the indexes and reads them | |
void | downloadIndex (MediaSetAccess &media, const OnMediaLocation &resource, const Pathname &dest_dir) |
download the indexes and reads them | |
void | readIndex (const Pathname &index, const Pathname &basedir) |
reads a downloaded index file and updates internal attributes table | |
void | readSha1sumsIndex (const Pathname &index, const Pathname &basedir) |
specific version of readIndex for SHA1SUMS file | |
void | readContentFileIndex (const Pathname &index, const Pathname &basedir) |
specific version of readIndex for SHA1SUMS file | |
void | getDirectoryContent (MediaSetAccess &media, const OnMediaLocation &resource, filesystem::DirContent &content) |
reads the content of a directory but keeps a cache | |
bool | provideFromCache (const OnMediaLocation &resource, const Pathname &dest_dir) |
tries to provide the file represented by job into dest_dir by looking at the cache. | |
void | validate (const OnMediaLocation &resource, const Pathname &dest_dir, const list< FileChecker > &checkers) |
Validates the job against is checkers, by using the file instance on dest_dir. | |
void | addDirJobs (MediaSetAccess &media, const OnMediaLocation &resource, const Pathname &dest_dir, FetcherJob::Flags flags) |
scan the directory and adds the individual jobs | |
void | autoaddIndexes (const filesystem::DirContent &content, MediaSetAccess &media, const OnMediaLocation &resource, const Pathname &dest_dir) |
auto discovery and reading of indexes | |
void | provideToDest (MediaSetAccess &media, const OnMediaLocation &resource, const Pathname &dest_dir) |
Provide the resource to dest_dir. | |
Impl * | clone () const |
clone for RWCOW_pointer | |
Private Attributes | |
list< FetcherJob_Ptr > | _resources |
std::set< FetcherIndex_Ptr, SameFetcherIndex > | _indexes |
std::set< Pathname > | _caches |
map< string, CheckSum > | _checksums |
map< string, filesystem::DirContent > | _dircontent |
Fetcher::Options | _options |
Friends | |
std::ostream & | operator<< (std::ostream &str, const Fetcher::Impl &obj) |
Impl * | rwcowClone (const Impl *rhs) |
Definition at line 126 of file Fetcher.cc.
zypp::Fetcher::Impl::Impl | ( | ) |
zypp::Fetcher::Impl::~Impl | ( | ) | [inline] |
Definition at line 133 of file Fetcher.cc.
void zypp::Fetcher::Impl::setOptions | ( | Fetcher::Options | options | ) |
Fetcher::Options zypp::Fetcher::Impl::options | ( | ) | const |
void zypp::Fetcher::Impl::addIndex | ( | const OnMediaLocation & | resource | ) |
void zypp::Fetcher::Impl::enqueueDir | ( | const OnMediaLocation & | resource, | |
bool | recursive, | |||
const FileChecker & | checker = FileChecker() | |||
) |
Definition at line 254 of file Fetcher.cc.
References _resources, zypp::FetcherJob::Directory, and zypp::FetcherJob::Recursive.
void zypp::Fetcher::Impl::enqueueDigestedDir | ( | const OnMediaLocation & | resource, | |
bool | recursive, | |||
const FileChecker & | checker = FileChecker() | |||
) |
Definition at line 269 of file Fetcher.cc.
References _resources, zypp::FetcherJob::AlwaysVerifyChecksum, zypp::FetcherJob::Directory, and zypp::FetcherJob::Recursive.
void zypp::Fetcher::Impl::enqueue | ( | const OnMediaLocation & | resource, | |
const FileChecker & | checker = FileChecker() | |||
) |
void zypp::Fetcher::Impl::enqueueDigested | ( | const OnMediaLocation & | resource, | |
const FileChecker & | checker = FileChecker() | |||
) |
Definition at line 235 of file Fetcher.cc.
References _resources, and zypp::FetcherJob::AlwaysVerifyChecksum.
Referenced by addDirJobs().
void zypp::Fetcher::Impl::addCachePath | ( | const Pathname & | cache_dir | ) |
void zypp::Fetcher::Impl::reset | ( | ) |
Definition at line 302 of file Fetcher.cc.
References _checksums, _dircontent, _indexes, and _resources.
void zypp::Fetcher::Impl::start | ( | const Pathname & | dest_dir, | |
MediaSetAccess & | media, | |||
const ProgressData::ReceiverFnc & | progress_receiver | |||
) |
Definition at line 741 of file Fetcher.cc.
References _checksums, _options, _resources, addDirJobs(), zypp::FetcherJob::AlwaysVerifyChecksum, zypp::Fetcher::AutoAddContentFileIndexes, autoaddIndexes(), zypp::Fetcher::AutoAddSha1sumsIndexes, zypp::FetcherJob::Directory, downloadAndReadIndexList(), getDirectoryContent(), MIL, provideToDest(), validate(), and ZYPP_THROW.
static shared_ptr<Impl> zypp::Fetcher::Impl::nullimpl | ( | ) | [inline, static] |
void zypp::Fetcher::Impl::downloadAndReadIndexList | ( | MediaSetAccess & | media, | |
const Pathname & | dest_dir | |||
) | [private] |
download the indexes and reads them
Definition at line 709 of file Fetcher.cc.
References _indexes, DBG, downloadIndex(), for_, MIL, and readIndex().
Referenced by autoaddIndexes(), and start().
void zypp::Fetcher::Impl::downloadIndex | ( | MediaSetAccess & | media, | |
const OnMediaLocation & | resource, | |||
const Pathname & | dest_dir | |||
) | [private] |
download the indexes and reads them
Definition at line 654 of file Fetcher.cc.
References zypp::OnMediaLocation::changeFilename(), zypp::Fetcher::enqueue(), zypp::OnMediaLocation::filename(), MIL, zypp::Fetcher::reset(), zypp::OnMediaLocation::setOptional(), zypp::Fetcher::start(), and WAR.
Referenced by downloadAndReadIndexList().
void zypp::Fetcher::Impl::readIndex | ( | const Pathname & | index, | |
const Pathname & | basedir | |||
) | [private] |
reads a downloaded index file and updates internal attributes table
The index lists files relative to a directory, which is normally the same as the index file is located.
Definition at line 609 of file Fetcher.cc.
References readContentFileIndex(), readSha1sumsIndex(), and WAR.
Referenced by downloadAndReadIndexList().
void zypp::Fetcher::Impl::readSha1sumsIndex | ( | const Pathname & | index, | |
const Pathname & | basedir | |||
) | [private] |
specific version of readIndex for SHA1SUMS file
Definition at line 633 of file Fetcher.cc.
References _checksums, zypp::iostr::getline(), zypp::CheckSum::sha1(), zypp::str::split(), and ZYPP_THROW.
Referenced by readIndex().
void zypp::Fetcher::Impl::readContentFileIndex | ( | const Pathname & | index, | |
const Pathname & | basedir | |||
) | [private] |
specific version of readIndex for SHA1SUMS file
Definition at line 620 of file Fetcher.cc.
References _checksums, zypp::ContentReaderHelper::_repoindex, zypp::str::asString(), for_, MIL, and zypp::parser::susetags::ContentFileReader::parse().
Referenced by readIndex().
void zypp::Fetcher::Impl::getDirectoryContent | ( | MediaSetAccess & | media, | |
const OnMediaLocation & | resource, | |||
filesystem::DirContent & | content | |||
) | [private] |
reads the content of a directory but keeps a cache
Definition at line 458 of file Fetcher.cc.
References _dircontent, zypp::iostr::copy(), zypp::MediaSetAccess::dirInfo(), zypp::OnMediaLocation::filename(), and zypp::OnMediaLocation::medianr().
Referenced by addDirJobs(), and start().
bool zypp::Fetcher::Impl::provideFromCache | ( | const OnMediaLocation & | resource, | |
const Pathname & | dest_dir | |||
) | [private] |
tries to provide the file represented by job into dest_dir by looking at the cache.
If success, returns true, and the desired file should be available on dest_dir
Definition at line 336 of file Fetcher.cc.
References _caches, zypp::filesystem::assert_dir(), zypp::OnMediaLocation::checksum(), DBG, zypp::CheckSum::empty(), ERR, zypp::OnMediaLocation::filename(), for_, zypp::filesystem::hardlinkCopy(), zypp::filesystem::is_checksum(), MIL, and ZYPP_THROW.
Referenced by provideToDest().
void zypp::Fetcher::Impl::validate | ( | const OnMediaLocation & | resource, | |
const Pathname & | dest_dir, | |||
const list< FileChecker > & | checkers | |||
) | [private] |
Validates the job against is checkers, by using the file instance on dest_dir.
Exception |
Definition at line 383 of file Fetcher.cc.
References ERR, zypp::OnMediaLocation::filename(), MIL, ZYPP_RETHROW, and ZYPP_THROW.
Referenced by start().
void zypp::Fetcher::Impl::addDirJobs | ( | MediaSetAccess & | media, | |
const OnMediaLocation & | resource, | |||
const Pathname & | dest_dir, | |||
FetcherJob::Flags | flags | |||
) | [private] |
scan the directory and adds the individual jobs
Definition at line 481 of file Fetcher.cc.
References _checksums, zypp::FetcherJob::AlwaysVerifyChecksum, autoaddIndexes(), zypp::OnMediaLocation::checksum(), enqueue(), enqueueDigested(), zypp::OnMediaLocation::filename(), zypp::filesystem::FT_DIR, zypp::filesystem::FT_FILE, zypp::filesystem::FT_NOT_AVAIL, getDirectoryContent(), zypp::str::hasPrefix(), zypp::OnMediaLocation::medianr(), MIL, zypp::FetcherJob::Recursive, and WAR.
Referenced by start().
void zypp::Fetcher::Impl::autoaddIndexes | ( | const filesystem::DirContent & | content, | |
MediaSetAccess & | media, | |||
const OnMediaLocation & | resource, | |||
const Pathname & | dest_dir | |||
) | [private] |
auto discovery and reading of indexes
Definition at line 421 of file Fetcher.cc.
References _options, addIndex(), zypp::Fetcher::AutoAddContentFileIndexes, zypp::Fetcher::AutoAddSha1sumsIndexes, zypp::OnMediaLocation::changeFilename(), downloadAndReadIndexList(), zypp::OnMediaLocation::filename(), zypp::filesystem::FT_FILE, zypp::filesystem::DirEntry::name, and zypp::filesystem::DirEntry::type.
Referenced by addDirJobs(), and start().
void zypp::Fetcher::Impl::provideToDest | ( | MediaSetAccess & | media, | |
const OnMediaLocation & | resource, | |||
const Pathname & | dest_dir | |||
) | [private] |
Provide the resource to dest_dir.
Definition at line 537 of file Fetcher.cc.
References zypp::filesystem::assert_dir(), ERR, zypp::OnMediaLocation::filename(), zypp::filesystem::hardlinkCopy(), MIL, zypp::Exception::msg(), zypp::OnMediaLocation::optional(), zypp::MediaSetAccess::PROVIDE_DEFAULT, zypp::MediaSetAccess::PROVIDE_NON_INTERACTIVE, zypp::MediaSetAccess::provideFile(), provideFromCache(), zypp::MediaSetAccess::releaseFile(), zypp::Exception::remember(), WAR, ZYPP_CAUGHT, ZYPP_RETHROW, and ZYPP_THROW.
Referenced by start().
Impl* zypp::Fetcher::Impl::clone | ( | ) | const [inline, private] |
std::ostream & operator<< | ( | std::ostream & | str, | |
const Fetcher::Impl & | obj | |||
) | [friend] |
Stream output
Definition at line 837 of file Fetcher.cc.
list<FetcherJob_Ptr> zypp::Fetcher::Impl::_resources [private] |
Definition at line 223 of file Fetcher.cc.
Referenced by enqueue(), enqueueDigested(), enqueueDigestedDir(), enqueueDir(), reset(), and start().
std::set<FetcherIndex_Ptr,SameFetcherIndex> zypp::Fetcher::Impl::_indexes [private] |
Definition at line 224 of file Fetcher.cc.
Referenced by addIndex(), downloadAndReadIndexList(), and reset().
std::set<Pathname> zypp::Fetcher::Impl::_caches [private] |
map<string, CheckSum> zypp::Fetcher::Impl::_checksums [private] |
Definition at line 227 of file Fetcher.cc.
Referenced by addDirJobs(), readContentFileIndex(), readSha1sumsIndex(), reset(), and start().
map<string, filesystem::DirContent> zypp::Fetcher::Impl::_dircontent [private] |
Fetcher::Options zypp::Fetcher::Impl::_options [private] |
Definition at line 231 of file Fetcher.cc.
Referenced by autoaddIndexes(), options(), setOptions(), and start().