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 <[email protected]>
---
 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 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() {
     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)
-- 
2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#5393): 
https://lists.yoctoproject.org/g/meta-xilinx/message/5393
Mute This Topic: https://lists.yoctoproject.org/mt/106609983/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-xilinx/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to