From 2f3396d1eb3bd77554c73facb2756ec3306bd661 Mon Sep 17 00:00:00 2001 From: Sven Roederer Date: Wed, 4 Mar 2020 23:31:43 +0100 Subject: [PATCH] scripts/target_config_lib.lua: add new function get_pkglist() it returns a table with all boards of a target and a list of packages for each board. --- scripts/target_config_lib.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/target_config_lib.lua b/scripts/target_config_lib.lua index 73e4ec15..eae5eb05 100644 --- a/scripts/target_config_lib.lua +++ b/scripts/target_config_lib.lua @@ -114,5 +114,20 @@ io.stderr:write(string.format("debug_a: %s\n", device_pkgs)) funcs.config_package(lib.config_m, pkg, "m") end + function get_pkglist() + local adevice_pkgs = {} + io.stderr:write(string.format("called target_config_lib.lua:get_pkglist()\n")) + for _, dev in ipairs(lib.devices) do + local profile = dev.options.profile or dev.name + local pkgs = devpkgs(dev) + io.stderr:write(string.format("get_pkglist().profile: %s\n", profile)) + io.stderr:write(string.format("get_pkglist().pkgs: %s\n", pkgs)) + table.insert(adevice_pkgs, {profile, pkgs}) + io.stderr:write(string.format("get_pkglist().length: %i\n", #adevice_pkgs)) + end + io.stderr:write(string.format("get_pkglist().length_final: %i\n", #adevice_pkgs)) + return adevice_pkgs + end + return lib end