firmware: duplicates stay in the config #1663

When we install "os-debug" it will deinstall "os-debug-devel" so
we should update our logic.
This commit is contained in:
Franco Fichtner 2019-11-12 08:59:52 +01:00
parent fba3861477
commit b1702d0c0a

View File

@ -90,6 +90,14 @@ class FirmwareController extends ApiControllerBase
switch ($action) {
case 'install':
case 'reinstall':
/* find the development/stable equivalent */
$other = preg_replace('/-devel$/', '', $name);
if ($other == $name) {
$other = "$name-devel";
}
if (isset($plugins[$other])) {
unset($plugins[$other]);
}
$plugins[$name] = 'hello';
break;
case 'remove':