summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@amd.com>2024-06-03 14:48:48 -0600
committerMark Hatle <mark.hatle@amd.com>2024-06-03 14:48:56 -0600
commit82a7d0286dd5fdd4c624416347419baf3bdc82ff (patch)
treed1562a656ec81fa64d1a719804850b80e83d6860
parent955eaa968ab0ec0a4fc8d109f6eb0457844d6f00 (diff)
downloadmeta-xilinx-82a7d0286dd5fdd4c624416347419baf3bdc82ff.tar.gz
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 <mark.hatle@amd.com>
-rw-r--r--meta-xilinx-standalone-sdt/classes-recipe/esw.bbclass2
1 files changed, 1 insertions, 1 deletions
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() {
152 command = ["lopper"] + ["-f"] + [system_dt[0]] + ["--"] + ["baremetalconfig_xlnx.py"] + [machine] + [src_dir[0]] 152 command = ["lopper"] + ["-f"] + [system_dt[0]] + ["--"] + ["baremetalconfig_xlnx.py"] + [machine] + [src_dir[0]]
153 subprocess.run(command, check = True) 153 subprocess.run(command, check = True)
154 src_file = glob.glob('*_g.c') 154 src_file = glob.glob('*_g.c')
155 if os.path.exists(src_file[0]): 155 if src_file and os.path.exists(src_file[0]):
156 bb.note("Generated config file for driver %s" % driver_name) 156 bb.note("Generated config file for driver %s" % driver_name)
157 command = ["install"] + ["-m"] + ["0755"] + [src_file[0]] + [src_dir[0]] 157 command = ["install"] + ["-m"] + ["0755"] + [src_file[0]] + [src_dir[0]]
158 subprocess.run(command, check = True) 158 subprocess.run(command, check = True)