INVALID // th resolvable is invalid
};
+ // the level of RPM pushing
+ enum RpmLevel {
+ RPM,
+ RPM_NODEPS,
+ RPM_NODEPS_FORCE
+ };
+
virtual void start(
Resolvable::constPtr resolvable
) {}
virtual Action problem(
Resolvable::constPtr resolvable
, Error error
- , std::string description
+ , std::string description
+ , RpmLevel level
) { return ABORT; }
virtual void finish(
Resolvable::constPtr resolvable
, Error error
, std::string reason
+ , RpmLevel level
) {}
};
virtual Action problem(
Resolvable::Ptr resolvable
, Error error
- , std::string description
+ , std::string description
) { return ABORT; }
virtual void finish(
RpmInstallPackageReceiver::RpmInstallPackageReceiver (Resolvable::constPtr res)
: callback::ReceiveReport<rpm::RpmInstallReport> ()
, _resolvable (res)
+ , _level( target::rpm::InstallResolvableReport::RPM )
{
}
_report->problem( _resolvable
, rpm::InstallResolvableReport::INVALID
, excpt_r.msg()
+ , _level
);
switch (user) {
/** Finish operation in case of success */
void RpmInstallPackageReceiver::finish()
{
- _report->finish( _resolvable, rpm::InstallResolvableReport::NO_ERROR, std::string() );
+ _report->finish( _resolvable, rpm::InstallResolvableReport::NO_ERROR, std::string(), _level );
}
/** Finish operation in case of success */
void RpmInstallPackageReceiver::finish( Exception & excpt_r )
{
- _report->finish( _resolvable, rpm::InstallResolvableReport::INVALID, std::string() );
+ _report->finish( _resolvable, rpm::InstallResolvableReport::INVALID, std::string(), _level );
+ }
+
+ void RpmInstallPackageReceiver::tryLevel( target::rpm::InstallResolvableReport::RpmLevel level_r )
+ {
+ _level = level_r;
}
/////////////////////////////////////////////////////////////////
{
callback::SendReport <rpm::InstallResolvableReport> _report;
Resolvable::constPtr _resolvable;
+ target::rpm::InstallResolvableReport::RpmLevel _level;
public:
/** Start the operation */
virtual void start( const Pathname & name );
+
+ void tryLevel( target::rpm::InstallResolvableReport::RpmLevel level_r );
/**
* Inform about progress
progress.connect();
try {
+ progress.tryLevel( target::rpm::InstallResolvableReport::RPM );
+
rpm().installPackage(p->getPlainRpm(),
p->installOnly() ? rpm::RpmDb::RPMINST_NOUPGRADE : 0);
}
WAR << "Install failed, retrying with --nodeps" << endl;
try {
+ progress.tryLevel( target::rpm::InstallResolvableReport::RPM_NODEPS );
rpm().installPackage(p->getPlainRpm(),
p->installOnly() ? rpm::RpmDb::RPMINST_NOUPGRADE : rpm::RpmDb::RPMINST_NODEPS);
}
WAR << "Install failed again, retrying with --force --nodeps" << endl;
try {
+ progress.tryLevel( target::rpm::InstallResolvableReport::RPM_NODEPS_FORCE );
rpm().installPackage(p->getPlainRpm(),
p->installOnly() ? rpm::RpmDb::RPMINST_NOUPGRADE : (rpm::RpmDb::RPMINST_NODEPS|rpm::RpmDb::RPMINST_FORCE));
}