32 : repo::
Downloader(repoinfo), _delta_dir(delta_dir)
67 Pathname inputfile( dest_dir / masterIndex );
70 content.
parse( inputfile );
83 WAR <<
"No signing keys defined." << endl;
90 std::map<std::string,RepoIndex::FileChecksumMap::const_iterator> availablePackageTranslations;
97 static const str::regex rx_packages(
"^packages((.gz)?|(.([^.]*))(.gz)?)$" );
105 else if ( what[4] ==
"FL" )
110 availablePackageTranslations[what[4]] = it;
117 else if ( it->first ==
"patterns.pat" 118 || it->first ==
"patterns.pat.gz" )
132 std::vector<std::string> patparts;
133 unsigned archpos = 2;
135 unsigned count =
str::split( it->first, std::back_inserter(patparts),
"." );
136 if ( patparts[count-1] ==
"gz" )
139 if ( count > archpos )
143 Arch patarch( patparts[count-archpos] );
147 MIL <<
"Discarding pattern " << it->first << endl;
153 WAR <<
"Pattern file name does not contain recognizable architecture: " << it->first << endl;
158 MIL <<
"adding job " << it->first << endl;
166 auto fnc_checkTransaltions( [&](
const Locale & locale_r ) {
169 auto it( availablePackageTranslations.find( toGet.code() ) );
170 if ( it != availablePackageTranslations.end() )
172 auto mit( it->second );
173 MIL <<
"adding job " << mit->first << endl;
183 fnc_checkTransaltions( it );
191 if ( it->first !=
"license.tar.gz" )
194 MIL <<
"adding job " << it->first << endl;
202 MIL <<
"adding job " << it->first << endl;
208 start( dest_dir, media );
213 MIL <<
"Consuming repo index" << endl;
void defaultDownloadMasterIndex(MediaSetAccess &media_r, const Pathname &destdir_r, const Pathname &masterIndex_r)
Common workflow downloading a (signed) master index file.
std::string asString(const DefaultIntegral< Tp, TInitial > &obj)
#define ZYPP_THROW(EXCPT)
Drops a logline and throws the Exception.
static ZConfig & instance()
Singleton ctor.
Locale fallback() const
Return the fallback locale for this locale, if no fallback exists the empty Locale::noCode.
void downloadMediaInfo(const Pathname &dest_dir, MediaSetAccess &media, const ProgressData::ReceiverFnc &progressrcv)
Downloads the media info (/media.1) to a local directory.
What is known about a repository.
unsigned split(const C_Str &line_r, TOutputIterator result_r, const C_Str &sepchars_r=" \)
Split line_r into words.
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
std::string basename() const
Return the last component of this path.
function< bool(const ProgressData &)> ReceiverFnc
Most simple version of progress reporting The percentage in most cases.
bool compatibleWith(const Arch &targetArch_r) const
Compatibility relation.
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.
LocaleSet repoRefreshLocales() const
List of locales for which translated package descriptions should be downloaded.
bool isExist() const
Return whether valid stat info exists.
Parse repoindex part from a content file.
const RepoInfo & repoInfo() const
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...
void setRepoIndexConsumer(const RepoIndexConsumer &fnc_r)
Consumer to call when repo index was parsed.
bool endsWith(const C_Str &str_r, const C_Str &prefix_r)
alias for hasSuffix
'Language[_Country]' codes.
Regular expression match result.
Base class for Exception.
Wrapper class for ::stat/::lstat.
Arch systemArchitecture() const
The system architecture zypp uses.
bool regex_match(const std::string &s, smatch &matches, const regex ®ex)
regex ZYPP_STR_REGEX regex ZYPP_STR_REGEX
Track changing files or directories.
function< void(const Pathname &file)> FileChecker
Functor signature used to check files.
Easy-to use interface to the ZYPP dependency resolver.
bool hasPrefix(const C_Str &str_r, const C_Str &prefix_r)
Return whether str_r has prefix prefix_r.
virtual void parse(const InputStream &imput_r, const ProgressData::ReceiverFnc &fnc_r=ProgressData::ReceiverFnc())
Parse the stream.