From cec8a401aeda938d612f52b761d2378ae231deb4 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Wed, 19 Apr 2023 17:26:50 +0200 Subject: [PATCH] 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 --- repos/gems/src/app/depot_deploy/child.h | 20 ++++++++++++++++++- repos/gems/src/app/sculpt_manager/deploy.cc | 2 +- .../app/sculpt_manager/view/popup_dialog.h | 2 +- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/repos/gems/src/app/depot_deploy/child.h b/repos/gems/src/app/depot_deploy/child.h index 889a269aee..ee855cd432 100644 --- a/repos/gems/src/app/depot_deploy/child.h +++ b/repos/gems/src/app/depot_deploy/child.h @@ -186,6 +186,24 @@ class Depot_deploy::Child : public List_model::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::Element bool blueprint_needed() const { - if (_configured() || _pkg_incomplete) + if (_configured()) return false; if (_defined_by_launcher() && !_launcher_xml.constructed()) diff --git a/repos/gems/src/app/sculpt_manager/deploy.cc b/repos/gems/src/app/sculpt_manager/deploy.cc index 719618bcad..473d5ba1b8 100644 --- a/repos/gems/src/app/sculpt_manager/deploy.cc +++ b/repos/gems/src/app/sculpt_manager/deploy.cc @@ -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 */ diff --git a/repos/gems/src/app/sculpt_manager/view/popup_dialog.h b/repos/gems/src/app/sculpt_manager/view/popup_dialog.h index 1742d3acea..6628544293 100644 --- a/repos/gems/src/app/sculpt_manager/view/popup_dialog.h +++ b/repos/gems/src/app/sculpt_manager/view/popup_dialog.h @@ -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();