From: Thomas Petazzoni Date: Sun, 29 Oct 2017 17:14:36 +0000 (+0100) Subject: utils/genrandconfig: filter empty lines and comments in CSV file X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c7abd1ddfbdbd7b4e4e426dce7c9d1c82fde1582;p=buildroot.git 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 --- 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()