From c7abd1ddfbdbd7b4e4e426dce7c9d1c82fde1582 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Sun, 29 Oct 2017 18:14:36 +0100 Subject: [PATCH] utils/genrandconfig: filter empty lines and comments in CSV file In preparation for the addition of comments in the CSV file listing toolchain configurations, we filter out such lines when reading the CSV file in utils/genrandconfig. Signed-off-by: Thomas Petazzoni Reviewed-by: "Yann E. MORIN" Signed-off-by: Thomas Petazzoni --- utils/genrandconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/genrandconfig b/utils/genrandconfig index a67d46fad9..883322552c 100755 --- a/utils/genrandconfig +++ b/utils/genrandconfig @@ -126,7 +126,9 @@ def get_toolchain_configs(toolchains_csv, buildrootdir): """ with open(toolchains_csv) as r: - toolchains = decode_byte_list(r.readlines()) + # filter empty lines and comments + lines = [ t for t in r.readlines() if len(t.strip()) > 0 and t[0] != '#' ] + toolchains = decode_byte_list(lines) configs = [] (_, _, _, _, hostarch) = os.uname() -- 2.30.2