Skip to contentSkip to conversation

utils/get-developers: make it callable from elsewhere than the toplevel directory

PATCH New Peter Korsgaard 2 participants 3 messages Oct 20, 2018 – Oct 21, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 utils/get-developers: make it callable from elsewhere than the toplevel directory

get-developers tries to open DEVELOPERS in the current directory, so it breaks when calling it from elsewhere than the toplevel Buildroot directory.

Traceback (most recent call last):
File "../utils/get-developers", line 107, in <module>

    __main__()

File "../utils/get-developers", line 26, in __main__
devs = getdeveloperlib.parse_developers(os.path.dirname()
File "/home/peko/source/buildroot/utils/getdeveloperlib.py", line 161, in parse_developers
with open(os.path.join(basepath, "DEVELOPERS"), "r") as f:
IOError: [Errno 2] No such file or directory: '/home/peko/source/buildroot/output-foo/DEVELOPERS'

Fix it by instead figuring out where the DEVELOPERS file is relative to the location of get-developers (E.G. one level up).

---
 utils/get-developers | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
utils/get-developers +3 -1
index ce882e6699..8725afb914 100755
@@ -24,7 +24,9 @@ def parse_args():
 
 
 def __main__():
-    devs = getdeveloperlib.parse_developers()
+    # DEVELOPERS is one level up from here
+    devs_dir = os.path.join(os.path.dirname(__file__), '..')
+    devs = getdeveloperlib.parse_developers(devs_dir)
     if devs is None:
         sys.exit(1)
     args = parse_args()
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/1 utils/get-developers: make it callable from elsewhere than the toplevel directory

Quoted 12 lines · Peter Korsgaard

get-developers tries to open DEVELOPERS in the current directory, so it breaks when calling it from elsewhere than the toplevel Buildroot directory.

Traceback (most recent call last):
File "../utils/get-developers", line 107, in <module>

    __main__()

File "../utils/get-developers", line 26, in __main__
devs = getdeveloperlib.parse_developers(os.path.dirname()
File "/home/peko/source/buildroot/utils/getdeveloperlib.py", line 161, in parse_developers
with open(os.path.join(basepath, "DEVELOPERS"), "r") as f:
IOError: [Errno 2] No such file or directory: '/home/peko/source/buildroot/output-foo/DEVELOPERS'

Quoted 4 lines

Fix it by instead figuring out where the DEVELOPERS file is relative to the location of get-developers (E.G. one level up).

Applied to master with a lot of changes :-), thanks.

Regards,
Arnout

Quoted 20 lines
---
 utils/get-developers | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
utils/get-developers +3 -1
index ce882e6699..8725afb914 100755
@@ -24,7 +24,9 @@ def parse_args():
 
 
 def __main__():
-    devs = getdeveloperlib.parse_developers()
+    # DEVELOPERS is one level up from here
+    devs_dir = os.path.join(os.path.dirname(__file__), '..')
+    devs = getdeveloperlib.parse_developers(devs_dir)
     if devs is None:
         sys.exit(1)
     args = parse_args()
#2 lore raw

PATCH 1/1 utils/get-developers: make it callable from elsewhere than the toplevel directory

In reply to Peter Korsgaard
Quoted 14 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Peter" == Peter Korsgaard <[email protected]> writes:

get-developers tries to open DEVELOPERS in the current directory, so it breaks when calling it from elsewhere than the toplevel Buildroot directory.

Traceback (most recent call last):
File "../utils/get-developers", line 107, in <module>

    __main__()

File "../utils/get-developers", line 26, in __main__
devs = getdeveloperlib.parse_developers(os.path.dirname()
File "/home/peko/source/buildroot/utils/getdeveloperlib.py", line 161, in parse_developers
with open(os.path.join(basepath, "DEVELOPERS"), "r") as f:
IOError: [Errno 2] No such file or directory: '/home/peko/source/buildroot/output-foo/DEVELOPERS'

Quoted 4 lines

Fix it by instead figuring out where the DEVELOPERS file is relative to the location of get-developers (E.G. one level up).

Committed to 2018.02.x and 2018.08.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard