Skip to contentSkip to conversation

utils/getdeveloperlib.py: force foward-slash for pattern matching

PATCH Applied James Knight 3 participants 3 messages Sep 5, 2021 – Sep 14, 2021 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 utils/getdeveloperlib.py: force foward-slash for pattern matching

Force relative file path resolution of DEVELOPERS file entries to use forward-slash separators since pattern matching assumes forward slashes. This is to help permit uses invoking get-developers on Platforms where os.sep may not be a forward slash.

---
 utils/getdeveloperlib.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
utils/getdeveloperlib.py +4 -1
index b205817033d1d488c13e88f3b1bdbf82aa6b1224..fb8c7546d74f764468e6ffeb0d18b169aefb80d9 100644
@@ -249,7 +249,10 @@ def parse_developers():
                 if len(dev_files) == 0:
                     print("WARNING: '%s' doesn't match any file" % fname,
                           file=sys.stderr)
-                files += [os.path.relpath(f, brpath) for f in dev_files]
+                for f in dev_files:
+                    dev_file = os.path.relpath(f, brpath)
+                    dev_file = dev_file.replace(os.sep, '/')  # force unix sep
+                    files.append(dev_file)
             elif line == "":
                 if not name:
                     continue
Signature · 6 lines
2.28.0.windows.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw
Quoted 6 lines · James Knight

Force relative file path resolution of DEVELOPERS file entries to use forward-slash separators since pattern matching assumes forward slashes. This is to help permit uses invoking get-developers on Platforms where os.sep may not be a forward slash.

Applied to master, thanks.

Regards,
Arnout

Quoted 11 lines
---
 utils/getdeveloperlib.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
utils/getdeveloperlib.py +0 -0
index b205817033d1d488c13e88f3b1bdbf82aa6b1224..fb8c7546d74f764468e6ffeb0d18b169aefb80d9 100644
@@ -249,7 +249,10 @@ def parse_developers():
                 if len(dev_files) == 0:

utils/getdeveloperlib.py def parse_developers(): · line 258

Quoted 10 lines
utils/getdeveloperlib.py +4 -1
                     print("WARNING: '%s' doesn't match any file" % fname,
                           file=sys.stderr)
-                files += [os.path.relpath(f, brpath) for f in dev_files]
+                for f in dev_files:
+                    dev_file = os.path.relpath(f, brpath)
+                    dev_file = dev_file.replace(os.sep, '/')  # force unix sep
+                    files.append(dev_file)
             elif line == "":
                 if not name:
                     continue

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw
In reply to James Knight
Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"James" == James Knight <[email protected]> writes:

Force relative file path resolution of DEVELOPERS file entries to use forward-slash separators since pattern matching assumes forward slashes. This is to help permit uses invoking get-developers on Platforms where os.sep may not be a forward slash.

Committed to 2021.02.x, 2021.05.x and 2021.08.x, thanks.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot