libzypp  17.37.5
commitpackagepreloader.cc
Go to the documentation of this file.
5 #include <zypp/media/MediaCurl2.h> // for shared logic like authenticate
6 #include <zypp/media/MediaHandlerFactory.h> // to detect the URL type
10 #include <zypp-core/fs/TmpPath.h>
14 #include <zypp/MediaSetAccess.h>
15 #include <zypp/Package.h>
16 #include <zypp/SrcPackage.h>
17 #include <zypp/ZConfig.h>
18 #include <zypp/base/Env.h>
19 
20 namespace zypp {
21 
22  namespace {
23 
24  inline bool preloadEnabled()
25  {
26  TriBool envstate = env::getenvBool( "ZYPP_PCK_PRELOAD" );
27  if ( indeterminate(envstate) ) {
28 #if APIConfig(LIBZYPP_CONFIG_USE_SERIAL_PACKAGE_DOWNLOAD_BY_DEFAULT)
29  return false;
30 #else
31  return true;
32 #endif
33  }
34  return bool(envstate);
35  }
36 
37  zypp::Pathname pckCachedLocation ( const PoolItem &pck ) {
38  if ( pck.isKind<Package>() ) {
39  return pck->asKind<Package>()->cachedLocation();
40  } else if ( pck.isKind<SrcPackage>() ) {
41  return pck->asKind<SrcPackage>()->cachedLocation();
42  }
43  return {};
44  }
45 
46  }
47 
48  struct RepoUrl {
51  };
52 
54  public:
55  enum State {
58  //ZckHead,
59  //ZckData,
61  };
62 
64 
65  bool finished ( ) const {
66  return (_s == Finished);
67  }
68 
69  void nextJob () {
70 
71  // clean state vars
72  _started = false;
73  _firstAuth = true;
74  _notFoundRetry = 0;
75  _tmpFile.reset();
76  _lastByteCount = 0;
77  _taintedMirrors.clear();
78 
79  if ( _parent._requiredDls.empty() ) {
80 
81  if ( _myMirror ) {
82  _myMirror->refs--;
83  _myMirror = nullptr;
85  }
86 
87  MIL << "No more jobs pending, exiting worker" << std::endl;
88  // exit!
89  _s = Finished;
90  _sigFinished.emit();
91  return;
92  }
93 
94  _job = _parent._requiredDls.front();
95  _parent._requiredDls.pop_front();
96 
97  auto loc = _job.lookupLocation();
99 
100  // select a mirror we want to use
101  if ( !prepareMirror( ) ) {
102  finishCurrentJob ( _targetPath, {}, media::CommitPreloadReport::ERROR, asString( _("no mirror found") ), true );
103  return nextJob();
104  }
105 
106  if ( filesystem::assert_dir( _targetPath.dirname()) != 0 ) {
107  ERR << "Failed to create target dir for file: " << _targetPath << std::endl;
108  finishCurrentJob ( _targetPath, {}, media::CommitPreloadReport::ERROR, asString( _("could not create target file") ), true );
109  return nextJob();
110  }
111 
112 
113  media::TransferSettings settings;
114  zypp::Url url;
115  makeJobUrl ( url, settings );
116 
117  // check if the file is there already
118  {
119  PathInfo pathInfo(_targetPath);
120  if ( pathInfo.isExist() ) {
121  // just in case there is something else that is not a file we delete it
122  if ( !pathInfo.isFile() ) {
123  if ( pathInfo.isDir () )
125  else
127 
128  } else if ( is_checksum( _targetPath, loc.checksum() ) ) {
129  // if we have the file already, no need to download again
130  finishCurrentJob ( _targetPath, url, media::CommitPreloadReport::NO_ERROR, asString( _("already in cache") ), false );
131  return nextJob();
132 
133  } else {
134  // everything else we delete
136  }
137  }
138  }
139 
140  // we download into a temp file so that we don't leave broken files in case of errors or a crash
142 
143  if ( _s == Pending ) {
144  // init case, set up request
145  _req = std::make_shared<zyppng::NetworkRequest>( url, _tmpFile );
149  } else {
150  _req->resetRequestRanges();
151  _req->setUrl( url );
152  _req->setTargetFilePath( _tmpFile );
153  }
154 
155  // TODO check for zchunk
156 
157  _s = SimpleDl;
158  _req->transferSettings() = settings;
159  _parent._dispatcher->enqueue(_req);
160  }
161 
163  return _sigFinished;
164  }
165 
166  private:
167 
168  // TODO some smarter logic that selects mirrors
169  bool prepareMirror( ) {
170 
171  const auto &pi = _job;
172 
173  if ( _myMirror ) {
174  if ( _currentRepoId == pi.repository().id() ) {
175  return true;
176  }
178  _myMirror->refs--;
179  _myMirror = nullptr;
180  }
181 
183  if ( !_myMirror )
184  return false;
185 
186  _currentRepoId = pi.repository().id();
187  _myMirror->refs++;
188  return true;
189  }
190 
195 
196  if ( _myMirror ) {
197  _myMirror->miss++;
198  _taintedMirrors.insert( _myMirror );
199  }
200 
201  // try to find another mirror
202  auto mirrPtr = findUsableMirror ( _myMirror, false );
203  if ( mirrPtr ) {
204  if ( _myMirror ) {
205  _myMirror->refs--;
206  }
207  _myMirror = mirrPtr;
208  _myMirror->refs++;
209  return true;
210  }
211  return false;
212  }
213 
217  RepoUrl *findUsableMirror( RepoUrl *skip = nullptr, bool allowTainted = true ) {
218  auto &repoDlInfo = _parent._dlRepoInfo.at( _job.repository().id() );
219 
220  std::vector<RepoUrl>::iterator curr = repoDlInfo._baseUrls.end();
221  int currentSmallestRef = INT_MAX;
222 
223  for ( auto i = repoDlInfo._baseUrls.begin(); i != repoDlInfo._baseUrls.end(); i++ ) {
224  auto mirrorPtr = &(*i);
225 
226  if ( skip == mirrorPtr )
227  continue;
228 
229  if ( !allowTainted && _taintedMirrors.find(mirrorPtr) != _taintedMirrors.end() )
230  continue;
231 
232  // we are adding the file misses on top of the refcount
233  // that way we will use mirrors that often miss a file less
234  if ( ( i->refs + i->miss ) < currentSmallestRef ) {
235  currentSmallestRef = ( i->refs + i->miss );
236  curr = i;
237  }
238  }
239 
240  if ( curr == repoDlInfo._baseUrls.end() )
241  return nullptr;
242  return &(*curr);
243  }
244 
246  MIL << "Request for " << req.url() << " started" << std::endl;
247  }
248 
250  if ( !_started ) {
251  _started = true;
252 
253  callback::UserData userData( "CommitPreloadReport/fileStart" );
254  userData.set( "Url", _req->url() );
255  _parent._report->fileStart( _targetPath, userData );
256  }
257 
258  ByteCount downloaded;
259  if ( _lastByteCount == 0 )
260  downloaded = count;
261  else
262  downloaded = count - _lastByteCount;
263  _lastByteCount = count;
264 
265  _parent.reportBytesDownloaded( downloaded );
266  }
267 
269  MIL << "Request for " << req.url() << " finished. (" << err.toString() << ")" << std::endl;
270  if ( !req.hasError() ) {
271  // apply umask and move the _tmpFile into _targetPath
273  _tmpFile.resetDispose(); // rename consumed the file, no need to unlink.
275  } else {
276  // error
277  finishCurrentJob ( _targetPath, req.url(), media::CommitPreloadReport::ERROR, _("failed to rename temporary file."), true );
278  }
279  } else {
280  // handle errors and auth
281  const auto &error = req.error();
282  switch ( error.type() ) {
299  MIL << "Download from mirror failed for file " << req.url () << " trying to taint mirror and move on" << std::endl;
300 
301  if ( taintCurrentMirror() ) {
302  _notFoundRetry++;
303 
304  const auto str = zypp::str::Format(_("Error: \"%1%\", trying next mirror.")) % req.extendedErrorString();
306 
307  media::TransferSettings settings;
308  zypp::Url url;
309  makeJobUrl ( url, settings );
310 
311  MIL << "Found new mirror: " << url << " recovering, retry count: " << _notFoundRetry << std::endl;
312 
313  _req->setUrl( url );
314  _req->transferSettings () = settings;
315 
316  _parent._dispatcher->enqueue( _req );
317  return;
318  }
319 
321  break;
322  }
325 
326  //in case we got a auth hint from the server the error object will contain it
327  std::string authHint = error.extraInfoValue("authHint", std::string());
328 
331  if ( newCreds) {
332  _firstAuth = false;
333  _parent._dispatcher->enqueue( _req );
334  return;
335  }
336 
338  break;
339 
342  break;
343  }
345  // should never happen
346  DBG << "BUG: Download error flag is set , but Error code is NoError" << std::endl;
347  break;
348  }
349  }
350  nextJob();
351  }
352 
353  void finishCurrentJob( const zypp::Pathname &localPath, const std::optional<zypp::Url> &url, media::CommitPreloadReport::Error e, const std::optional<std::string> &errorMessage, bool fatal ) {
354 
355  callback::UserData userData( "CommitPreloadReport/fileDone" );
356  if ( url )
357  userData.set( "Url", *url );
358  if ( errorMessage )
359  userData.set( "description", *errorMessage );
360 
361  if ( e != media::CommitPreloadReport::NO_ERROR && fatal )
362  _parent._missedDownloads = true;
363 
364  _parent._report->fileDone( localPath, e, userData );
365  }
366 
367  void makeJobUrl ( zypp::Url &resultUrl, media::TransferSettings &resultSet ) {
368 
369  // rewrite Url
370  zypp::Url url = _myMirror->baseUrl;
371 
372  media::TransferSettings settings;
373  ::internal::prepareSettingsAndUrl ( url, settings );
374 
375  const auto &loc = _job.lookupLocation();
376 
377  // rewrite URL for media handle
378  if ( loc.medianr() > 1 )
379  url = MediaSetAccess::rewriteUrl( url ,loc.medianr() );
380 
381  // append path to file
382  url.appendPathName( loc.filename() );
383 
384  // add extra headers
385  for ( const auto & el : _myMirror->headers ) {
386  std::string header { el.first };
387  header += ": ";
388  header += el.second;
389  MIL << "Added custom header -> " << header << std::endl;
390  settings.addHeader( std::move(header) );
391  }
392 
393  resultUrl = url;
394  resultSet = settings;
395  }
396 
397  private:
400  zyppng::NetworkRequestRef _req;
401 
405  bool _started = false;
406  bool _firstAuth = true;
407  RepoUrl *_myMirror = nullptr;
410 
411  // retry handling
412  int _notFoundRetry = 0;
413  std::set<RepoUrl *> _taintedMirrors; //< mirrors that returned 404 for the current request
414 
416 
417  };
418 
420  {}
421 
422  void CommitPackagePreloader::preloadTransaction( const std::vector<sat::Transaction::Step> &steps)
423  {
424  if ( !preloadEnabled() ) {
425  MIL << "CommitPackagePreloader disabled" << std::endl;
426  return;
427  }
428 
429  // preload happens only if someone handles the report
430  if ( !_report->connected() ) {
431  MIL << "No receiver for the CommitPreloadReport, skipping preload phase" << std::endl;
432  return;
433  }
434 
435  auto ev = zyppng::EventLoop::create();
436  _dispatcher = std::make_shared<zyppng::NetworkRequestDispatcher>();
437  _dispatcher->setMaximumConcurrentConnections( MediaConfig::instance().download_max_concurrent_connections() );
438  _dispatcher->setAgentString ( str::asString( media::MediaCurl2::agentString () ) );
439  _dispatcher->setHostSpecificHeader ("download.opensuse.org", "X-ZYpp-DistributionFlavor", str::asString(media::MediaCurl2::distributionFlavorHeader()) );
440  _dispatcher->setHostSpecificHeader ("download.opensuse.org", "X-ZYpp-AnonymousId", str::asString(media::MediaCurl2::anonymousIdHeader()) );
441  _dispatcher->run();
442 
443  _pTracker = std::make_shared<internal::ProgressTracker>();
444  _requiredBytes = 0;
445  _downloadedBytes = 0;
446  _missedDownloads = false;
447  _lastProgressUpdate.reset();
448 
449  zypp_defer {
450  _dispatcher.reset();
451  _pTracker.reset();
452  };
453 
454  for ( const auto &step : steps ) {
455  switch ( step.stepType() )
456  {
459  // proceed: only install actions may require download.
460  break;
461 
462  default:
463  // next: no download for non-packages and delete actions.
464  continue;
465  break;
466  }
467 
468  PoolItem pi(step.satSolvable());
469 
470  if ( !pi->isKind<Package>() && !pi->isKind<SrcPackage>() )
471  continue;
472 
473  // no checksum ,no predownload, Fetcher would ignore it
474  if ( pi->lookupLocation().checksum().empty() )
475  continue;
476 
477  // check if Package is cached already
478  if( !pckCachedLocation(pi).empty() )
479  continue;
480 
481  auto repoDlsIter = _dlRepoInfo.find( pi.repository().id() );
482  if ( repoDlsIter == _dlRepoInfo.end() ) {
483 
484  // make sure download path for this repo exists
485  if ( filesystem::assert_dir( pi.repoInfo().predownloadPath() ) != 0 ) {
486  ERR << "Failed to create predownload cache for repo " << pi.repoInfo().alias() << std::endl;
487  return;
488  }
489 
490  // filter base URLs that do not download
491  std::vector<RepoUrl> repoUrls;
492  const auto bu = pi.repoInfo().effectiveBaseUrls();
493  std::for_each( bu.begin(), bu.end(), [&]( const zypp::Url &u ) {
495  Url url = media::UrlResolverPlugin::resolveUrl(u, custom_headers);
496 
498  return;
499 
500  // use geo IP if available
501  {
502  const auto rewriteUrl = media::MediaNetworkCommonHandler::findGeoIPRedirect( url );
503  if ( rewriteUrl.isValid () )
504  url = rewriteUrl;
505  }
506 
507  MIL << "Adding Url: " << url << " to the mirror set" << std::endl;
508 
509  repoUrls.push_back( RepoUrl {
510  .baseUrl = std::move(url),
511  .headers = std::move(custom_headers)
512  } );
513  });
514 
515  // skip this solvable if it has no downloading base URLs
516  if( repoUrls.empty() ) {
517  MIL << "Skipping predownload for " << step.satSolvable() << " no downloading URL" << std::endl;
518  continue;
519  }
520 
521  // TODO here we could block to fetch mirror informations, either if the RepoInfo has a metalink or mirrorlist entry
522  // or if the hostname of the repo is d.o.o
523  if ( repoUrls.begin()->baseUrl.getHost() == "download.opensuse.org" ){
524  //auto req = std::make_shared<zyppng::NetworkRequest>( );
525  }
526 
527  _dlRepoInfo.insert( std::make_pair(
528  pi.repository().id(),
530  ._baseUrls = std::move(repoUrls)
531  }
532  ));
533  }
534 
535 
536  _requiredBytes += pi.lookupLocation().downloadSize();
537  _requiredDls.push_back( pi );
538  }
539 
540  if ( _requiredDls.empty() )
541  return;
542 
543  // order by repo
544  std::sort( _requiredDls.begin(), _requiredDls.end(), []( const PoolItem &a , const PoolItem &b ) { return a.repository() < b.repository(); });
545 
546  const auto &workerDone = [&, this](){
547  if ( std::all_of( _workers.begin(), _workers.end(), []( const auto &w ) { return w->finished();} ) )
548  ev->quit();
549  };
550 
551  _report->start();
552  zypp_defer {
554  };
555 
556  MIL << "Downloading packages via " << MediaConfig::instance().download_max_concurrent_connections() << " connections." << std::endl;
557 
558  // we start a worker for each configured connection
559  for ( int i = 0; i < MediaConfig::instance().download_max_concurrent_connections() ; i++ ) {
560  // if we run out of jobs before we started all workers, stop
561  if (_requiredDls.empty())
562  break;
563  auto worker = std::make_shared<PreloadWorker>(*this);
564  worker->sigWorkerFinished().connect(workerDone);
565  worker->nextJob();
566  _workers.push_back( std::move(worker) );
567  }
568 
569  if( std::any_of( _workers.begin(), _workers.end(), []( const auto &w ) { return !w->finished(); } ) ) {
570  MIL << "Running preload event loop!" << std::endl;
571  ev->run();
572  }
573 
574  MIL << "Preloading done, mirror stats: " << std::endl;
575  for ( const auto &elem : _dlRepoInfo ) {
576  std::for_each ( elem.second._baseUrls.begin (), elem.second._baseUrls.end(), []( const RepoUrl &repoUrl ){
577  MIL << "url: " << repoUrl.baseUrl << " misses: " << repoUrl.miss << std::endl;
578  });
579  }
580  MIL << "Preloading done, mirror stats end" << std::endl;
581  }
582 
584  {
585  if ( !preloadEnabled() ) {
586  MIL << "CommitPackagePreloader disabled" << std::endl;
587  return;
588  }
589  std::for_each( _dlRepoInfo.begin (), _dlRepoInfo.end(), []( const auto &elem ){
591  });
592  }
593 
595  {
596  return _missedDownloads;
597  }
598 
600  {
601  // throttle progress updates to one time per second
602  const auto now = clock::now();
603  bool canUpdate = false;
604  if ( _lastProgressUpdate ) {
605  const auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(now - *_lastProgressUpdate);
606  canUpdate = (duration >= std::chrono::milliseconds(500));
607  } else {
608  canUpdate = true;
609  }
610 
611  _downloadedBytes += newBytes;
612  _pTracker->updateStats( _requiredBytes, _downloadedBytes );
613 
614  // update progress one time per second
615  if( canUpdate ) {
616  _lastProgressUpdate = now;
617  callback::UserData userData( "CommitPreloadReport/progress" );
618  userData.set( "dbps_avg" , static_cast<double>( _pTracker->_drateTotal ) );
619  userData.set( "dbps_current", static_cast<double>( _pTracker->_drateLast ) );
620  userData.set( "bytesReceived", static_cast<double>( _pTracker->_dnlNow ) );
621  userData.set( "bytesRequired", static_cast<double>( _pTracker->_dnlTotal ) );
622  if ( !_report->progress( _pTracker->_dnlPercent, userData ) ) {
623  _missedDownloads = true;
624  _requiredDls.clear();
625  _dispatcher->cancelAll( _("Cancelled by user."));
626  }
627  }
628  }
629 
630 }
std::string asString(const Patch::Category &obj)
Definition: Patch.cc:122
#define MIL
Definition: Logger.h:100
RepoUrl * findUsableMirror(RepoUrl *skip=nullptr, bool allowTainted=true)
Tries to find a usable mirror
boost::logic::tribool TriBool
3-state boolean logic (true, false and indeterminate).
Definition: String.h:31
void addHeader(std::string &&val_r)
add a header, on the form "Foo: Bar" (trims)
int assert_dir(const Pathname &path, unsigned mode)
Like &#39;mkdir -p&#39;.
Definition: PathInfo.cc:324
Pathname cachedLocation(const OnMediaLocation &loc_r, const RepoInfo &repo_r)
Definition: Package.cc:99
#define _(MSG)
Definition: Gettext.h:39
void onRequestStarted(zyppng::NetworkRequest &req)
[M] Install(multiversion) item (
Definition: Transaction.h:67
static ZConfig & instance()
Singleton ctor.
Definition: ZConfig.cc:940
int clean_dir(const Pathname &path)
Like &#39;rm -r DIR/ *&#39;.
Definition: PathInfo.cc:447
SignalProxy< void(NetworkRequest &req, zypp::ByteCount count)> sigBytesDownloaded()
Signals that new data has been downloaded, this is only the payload and does not include control data...
Definition: request.cc:1067
unsigned short b
void appendPathName(const Pathname &path_r, EEncoding eflag_r=zypp::url::E_DECODED)
Extend the path name.
Definition: Url.cc:804
void finishCurrentJob(const zypp::Pathname &localPath, const std::optional< zypp::Url > &url, media::CommitPreloadReport::Error e, const std::optional< std::string > &errorMessage, bool fatal)
void reset()
Reset to default Ctor values.
Definition: AutoDispose.h:150
Store and operate with byte count.
Definition: ByteCount.h:31
static Url resolveUrl(const Url &url, HeaderList &headers)
Resolves an url using the installed plugins If no plugin is found the url is resolved as its current ...
Holds transfer setting.
static const RepoIdType noRepoId(0)
Id to denote Repo::noRepository.
std::optional< clock::time_point > _lastProgressUpdate
std::string toString() const
toString Returns a string representation of the error
String related utilities and Regular expression matching.
media::UrlResolverPlugin::HeaderList headers
const std::string & asString(const std::string &t)
Global asString() that works with std::string too.
Definition: String.h:140
media::UrlResolverPlugin::HeaderList headers
zyppng::NetworkRequestDispatcherRef _dispatcher
static Url rewriteUrl(const Url &url_r, const media::MediaNr medianr)
Replaces media number in specified url with given medianr.
Convenient building of std::string with boost::format.
Definition: String.h:253
std::string basename() const
Return the last component of this path.
Definition: Pathname.h:130
bool authenticate(const Url &url, TransferSettings &settings, const std::string &availAuthTypes, bool firstTry)
TransferSettings & transferSettings()
Definition: request.cc:993
#define zypp_defer
Definition: AutoDispose.h:293
callback::SendReport< media::CommitPreloadReport > _report
void preloadTransaction(const std::vector< sat::Transaction::Step > &steps)
#define ERR
Definition: Logger.h:102
OnMediaLocation lookupLocation() const
Definition: SolvableType.h:160
bool hasError() const
Checks if there was a error with the request.
Definition: request.cc:1033
void prepareSettingsAndUrl(zypp::Url &url_r, zypp::media::TransferSettings &s)
Definition: curlhelper.cc:180
bool isKind(const Resolvable::constPtr &p)
Test whether a Resolvable::Ptr is of a certain Kind.
Definition: Resolvable.h:99
void onRequestFinished(zyppng::NetworkRequest &req, const zyppng::NetworkRequestError &err)
bool taintCurrentMirror()
Taints the current mirror, returns true if a alternative was found
WeakPtr parent() const
Definition: base.cc:26
void makeJobUrl(zypp::Url &resultUrl, media::TransferSettings &resultSet)
TriBool getenvBool(const C_Str &var_r)
If the environment variable var_r is set to a legal true or false string return bool, else indeterminate.
Definition: Env.h:32
bool set(const std::string &key_r, AnyType val_r)
Set the value for key (nonconst version always returns true).
Definition: UserData.h:119
zyppng::Ref< internal::ProgressTracker > _pTracker
bool isExist() const
Return whether valid stat info exists.
Definition: PathInfo.h:286
std::vector< zyppng::Ref< PreloadWorker > > _workers
Package interface.
Definition: Package.h:33
RepoInfo repoInfo() const
Definition: SolvableType.h:76
Pathname dirname() const
Return all but the last component od this path.
Definition: Pathname.h:126
long download_max_concurrent_connections() const
Definition: mediaconfig.cc:109
void onRequestProgress(zyppng::NetworkRequest &req, zypp::ByteCount count)
RepoInfo info() const
Return any associated RepoInfo.
Definition: Repository.cc:274
The NetworkRequestError class Represents a error that occured in.
static std::optional< MediaHandlerType > handlerType(const Url &url)
NetworkRequestError error() const
Returns the last set Error.
Definition: request.cc:1017
std::string extendedErrorString() const
In some cases, curl can provide extended error information collected at runtime.
Definition: request.cc:1025
sat::detail::RepoIdType IdType
Definition: Repository.h:44
std::map< Repository::IdType, RepoDownloadData > _dlRepoInfo
static Ptr create()
const Pathname & filename() const
The path to the resource on the medium.
int unlink(const Pathname &path)
Like &#39;unlink&#39;.
Definition: PathInfo.cc:705
void resetDispose()
Set no dispose function.
Definition: AutoDispose.h:171
Pathname predownloadPath() const
Path where this repo packages are predownloaded.
Definition: RepoInfo.cc:732
SrcPackage interface.
Definition: SrcPackage.h:29
bool any_of(const Container &c, Fnc &&cb)
Definition: Algorithm.h:76
Typesafe passing of user data via callbacks.
Definition: UserData.h:39
int chmodApplyUmask(const Pathname &path, mode_t mode)
Similar to &#39;chmod&#39;, but mode is modified by the process&#39;s umask in the usual way. ...
Definition: PathInfo.cc:1106
unsigned short a
std::multimap< std::string, std::string > HeaderList
Wrapper class for ::stat/::lstat.
Definition: PathInfo.h:225
void reportBytesDownloaded(ByteCount newBytes)
Combining sat::Solvable and ResStatus.
Definition: PoolItem.h:50
SignalProxy< void(NetworkRequest &req, const NetworkRequestError &err)> sigFinished()
Signals that the download finished.
Definition: request.cc:1077
SignalProxy< void(NetworkRequest &req)> sigStarted()
Signals that the dispatcher dequeued the request and actually starts downloading data.
Definition: request.cc:1062
int rename(const Pathname &oldpath, const Pathname &newpath)
Like &#39;rename&#39;.
Definition: PathInfo.cc:747
static zypp::Url findGeoIPRedirect(const zypp::Url &url)
Rewrites the baseURL to the geoIP target if one is found in the metadata cache, otherwise simply retu...
IdType id() const
Expert backdoor.
Definition: Repository.h:321
Easy-to use interface to the ZYPP dependency resolver.
Definition: Application.cc:19
int rmdir(const Pathname &path)
Like &#39;rmdir&#39;.
Definition: PathInfo.cc:371
Repository repository() const
Definition: SolvableType.h:75
Url manipulation class.
Definition: Url.h:92
static MediaConfig & instance()
Definition: mediaconfig.cc:46
#define DBG
Definition: Logger.h:99
bool is_checksum(const Pathname &file, const CheckSum &checksum)
check files checksum
Definition: PathInfo.cc:1068
static ManagedFile asManagedFile()
Create a temporary file and convert it to a automatically cleaned up ManagedFile. ...
Definition: TmpPath.cc:240