diff --git a/conf/modules/module.dtd b/conf/modules/module.dtd index a7044bf731..368fce406a 100644 --- a/conf/modules/module.dtd +++ b/conf/modules/module.dtd @@ -92,6 +92,7 @@ name CDATA #REQUIRED | "module" -> let unselected = List.for_all (fun m -> m.file <> name) modules in if unselected && verbose then - begin Printf.printf "Info: module '%s' unloaded for target '%s'\n" name target; flush stdout end; + begin Printf.printf "Info: module '%s' unloaded for target '%s'\n" name target; flush stdout end + else begin + if verbose then + (* display possible unloading of settings when the module itself is loaded *) + List.iter (fun n -> + let tag = Xml.tag n + and targets = ExtXml.attrib_or_default n "target" "" in + let valid = test_targets target (Str.split (Str.regexp "|") targets) in + if tag = "settings" && not (targets = "") && not valid then + begin Printf.printf "Info: settings of module '%s' unloaded for target '%s'\n" name target; flush stdout end; + ) (Xml.children xml) + end; unselected | _ -> false with _ -> false diff --git a/sw/tools/generators/gen_settings.ml b/sw/tools/generators/gen_settings.ml index 3dfaafeeaf..59afbd8bf8 100644 --- a/sw/tools/generators/gen_settings.ml +++ b/sw/tools/generators/gen_settings.ml @@ -317,7 +317,15 @@ let join_xml_files = fun xml_files -> end else false ) (Xml.children xml) - then List.filter (fun t -> Xml.tag t = "settings") (Xml.children xml) + then + List.filter (fun t -> + (* filter xml nodes and keep them if: + * it is a settings node + * the current target is supported in the 'target' attribute + * if no 'target' attribute always keep it + *) + Xml.tag t = "settings" && supports_target target (ExtXml.attrib_or_default t "target" target) + ) (Xml.children xml) else [] end else begin