aboutsummaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorGravatar Thomas Petazzoni <thomas.petazzoni@free-electrons.com>2017-10-29 18:14:36 +0100
committerGravatar Thomas Petazzoni <thomas.petazzoni@free-electrons.com>2017-11-27 23:20:04 +0100
commitc7abd1ddfbdbd7b4e4e426dce7c9d1c82fde1582 (patch)
tree142c4258319b9b1cdd679fe20d693707d8e7e8a8 /utils
parent1b8ad2d08e4ff95873e7c7e9d18860a69baa4b33 (diff)
downloadbuildroot-c7abd1ddfbdbd7b4e4e426dce7c9d1c82fde1582.tar.gz
buildroot-c7abd1ddfbdbd7b4e4e426dce7c9d1c82fde1582.tar.bz2
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 <thomas.petazzoni@free-electrons.com> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'utils')
-rwxr-xr-xutils/genrandconfig4
1 files changed, 3 insertions, 1 deletions
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()