diff options
author | Mark Hatle <mark.hatle@amd.com> | 2024-06-03 14:48:48 -0600 |
---|---|---|
committer | Mark Hatle <mark.hatle@amd.com> | 2024-11-21 10:43:43 -0600 |
commit | 912d45e022120c284eb33fbcdd0db74b6fbed6c5 (patch) | |
tree | b2268722372b53ef03d9a892d5f7c97dfd279e9f | |
parent | db0793eef64482ae26d8d8296d666e6e9433fe58 (diff) | |
download | meta-xilinx-912d45e022120c284eb33fbcdd0db74b6fbed6c5.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.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 2751b751..ba453a75 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) |