Revert "utils/get-developers: make it callable from elsewhere than the toplevel directory"
PATCH 1/2 Revert "utils/get-developers: make it callable from elsewhere than the toplevel directory"
This reverts commit 62d5558f76a790d1c1b3a1834f1736dc86b6e34f.
This actually does not work, as patches contain paths relative to the toplevel directory as well.
--- utils/get-developers | 6 ++---- utils/getdeveloperlib.py | 2 -- 2 files changed, 2 insertions(+), 6 deletions(-)
utils/get-developers +2 -4
@@ -24,9 +24,7 @@ def parse_args(): def __main__(): - # DEVELOPERS is one level up from here - devs_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..') - devs = getdeveloperlib.parse_developers(devs_dir) + devs = getdeveloperlib.parse_developers() if devs is None: sys.exit(1) args = parse_args()
@@ -52,7 +50,7 @@ def __main__(): # Handle the check action if args.check: - files = getdeveloperlib.check_developers(devs, devs_dir) + files = getdeveloperlib.check_developers(devs) for f in files: print(f)
utils/getdeveloperlib.py +0 -2
@@ -158,8 +158,6 @@ def parse_developers(basepath=None): linen = 0 if basepath is None: basepath = os.getcwd() - else: - basepath = os.path.abspath(basepath) with open(os.path.join(basepath, "DEVELOPERS"), "r") as f: files = [] name = None
Signature · 1 line
2.11.0
PATCH 2/2 utils/get-developers: really make it callable from elsewhere than the toplevel directory
Commit 62d5558f76a (utils/get-developers: make it callable from elsewhere than the toplevel directory) tried to fix this by passing in the toplevel directory when the DEVELOPERS file is parsed.
Unfortunately this is not enough, as E.G. also the paths listed in the patches are relative to the toplevel directory, causing it to not match the entries in the DEVELOPERS file.
In concept this can be fixed by also passing the toplevel directory to the Developers class, but the simplest solution is just to chdir to the toplevel Buildroot directory before calling any of the getdeveloperlib functions.
This does require us to finish parsing command line arguments (which opens the provided patch files) to not get into trouble with relative paths to patches before chdir'ing / initializing getdeveloperlib.
--- utils/get-developers | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
utils/get-developers +8 -3
@@ -24,9 +24,6 @@ def parse_args(): def __main__(): - devs = getdeveloperlib.parse_developers() - if devs is None: - sys.exit(1) args = parse_args() # Check that only one action is given
@@ -48,6 +45,14 @@ def __main__(): print("No action specified") return + # getdeveloperlib expects to be executed from the toplevel buildroot + # directory, which is one level up from this script + os.chdir(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..')) + + devs = getdeveloperlib.parse_developers() + if devs is None: + sys.exit(1) + # Handle the check action if args.check: files = getdeveloperlib.check_developers(devs)
Signature · 1 line
2.11.0
PATCH 1/2 Revert "utils/get-developers: make it callable from elsewhere than the toplevel directory"
In reply to Peter KorsgaardQuoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Peter" == Peter Korsgaard <[email protected]> writes:
This reverts commit
62d5558f76a790d1c1b3a1834f1736dc86b6e34f. This actually does not work, as patches contain paths relative to the toplevel directory as well.Signed-off-by Peter Korsgaard <[email protected]>
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 2/2 utils/get-developers: really make it callable from elsewhere than the toplevel directory
In reply to Peter KorsgaardQuoted 14 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Peter" == Peter Korsgaard <[email protected]> writes:
Commit
62d5558f76a(utils/get-developers: make it callable from elsewhere than the toplevel directory) tried to fix this by passing in the toplevel directory when the DEVELOPERS file is parsed.Unfortunately this is not enough, as E.G. also the paths listed in the patches are relative to the toplevel directory, causing it to not match the entries in the DEVELOPERS file.
In concept this can be fixed by also passing the toplevel directory to the Developers class, but the simplest solution is just to chdir to the toplevel Buildroot directory before calling any of the getdeveloperlib functions.
Quoted 5 lines
This does require us to finish parsing command line arguments (which opens the provided patch files) to not get into trouble with relative paths to patches before chdir'ing / initializing getdeveloperlib.
Signed-off-by Peter Korsgaard <[email protected]>
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 1/2 Revert "utils/get-developers: make it callable from elsewhere than the toplevel directory"
In reply to Peter KorsgaardQuoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Peter" == Peter Korsgaard <[email protected]> writes:
This reverts commit
62d5558f76a790d1c1b3a1834f1736dc86b6e34f. This actually does not work, as patches contain paths relative to the toplevel directory as well.Signed-off-by Peter Korsgaard <[email protected]>
Committed to 2018.02.x and 2018.11.x, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 2/2 utils/get-developers: really make it callable from elsewhere than the toplevel directory
In reply to Peter KorsgaardQuoted 14 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Peter" == Peter Korsgaard <[email protected]> writes:
Commit
62d5558f76a(utils/get-developers: make it callable from elsewhere than the toplevel directory) tried to fix this by passing in the toplevel directory when the DEVELOPERS file is parsed.Unfortunately this is not enough, as E.G. also the paths listed in the patches are relative to the toplevel directory, causing it to not match the entries in the DEVELOPERS file.
In concept this can be fixed by also passing the toplevel directory to the Developers class, but the simplest solution is just to chdir to the toplevel Buildroot directory before calling any of the getdeveloperlib functions.
Quoted 5 lines
This does require us to finish parsing command line arguments (which opens the provided patch files) to not get into trouble with relative paths to patches before chdir'ing / initializing getdeveloperlib.
Signed-off-by Peter Korsgaard <[email protected]>
Committed to 2018.02.x and 2018.11.x, thanks.
Signature · 1 line
Bye, Peter Korsgaard