libzypp  17.37.16
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();
98  const auto repoInfo = _job.repoInfo();
99 
100  _targetPath = repoInfo.predownloadPath();
101  if ( !repoInfo.path().emptyOrRoot () ) {
102  _targetPath /= repoInfo.path();
103  }
104  _targetPath /= loc.filename();
105 
106  // select a mirror we want to use
107  if ( !prepareMirror( ) ) {
108  finishCurrentJob ( _targetPath, {}, media::CommitPreloadReport::ERROR, asString( _("no mirror found") ), true );
109  return nextJob();
110  }
111 
112  if ( filesystem::assert_dir( _targetPath.dirname()) != 0 ) {
113  ERR << "Failed to create target dir for file: " << _targetPath << std::endl;
114  finishCurrentJob ( _targetPath, {}, media::CommitPreloadReport::ERROR, asString( _("could not create target file") ), true );
115  return nextJob();
116  }
117 
118 
119  media::TransferSettings settings;
120  zypp::Url url;
121  makeJobUrl ( url, settings );
122 
123  // check if the file is there already
124  {
125  PathInfo pathInfo(_targetPath);
126  if ( pathInfo.isExist() ) {
127  // just in case there is something else that is not a file we delete it
128  if ( !pathInfo.isFile() ) {
129  if ( pathInfo.isDir () )
131  else
133 
134  } else if ( is_checksum( _targetPath, loc.checksum() ) ) {
135  // if we have the file already, no need to download again
136  finishCurrentJob ( _targetPath, url, media::CommitPreloadReport::NO_ERROR, asString( _("already in cache") ), false );
137  return nextJob();
138 
139  } else {
140  // everything else we delete
142  }
143  }
144  }
145 
146  // we download into a temp file so that we don't leave broken files in case of errors or a crash
148 
149  if ( _s == Pending ) {
150  // init case, set up request
151  _req = std::make_shared<zyppng::NetworkRequest>( url, _tmpFile );
155  } else {
156  _req->resetRequestRanges();
157  _req->setUrl( url );
158  _req->setTargetFilePath( _tmpFile );
159  }
160 
161  // TODO check for zchunk
162 
163  _s = SimpleDl;
164  _req->transferSettings() = settings;
165  _parent._dispatcher->enqueue(_req);
166  }
167 
169  return _sigFinished;
170  }
171 
172  private:
173 
174  // TODO some smarter logic that selects mirrors
175  bool prepareMirror( ) {
176 
177  const auto &pi = _job;
178 
179  if ( _myMirror ) {
180  if ( _currentRepoId == pi.repository().id() ) {
181  return true;
182  }
184  _myMirror->refs--;
185  _myMirror = nullptr;
186  }
187 
189  if ( !_myMirror )
190  return false;
191 
192  _currentRepoId = pi.repository().id();
193  _myMirror->refs++;
194  return true;
195  }
196 
201 
202  if ( _myMirror ) {
203  _myMirror->miss++;
204  _taintedMirrors.insert( _myMirror );
205  }
206 
207  // try to find another mirror
208  auto mirrPtr = findUsableMirror ( _myMirror, false );
209  if ( mirrPtr ) {
210  if ( _myMirror ) {
211  _myMirror->refs--;
212  }
213  _myMirror = mirrPtr;
214  _myMirror->refs++;
215  return true;
216  }
217  return false;
218  }
219 
223  RepoUrl *findUsableMirror( RepoUrl *skip = nullptr, bool allowTainted = true ) {
224  auto &repoDlInfo = _parent._dlRepoInfo.at( _job.repository().id() );
225 
226  std::vector<RepoUrl>::iterator curr = repoDlInfo._baseUrls.end();
227  int currentSmallestRef = INT_MAX;
228 
229  for ( auto i = repoDlInfo._baseUrls.begin(); i != repoDlInfo._baseUrls.end(); i++ ) {
230  auto mirrorPtr = &(*i);
231 
232  if ( skip == mirrorPtr )
233  continue;
234 
235  if ( !allowTainted && _taintedMirrors.find(mirrorPtr) != _taintedMirrors.end() )
236  continue;
237 
238  // we are adding the file misses on top of the refcount
239  // that way we will use mirrors that often miss a file less
240  if ( ( i->refs + i->miss ) < currentSmallestRef ) {
241  currentSmallestRef = ( i->refs + i->miss );
242  curr = i;
243  }
244  }
245 
246  if ( curr == repoDlInfo._baseUrls.end() )
247  return nullptr;
248  return &(*curr);
249  }
250 
252  MIL << "Request for " << req.url() << " started" << std::endl;
253  }
254 
256  if ( !_started ) {
257  _started = true;
258 
259  callback::UserData userData( "CommitPreloadReport/fileStart" );
260  userData.set( "Url", _req->url() );
261  _parent._report->fileStart( _targetPath, userData );
262  }
263 
264  ByteCount downloaded;
265  if ( _lastByteCount == 0 )
266  downloaded = count;
267  else
268  downloaded = count - _lastByteCount;
269  _lastByteCount = count;
270 
271  _parent.reportBytesDownloaded( downloaded );
272  }
273 
275  MIL << "Request for " << req.url() << " finished. (" << err.toString() << ")" << std::endl;
276  if ( !req.hasError() ) {
277  // apply umask and move the _tmpFile into _targetPath
279  _tmpFile.resetDispose(); // rename consumed the file, no need to unlink.
281  } else {
282  // error
283  finishCurrentJob ( _targetPath, req.url(), media::CommitPreloadReport::ERROR, _("failed to rename temporary file."), true );
284  }
285  } else {
286  // handle errors and auth
287  const auto &error = req.error();
288  switch ( error.type() ) {
305  MIL << "Download from mirror failed for file " << req.url () << " trying to taint mirror and move on" << std::endl;
306 
307  if ( taintCurrentMirror() ) {
308  _notFoundRetry++;
309 
310  const auto str = zypp::str::Format(_("Error: \"%1%\", trying next mirror.")) % req.extendedErrorString();
312 
313  media::TransferSettings settings;
314  zypp::Url url;
315  makeJobUrl ( url, settings );
316 
317  MIL << "Found new mirror: " << url << " recovering, retry count: " << _notFoundRetry << std::endl;
318 
319  _req->setUrl( url );
320  _req->transferSettings () = settings;
321 
322  _parent._dispatcher->enqueue( _req );
323  return;
324  }
325 
327  break;
328  }
331 
332  //in case we got a auth hint from the server the error object will contain it
333  std::string authHint = error.extraInfoValue("authHint", std::string());
334 
337  if ( newCreds) {
338  _firstAuth = false;
339  _parent._dispatcher->enqueue( _req );
340  return;
341  }
342 
344  break;
345 
348  break;
349  }
351  // should never happen
352  DBG << "BUG: Download error flag is set , but Error code is NoError" << std::endl;
353  break;
354  }
355  }
356  nextJob();
357  }
358 
359  void finishCurrentJob( const zypp::Pathname &localPath, const std::optional<zypp::Url> &url, media::CommitPreloadReport::Error e, const std::optional<std::string> &errorMessage, bool fatal ) {
360 
361  callback::UserData userData( "CommitPreloadReport/fileDone" );
362  if ( url )
363  userData.set( "Url", *url );
364  if ( errorMessage )
365  userData.set( "description", *errorMessage );
366 
367  if ( e != media::CommitPreloadReport::NO_ERROR && fatal )
368  _parent._missedDownloads = true;
369 
370  _parent._report->fileDone( localPath, e, userData );
371  }
372 
373  void makeJobUrl ( zypp::Url &resultUrl, media::TransferSettings &resultSet ) {
374 
375  // rewrite Url
376  zypp::Url url = _myMirror->baseUrl;
377 
378  media::TransferSettings settings;
379  ::internal::prepareSettingsAndUrl ( url, settings );
380 
381  const auto &loc = _job.lookupLocation();
382 
383  // rewrite URL for media handle
384  if ( loc.medianr() > 1 )
385  url = MediaSetAccess::rewriteUrl( url ,loc.medianr() );
386 
387  // append path to file
388  url.appendPathName( loc.filename() );
389 
390  // add extra headers
391  for ( const auto & el : _myMirror->headers ) {
392  std::string header { el.first };
393  header += ": ";
394  header += el.second;
395  MIL << "Added custom header -> " << header << std::endl;
396  settings.addHeader( std::move(header) );
397  }
398 
399  resultUrl = url;
400  resultSet = settings;
401  }
402 
403  private:
406  zyppng::NetworkRequestRef _req;
407 
411  bool _started = false;
412  bool _firstAuth = true;
413  RepoUrl *_myMirror = nullptr;
416 
417  // retry handling
418  int _notFoundRetry = 0;
419  std::set<RepoUrl *> _taintedMirrors; //< mirrors that returned 404 for the current request
420 
422 
423  };
424 
426  {}
427 
428  void CommitPackagePreloader::preloadTransaction( const std::vector<sat::Transaction::Step> &steps)
429  {
430  if ( !preloadEnabled() ) {
431  MIL << "CommitPackagePreloader disabled" << std::endl;
432  return;
433  }
434 
435  // preload happens only if someone handles the report
436  if ( !_report->connected() ) {
437  MIL << "No receiver for the CommitPreloadReport, skipping preload phase" << std::endl;
438  return;
439  }
440 
441  auto ev = zyppng::EventLoop::create();
442  _dispatcher = std::make_shared<zyppng::NetworkRequestDispatcher>();
443  _dispatcher->setMaximumConcurrentConnections( MediaConfig::instance().download_max_concurrent_connections() );
444  _dispatcher->setAgentString ( str::asString( media::MediaCurl2::agentString () ) );
445  _dispatcher->setHostSpecificHeader ("download.opensuse.org", "X-ZYpp-DistributionFlavor", str::asString(media::MediaCurl2::distributionFlavorHeader()) );
446  _dispatcher->setHostSpecificHeader ("download.opensuse.org", "X-ZYpp-AnonymousId", str::asString(media::MediaCurl2::anonymousIdHeader()) );
447  _dispatcher->setHostSpecificHeader ("cdn.opensuse.org", "X-ZYpp-DistributionFlavor", str::asString(media::MediaCurl2::distributionFlavorHeader()) );
448  _dispatcher->setHostSpecificHeader ("cdn.opensuse.org", "X-ZYpp-AnonymousId", str::asString(media::MediaCurl2::anonymousIdHeader()) );
449  _dispatcher->run();
450 
451  _pTracker = std::make_shared<internal::ProgressTracker>();
452  _requiredBytes = 0;
453  _downloadedBytes = 0;
454  _missedDownloads = false;
455  _lastProgressUpdate.reset();
456 
457  zypp_defer {
458  _dispatcher.reset();
459  _pTracker.reset();
460  };
461 
462  for ( const auto &step : steps ) {
463  switch ( step.stepType() )
464  {
467  // proceed: only install actions may require download.
468  break;
469 
470  default:
471  // next: no download for non-packages and delete actions.
472  continue;
473  break;
474  }
475 
476  PoolItem pi(step.satSolvable());
477 
478  if ( !pi->isKind<Package>() && !pi->isKind<SrcPackage>() )
479  continue;
480 
481  // no checksum ,no predownload, Fetcher would ignore it
482  if ( pi->lookupLocation().checksum().empty() )
483  continue;
484 
485  // check if Package is cached already
486  if( !pckCachedLocation(pi).empty() )
487  continue;
488 
489  auto repoDlsIter = _dlRepoInfo.find( pi.repository().id() );
490  if ( repoDlsIter == _dlRepoInfo.end() ) {
491 
492  // make sure download path for this repo exists
493  if ( filesystem::assert_dir( pi.repoInfo().predownloadPath() ) != 0 ) {
494  ERR << "Failed to create predownload cache for repo " << pi.repoInfo().alias() << std::endl;
495  return;
496  }
497 
498  // filter base URLs that do not download
499  std::vector<RepoUrl> repoUrls;
500  const auto origins = pi.repoInfo().repoOrigins();
501  for ( const auto &origin: origins ) {
502  std::for_each( origin.begin(), origin.end(), [&]( const zypp::OriginEndpoint &u ) {
504  Url url = media::UrlResolverPlugin::resolveUrl(u.url(), custom_headers);
505 
507  return;
508 
509  // use geo IP if available
510  {
511  const auto rewriteUrl = media::MediaNetworkCommonHandler::findGeoIPRedirect( url );
512  if ( rewriteUrl.isValid () )
513  url = rewriteUrl;
514  }
515 
516  if ( !pi.repoInfo().path().emptyOrRoot() )
517  url.appendPathName( pi.repoInfo().path() );
518 
519  MIL << "Adding Url: " << url << " to the mirror set" << std::endl;
520 
521  repoUrls.push_back( RepoUrl {
522  .baseUrl = std::move(url),
523  .headers = std::move(custom_headers)
524  } );
525  });
526  }
527 
528  // skip this solvable if it has no downloading base URLs
529  if( repoUrls.empty() ) {
530  MIL << "Skipping predownload for " << step.satSolvable() << " no downloading URL" << std::endl;
531  continue;
532  }
533 
534  // TODO here we could block to fetch mirror informations, either if the RepoInfo has a metalink or mirrorlist entry
535  // or if the hostname of the repo is d.o.o
536  if ( repoUrls.begin()->baseUrl.getHost() == "download.opensuse.org" ){
537  //auto req = std::make_shared<zyppng::NetworkRequest>( );
538  }
539 
540  _dlRepoInfo.insert( std::make_pair(
541  pi.repository().id(),
543  ._baseUrls = std::move(repoUrls)
544  }
545  ));
546  }
547 
548 
549  _requiredBytes += pi.lookupLocation().downloadSize();
550  _requiredDls.push_back( pi );
551  }
552 
553  if ( _requiredDls.empty() )
554  return;
555 
556  // order by repo
557  std::sort( _requiredDls.begin(), _requiredDls.end(), []( const PoolItem &a , const PoolItem &b ) { return a.repository() < b.repository(); });
558 
559  const auto &workerDone = [&, this](){
560  if ( std::all_of( _workers.begin(), _workers.end(), []( const auto &w ) { return w->finished();} ) )
561  ev->quit();
562  };
563 
564  _report->start();
565  zypp_defer {
567  };
568 
569  MIL << "Downloading packages via " << MediaConfig::instance().download_max_concurrent_connections() << " connections." << std::endl;
570 
571  // we start a worker for each configured connection
572  for ( int i = 0; i < MediaConfig::instance().download_max_concurrent_connections() ; i++ ) {
573  // if we run out of jobs before we started all workers, stop
574  if (_requiredDls.empty())
575  break;
576  auto worker = std::make_shared<PreloadWorker>(*this);
577  worker->sigWorkerFinished().connect(workerDone);
578  worker->nextJob();
579  _workers.push_back( std::move(worker) );
580  }
581 
582  if( std::any_of( _workers.begin(), _workers.end(), []( const auto &w ) { return !w->finished(); } ) ) {
583  MIL << "Running preload event loop!" << std::endl;
584  ev->run();
585  }
586 
587  MIL << "Preloading done, mirror stats: " << std::endl;
588  for ( const auto &elem : _dlRepoInfo ) {
589  std::for_each ( elem.second._baseUrls.begin (), elem.second._baseUrls.end(), []( const RepoUrl &repoUrl ){
590  MIL << "url: " << repoUrl.baseUrl << " misses: " << repoUrl.miss << std::endl;
591  });
592  }
593  MIL << "Preloading done, mirror stats end" << std::endl;
594  }
595 
597  {
598  if ( !preloadEnabled() ) {
599  MIL << "CommitPackagePreloader disabled" << std::endl;
600  return;
601  }
602  std::for_each( _dlRepoInfo.begin (), _dlRepoInfo.end(), []( const auto &elem ){
604  });
605  }
606 
608  {
609  return _missedDownloads;
610  }
611 
613  {
614  // throttle progress updates to one time per second
615  const auto now = clock::now();
616  bool canUpdate = false;
617  if ( _lastProgressUpdate ) {
618  const auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(now - *_lastProgressUpdate);
619  canUpdate = (duration >= std::chrono::milliseconds(500));
620  } else {
621  canUpdate = true;
622  }
623 
624  _downloadedBytes += newBytes;
625  _pTracker->updateStats( _requiredBytes, _downloadedBytes );
626 
627  // update progress one time per second
628  if( canUpdate ) {
629  _lastProgressUpdate = now;
630  callback::UserData userData( "CommitPreloadReport/progress" );
631  userData.set( "dbps_avg" , static_cast<double>( _pTracker->_drateTotal ) );
632  userData.set( "dbps_current", static_cast<double>( _pTracker->_drateLast ) );
633  userData.set( "bytesReceived", static_cast<double>( _pTracker->_dnlNow ) );
634  userData.set( "bytesRequired", static_cast<double>( _pTracker->_dnlTotal ) );
635  if ( !_report->progress( _pTracker->_dnlPercent, userData ) ) {
636  _missedDownloads = true;
637  _requiredDls.clear();
638  _dispatcher->cancelAll( _("Cancelled by user."));
639  }
640  }
641  }
642 
643 }
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()
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:723
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
Represents a single, configurable network endpoint, combining a URL with specific access settings...
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