From 3149506963d9051b7fd022ad1be21c16392b5594 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Mon, 29 Jan 2018 11:46:52 +0100 Subject: [PATCH] depot_query: refined node structure This patch introduces the subnodes , , and to the node. All sessions that are expected from the depot appear within the node, which sets them nicely apart from sessions that may be required as runtime arguments. Note that the and nodes do not appear in the patch because the existing depot_deploy tool does not interpret this information (the pkg/test-fs_report runtime does not provide any service, and the timer session is provided as a common route). --- repos/gems/src/app/depot_query/main.cc | 58 +++++++++++---------- repos/os/recipes/pkg/test-fs_report/runtime | 14 ++--- 2 files changed, 38 insertions(+), 34 deletions(-) diff --git a/repos/gems/src/app/depot_query/main.cc b/repos/gems/src/app/depot_query/main.cc index 5b1fb0cb2..7e58ded97 100644 --- a/repos/gems/src/app/depot_query/main.cc +++ b/repos/gems/src/app/depot_query/main.cc @@ -380,42 +380,44 @@ void Depot_query::Main::_query_blueprint(Directory::Path const &pkg_path, Xml_ge Xml_node env_xml = _config.xml().has_sub_node("env") ? _config.xml().sub_node("env") : ""; - node.for_each_sub_node([&] (Xml_node node) { + node.for_each_sub_node("content", [&] (Xml_node content) { + content.for_each_sub_node([&] (Xml_node node) { - /* skip non-rom nodes */ - if (!node.has_type("rom")) - return; + /* skip non-rom nodes */ + if (!node.has_type("rom")) + return; - Rom_label const label = node.attribute_value("label", Rom_label()); + Rom_label const label = node.attribute_value("label", Rom_label()); - /* skip ROM that is provided by the environment */ - bool provided_by_env = false; - env_xml.for_each_sub_node("rom", [&] (Xml_node node) { - if (node.attribute_value("label", Rom_label()) == label) - provided_by_env = true; }); + /* skip ROM that is provided by the environment */ + bool provided_by_env = false; + env_xml.for_each_sub_node("rom", [&] (Xml_node node) { + if (node.attribute_value("label", Rom_label()) == label) + provided_by_env = true; }); - if (provided_by_env) { - xml.node("rom", [&] () { - xml.attribute("label", label); - xml.attribute("env", "yes"); - }); - return; - } + if (provided_by_env) { + xml.node("rom", [&] () { + xml.attribute("label", label); + xml.attribute("env", "yes"); + }); + return; + } - Archive::Path const rom_path = - _find_rom_in_pkg(pkg_path, label, Recursion_limit{8}); + Archive::Path const rom_path = + _find_rom_in_pkg(pkg_path, label, Recursion_limit{8}); - if (rom_path.valid()) { - xml.node("rom", [&] () { - xml.attribute("label", label); - xml.attribute("path", rom_path); - }); + if (rom_path.valid()) { + xml.node("rom", [&] () { + xml.attribute("label", label); + xml.attribute("path", rom_path); + }); - } else { + } else { - xml.node("missing_rom", [&] () { - xml.attribute("label", label); }); - } + xml.node("missing_rom", [&] () { + xml.attribute("label", label); }); + } + }); }); String<160> comment("\n\n\n"); diff --git a/repos/os/recipes/pkg/test-fs_report/runtime b/repos/os/recipes/pkg/test-fs_report/runtime index 38c72c8c8..a141a1019 100644 --- a/repos/os/recipes/pkg/test-fs_report/runtime +++ b/repos/os/recipes/pkg/test-fs_report/runtime @@ -1,12 +1,14 @@ - + - - - - - + + + + + + +