Slight cleanup

This commit is contained in:
Eelco Dolstra 2017-07-21 17:22:11 +02:00
parent dc5e0b120a
commit f46a21e16e
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE

View file

@ -238,13 +238,27 @@ struct Machine
bool supportsStep(Step::ptr step) bool supportsStep(Step::ptr step)
{ {
if (systemTypes.find(step->drv.platform) == systemTypes.end()) return false; /* Check that this machine is of the type required by the
step. */
if (!systemTypes.count(step->drv.platform)) return false;
/* Check that the step requires all mandatory features of this
machine. (Thus, a machine with the mandatory "benchmark"
feature will *only* execute steps that require
"benchmark".) The "preferLocalBuild" bit of a step is
mapped to the "local" feature; thus machines that have
"local" as a mandatory feature will only do
preferLocalBuild steps. */
for (auto & f : mandatoryFeatures) for (auto & f : mandatoryFeatures)
if (step->requiredSystemFeatures.find(f) == step->requiredSystemFeatures.end() if (!step->requiredSystemFeatures.count(f)
&& !(step->preferLocalBuild && f == "local")) && !(f == "local" && step->preferLocalBuild))
return false; return false;
/* Check that the machine supports all features required by
the step. */
for (auto & f : step->requiredSystemFeatures) for (auto & f : step->requiredSystemFeatures)
if (supportedFeatures.find(f) == supportedFeatures.end()) return false; if (!supportedFeatures.count(f)) return false;
return true; return true;
} }
}; };