[rtems-lwip commit] lwip.py: Use ant_glob instead of os.walk()

Joel Sherrill joel at rtems.org
Thu Oct 27 20:56:55 UTC 2022


Module:    rtems-lwip
Branch:    master
Commit:    e02d02e2ce29379c2d4bfb15fbd5b101e9bd58e8
Changeset: http://git.rtems.org/rtems-lwip/commit/?id=e02d02e2ce29379c2d4bfb15fbd5b101e9bd58e8

Author:    Duc Doan <dtbpkmte at gmail.com>
Date:      Thu Oct 27 16:04:27 2022 -0500

lwip.py: Use ant_glob instead of os.walk()

Updates #4714

---

 lwip.py | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/lwip.py b/lwip.py
index 2b0c205..c11ed1f 100644
--- a/lwip.py
+++ b/lwip.py
@@ -110,15 +110,7 @@ def build(bld):
     source_files.extend(common_source_files)
 
     def walk_sources(path):
-        sources = []
-        for root, dirs, files in os.walk(path):
-            for name in files:
-                ext = os.path.splitext(name)[1]
-                src_root = os.path.split(root)
-                path = os.path.join(src_root[0], src_root[1])
-                if ext == '.c' or ext == '.S':
-                    sources.append(os.path.join(path, name))
-        return sources
+        return bld.path.ant_glob([path + '/**/*.c', path + '/**/*.S'])
 
     if arch == 'arm':
         # These files will not compile for BSPs other than TMS570



More information about the vc mailing list