public function removeRootInstallerDescriptors(Expression $expr)
{
$this->assertInstallersLoaded();
$previousInstallers = $this->rootInstallerDescriptors;
$previousRootInstallers = $this->rootInstallerDescriptors;
try {
// Only remove root installers
foreach ($previousRootInstallers as $installer) {
if ($expr->evaluate($installer)) {
unset($this->installerDescriptors[$installer->getName()]);
unset($this->rootInstallerDescriptors[$installer->getName()]);
}
}
$this->persistInstallersData();
} catch (Exception $e) {
$this->installerDescriptors = $previousInstallers;
$this->rootInstallerDescriptors = $previousRootInstallers;
throw $e;
}
}