depot_deploy: check ROMs as deploy precondition

This patch marks a child as incomplete if one of the ROM modules listed
in its blueprint is missing. This, in turn, triggers the update system
in Sculpt, which then tries to download the missing pieces.

Issue #4818
This commit is contained in:
Norman Feske 2023-04-19 17:26:50 +02:00 committed by Christian Helmuth
parent 1c160d2366
commit cec8a401ae
3 changed files with 21 additions and 3 deletions

View File

@ -186,6 +186,24 @@ class Depot_deploy::Child : public List_model<Child>::Element
if (pkg.attribute_value("path", Archive::Path()) != _blueprint_pkg_path)
return;
/* check for the completeness of all ROM ingredients */
bool any_rom_missing = false;
pkg.for_each_sub_node("missing_rom", [&] (Xml_node const &missing_rom) {
Name const name = missing_rom.attribute_value("label", Name());
/* ld.lib.so is special because it is provided by the base system */
if (name == "ld.lib.so")
return;
warning("missing ROM module '", name, "' needed by ", _blueprint_pkg_path);
any_rom_missing = true;
});
if (any_rom_missing) {
_pkg_incomplete = true;
return;
}
/* package was missing but is installed now */
_pkg_incomplete = false;
@ -276,7 +294,7 @@ class Depot_deploy::Child : public List_model<Child>::Element
bool blueprint_needed() const
{
if (_configured() || _pkg_incomplete)
if (_configured())
return false;
if (_defined_by_launcher() && !_launcher_xml.constructed())

View File

@ -134,7 +134,7 @@ void Sculpt::Deploy::handle_deploy()
error("spurious exception during deploy update (apply_blueprint)"); }
/* update query for blueprints of all unconfigured start nodes */
if (_children.any_blueprint_needed())
if (_children.any_blueprint_needed() && !_download_queue.any_active_download())
_depot_query.trigger_depot_query();
/* feed missing packages to installation queue */

View File

@ -419,7 +419,7 @@ struct Sculpt::Popup_dialog : Dialog
_blueprint_info = construction.blueprint_info;
if (_blueprint_info.ready_to_deploy())
if (_blueprint_info.ready_to_deploy() && _state == PKG_REQUESTED)
_state = PKG_SHOWN;
_refresh.refresh_popup_dialog();