diff options
author | Mark Hatle <mark.hatle@amd.com> | 2024-06-03 14:48:48 -0600 |
---|---|---|
committer | Mark Hatle <mark.hatle@amd.com> | 2024-06-12 15:31:04 -0600 |
commit | 0042565492d7b94abbdea33de3c3dff541a413bd (patch) | |
tree | 5452120e3cbccbf01957c6c07bd0fe55fe8c17d8 | |
parent | fff9b1d009c2a86d5cdadd1dd8832fd4e471de27 (diff) | |
download | meta-xilinx-0042565492d7b94abbdea33de3c3dff541a413bd.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>
(cherry picked from commit 72dee49d75cfbaa4184df3f91a8af6ad2b1f1ae8)
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
-rw-r--r-- | meta-xilinx-standalone-sdt/classes-recipe/esw.bbclass | 2 |
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) |