case rpm::InstallResolvableReport::RETRY:
return rpm::RpmInstallReport::RETRY;
case rpm::InstallResolvableReport::ABORT:
+ _abort = true;
return rpm::RpmInstallReport::ABORT;
case rpm::InstallResolvableReport::IGNORE:
return rpm::RpmInstallReport::IGNORE;
void RpmRemovePackageReceiver::start( const std::string & name )
{
_report->start( _resolvable );
+ _abort = false;
}
/**
case rpm::RemoveResolvableReport::RETRY:
return rpm::RpmRemoveReport::RETRY;
case rpm::RemoveResolvableReport::ABORT:
+ _abort = true;
return rpm::RpmRemoveReport::ABORT;
case rpm::RemoveResolvableReport::IGNORE:
return rpm::RpmRemoveReport::IGNORE;
MIL << "Target loaded: " << system.solvablesSize() << " resolvables" << endl;
}
+ ///////////////////////////////////////////////////////////////////
+ //
+ // COMMIT
+ //
+ ///////////////////////////////////////////////////////////////////
ZYppCommitResult TargetImpl::commit( ResPool pool_r, const ZYppCommitPolicy & policy_rX )
{
// ----------------------------------------------------------------- //
///////////////////////////////////////////////////////////////////
// Remove/install packages.
///////////////////////////////////////////////////////////////////
- commit (to_uninstall, policy_r, pool_r );
+ commit ( to_uninstall, policy_r, pool_r );
if (policy_r.restrictToMedia() == 0)
{ // commit all
}
+ ///////////////////////////////////////////////////////////////////
+ //
+ // COMMIT internal
+ //
+ ///////////////////////////////////////////////////////////////////
TargetImpl::PoolItemList
TargetImpl::commit( const TargetImpl::PoolItemList & items_r,
const ZYppCommitPolicy & policy_r,
{
localfile = packageCache.get( it );
}
+ catch ( const AbortRequestException &e )
+ {
+ WAR << "commit aborted by the user" << endl;
+ abort = true;
+ break;
+ }
catch ( const SkipRequestException &e )
{
ZYPP_CAUGHT( e );
#warning Exception handling
// create a installation progress report proxy
RpmInstallPackageReceiver progress( it->resolvable() );
- progress.connect();
- bool success = true;
+ progress.connect(); // disconnected on destruction.
+
+ bool success = false;
rpm::RpmInstFlags flags;
// Why force and nodeps?
//
if ( progress.aborted() )
{
WAR << "commit aborted by the user" << endl;
- progress.disconnect();
- success = false;
abort = true;
break;
}
+ else
+ {
+ success = true;
+ }
}
- catch (Exception & excpt_r)
+ catch ( Exception & excpt_r )
{
ZYPP_CAUGHT(excpt_r);
if ( policy_r.dryRun() )
{
WAR << "dry run failed" << endl;
- progress.disconnect();
break;
}
// else
- WAR << "Install failed" << endl;
+ if ( progress.aborted() )
+ {
+ WAR << "commit aborted by the user" << endl;
+ abort = true;
+ }
+ else
+ {
+ WAR << "Install failed" << endl;
+ }
remaining.push_back( *it );
- progress.disconnect();
- success = false;
- break;
+ break; // stop
}
if ( success && !policy_r.dryRun() )
// Remember to check this package for presence of patch scripts.
successfullyInstalledPackages.push_back( it->satSolvable() );
}
- progress.disconnect();
}
else
{
- bool success = true;
-
RpmRemovePackageReceiver progress( it->resolvable() );
- progress.connect();
+ progress.connect(); // disconnected on destruction.
+
+ bool success = false;
rpm::RpmInstFlags flags( rpm::RPMINST_NODEPS );
if (policy_r.dryRun()) flags |= rpm::RPMINST_TEST;
try
if ( progress.aborted() )
{
WAR << "commit aborted by the user" << endl;
- progress.disconnect();
- success = false;
abort = true;
break;
}
+ else
+ {
+ success = true;
+ }
}
catch (Exception & excpt_r)
{
- WAR << "removal of " << p << " failed";
- success = false;
ZYPP_CAUGHT( excpt_r );
+ if ( progress.aborted() )
+ {
+ WAR << "commit aborted by the user" << endl;
+ abort = true;
+ break;
+ }
+ // else
+ WAR << "removal of " << p << " failed";
}
- if (success
- && !policy_r.dryRun())
+ if ( success && !policy_r.dryRun() )
{
it->status().resetTransact( ResStatus::USER );
}
- progress.disconnect();
}
}
else if ( ! policy_r.dryRun() ) // other resolvables (non-Package)