From 82a7d0286dd5fdd4c624416347419baf3bdc82ff Mon Sep 17 00:00:00 2001 From: Mark Hatle Date: Mon, 3 Jun 2024 14:48:48 -0600 Subject: meta-xilinx-standalone-sdt: esw.bbclas: Avoid exception When the glob '*_g.c' does not exist in the source code an exception could occur. Avoid this by checking if any files were found before looking for the first file. Signed-off-by: Mark Hatle --- meta-xilinx-standalone-sdt/classes-recipe/esw.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-xilinx-standalone-sdt/classes-recipe/esw.bbclass b/meta-xilinx-standalone-sdt/classes-recipe/esw.bbclass index 921e2fe0..a87e1dad 100644 --- a/meta-xilinx-standalone-sdt/classes-recipe/esw.bbclass +++ b/meta-xilinx-standalone-sdt/classes-recipe/esw.bbclass @@ -152,7 +152,7 @@ python do_generate_driver_data() { command = ["lopper"] + ["-f"] + [system_dt[0]] + ["--"] + ["baremetalconfig_xlnx.py"] + [machine] + [src_dir[0]] subprocess.run(command, check = True) src_file = glob.glob('*_g.c') - if os.path.exists(src_file[0]): + if src_file and os.path.exists(src_file[0]): bb.note("Generated config file for driver %s" % driver_name) command = ["install"] + ["-m"] + ["0755"] + [src_file[0]] + [src_dir[0]] subprocess.run(command, check = True) -- cgit v1.2.3-54-g00ecf