2
1
Эх сурвалжийг харах

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>
Thomas Petazzoni 7 жил өмнө
parent
commit
c7abd1ddfb

+ 3 - 1
utils/genrandconfig

@@ -126,7 +126,9 @@ def get_toolchain_configs(toolchains_csv, buildrootdir):
     """
     """
 
 
     with open(toolchains_csv) as r:
     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 = []
     configs = []
 
 
     (_, _, _, _, hostarch) = os.uname()
     (_, _, _, _, hostarch) = os.uname()