From a95d383ca40460cd7e55f720ba2a30f80c619ed3 Mon Sep 17 00:00:00 2001 From: Eric Fahlgren Date: Sat, 25 Jan 2025 14:05:40 -0800 Subject: [PATCH] owut: fix processing of device defaults Some device profiles specify the removal of subtarget default packages. We were ignoring this, resulting in the removed package being included, and also giving bad informational messages about the package. Fixes: https://github.com/efahl/owut/issues/30 Signed-off-by: Eric Fahlgren --- files/owut | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/files/owut b/files/owut index 56f8a9f..bfb0b84 100755 --- a/files/owut +++ b/files/owut @@ -893,7 +893,18 @@ function collect_defaults(board, device) // Use both board json for its defaults, then add the device-specific // defaults to make one big defaults list. - let defaults = [...board, ...device]; + let defaults = []; // Must filter out and device-specific removals. + for (let pkg in board) { + if (! ("-"+pkg in device)) { + push(defaults, pkg); + } + } + for (let pkg in device) { + if (! match(pkg, /^-/)) { + push(defaults, pkg); + } + } + for (let pkg in packages.non_upgradable) { if (! (pkg in defaults)) push(defaults, pkg); }