41 const Arch & arch_r )
const
131 std::string package_str =
_package->name() +
"-" +
_package->edition().asString();
140 ZYPP_THROW(SkipRequestException(
"User requested skip of corrupted file"));
143 ZYPP_THROW(AbortRequestException(
"User requested to abort"));
166 return shared_ptr<void>(
static_cast<void*
>(0),
167 bind( mem_fun_ref(
static_cast<void (shared_ptr<Report>::*)()
>(&shared_ptr<Report>::reset) ),
187 policy.
progressCB( bind( &Base::progressPackageDownload,
this, _1 ) );
189 return _access.provideFile( _package->repoInfo(), loc, policy );
197 RepoInfo info = _package->repoInfo();
206 if ( ! ret.
value().empty() )
212 MIL <<
"provided Package from cache " << _package <<
" at " << ret << endl;
217 MIL <<
"provide Package " << _package << endl;
221 report()->start( _package, url );
224 ret = doProvidePackage();
229 ERR <<
"Failed to provide Package " << _package << endl;
237 ERR <<
"Failed to provide Package " << _package << endl;
241 std::string package_str = _package->name() +
"-" + _package->edition().asString();
244 std::string detail_str(
str::form(
_(
"Failed to provide Package %s. Do you want to retry retrieval?"), package_str.c_str() ) );
253 ZYPP_THROW(SkipRequestException(
"User requested skip of corrupted file", excpt));
256 ZYPP_THROW(AbortRequestException(
"User requested to abort", excpt));
267 MIL <<
"provided Package " << _package <<
" at " << ret << endl;
287 virtual ManagedFile providePackageFromCache()
const;
296 bool progressDeltaDownload(
int value )
const
297 {
return report()->progressDeltaDownload( value ); }
299 void progressDeltaApply(
int value )
const
300 {
return report()->progressDeltaApply( value ); }
303 {
return _policy.queryInstalled( _package->name(), ed_r, _package->arch() ); }
309 RepoInfo info = _package->repoInfo();
311 PathInfo cachepath( info.
packagesPath() / loc.filename() );
313 if ( cachepath.isFile() && ! loc.checksum().empty() )
319 if ( cachechecksum == loc.
checksum() )
330 RepoInfo info = _package->repoInfo();
341 std::list<DeltaRpm> deltaRpms;
342 _deltas.deltaRpms( _package ).swap( deltaRpms );
346 for_( it, deltaRpms.begin(), deltaRpms.end())
348 DBG <<
"tryDelta " << *it << endl;
350 if ( ! ret->empty() )
357 return Base::doProvidePackage();
383 report()->finishDeltaDownload();
385 report()->startDeltaApply( delta );
388 report()->problemDeltaApply(
_(
"applydeltarpm check failed.") );
393 Pathname destination( _package->repoInfo().packagesPath() / _package->location().filename() );
398 report()->problemDeltaApply(
_(
"applydeltarpm failed.") );
401 report()->finishDeltaApply();
422 :
Base( access_r, package_r, deltas_r, policy_r )
428 return Base::providePackageFromCache();
433 return Base::doProvidePackage();
455 :
_pimpl(
Impl::factoryMake( access_r, package_r, deltas_r, policy_r ) )