Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] Revert "utils/get-developers: make it callable from elsewhere than the toplevel directory"
@ 2019-01-03 10:56 Peter Korsgaard
  2019-01-03 10:56 ` [Buildroot] [PATCH 2/2] utils/get-developers: really make it callable from elsewhere than the toplevel directory Peter Korsgaard
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Peter Korsgaard @ 2019-01-03 10:56 UTC (permalink / raw)
  To: buildroot

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 <peter@korsgaard.com>
---
 utils/get-developers     | 6 ++----
 utils/getdeveloperlib.py | 2 --
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/utils/get-developers b/utils/get-developers
index c887938859..ce882e6699 100755
--- a/utils/get-developers
+++ b/utils/get-developers
@@ -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)
 
diff --git a/utils/getdeveloperlib.py b/utils/getdeveloperlib.py
index 84665520c6..2c8d477583 100644
--- a/utils/getdeveloperlib.py
+++ b/utils/getdeveloperlib.py
@@ -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
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 2/2] utils/get-developers: really make it callable from elsewhere than the toplevel directory
  2019-01-03 10:56 [Buildroot] [PATCH 1/2] Revert "utils/get-developers: make it callable from elsewhere than the toplevel directory" Peter Korsgaard
@ 2019-01-03 10:56 ` Peter Korsgaard
  2019-01-04 12:24   ` Peter Korsgaard
  2019-01-24 10:59   ` Peter Korsgaard
  2019-01-04 12:24 ` [Buildroot] [PATCH 1/2] Revert "utils/get-developers: make it callable from elsewhere than the toplevel directory" Peter Korsgaard
  2019-01-24 10:59 ` Peter Korsgaard
  2 siblings, 2 replies; 6+ messages in thread
From: Peter Korsgaard @ 2019-01-03 10:56 UTC (permalink / raw)
  To: buildroot

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.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
 utils/get-developers | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/utils/get-developers b/utils/get-developers
index ce882e6699..750fc556dc 100755
--- a/utils/get-developers
+++ b/utils/get-developers
@@ -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)
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 1/2] Revert "utils/get-developers: make it callable from elsewhere than the toplevel directory"
  2019-01-03 10:56 [Buildroot] [PATCH 1/2] Revert "utils/get-developers: make it callable from elsewhere than the toplevel directory" Peter Korsgaard
  2019-01-03 10:56 ` [Buildroot] [PATCH 2/2] utils/get-developers: really make it callable from elsewhere than the toplevel directory Peter Korsgaard
@ 2019-01-04 12:24 ` Peter Korsgaard
  2019-01-24 10:59 ` Peter Korsgaard
  2 siblings, 0 replies; 6+ messages in thread
From: Peter Korsgaard @ 2019-01-04 12:24 UTC (permalink / raw)
  To: buildroot

>>>>> "Peter" == Peter Korsgaard <peter@korsgaard.com> 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 <peter@korsgaard.com>

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 2/2] utils/get-developers: really make it callable from elsewhere than the toplevel directory
  2019-01-03 10:56 ` [Buildroot] [PATCH 2/2] utils/get-developers: really make it callable from elsewhere than the toplevel directory Peter Korsgaard
@ 2019-01-04 12:24   ` Peter Korsgaard
  2019-01-24 10:59   ` Peter Korsgaard
  1 sibling, 0 replies; 6+ messages in thread
From: Peter Korsgaard @ 2019-01-04 12:24 UTC (permalink / raw)
  To: buildroot

>>>>> "Peter" == Peter Korsgaard <peter@korsgaard.com> 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.

 > 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 <peter@korsgaard.com>

Committed, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 1/2] Revert "utils/get-developers: make it callable from elsewhere than the toplevel directory"
  2019-01-03 10:56 [Buildroot] [PATCH 1/2] Revert "utils/get-developers: make it callable from elsewhere than the toplevel directory" Peter Korsgaard
  2019-01-03 10:56 ` [Buildroot] [PATCH 2/2] utils/get-developers: really make it callable from elsewhere than the toplevel directory Peter Korsgaard
  2019-01-04 12:24 ` [Buildroot] [PATCH 1/2] Revert "utils/get-developers: make it callable from elsewhere than the toplevel directory" Peter Korsgaard
@ 2019-01-24 10:59 ` Peter Korsgaard
  2 siblings, 0 replies; 6+ messages in thread
From: Peter Korsgaard @ 2019-01-24 10:59 UTC (permalink / raw)
  To: buildroot

>>>>> "Peter" == Peter Korsgaard <peter@korsgaard.com> 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 <peter@korsgaard.com>

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

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 2/2] utils/get-developers: really make it callable from elsewhere than the toplevel directory
  2019-01-03 10:56 ` [Buildroot] [PATCH 2/2] utils/get-developers: really make it callable from elsewhere than the toplevel directory Peter Korsgaard
  2019-01-04 12:24   ` Peter Korsgaard
@ 2019-01-24 10:59   ` Peter Korsgaard
  1 sibling, 0 replies; 6+ messages in thread
From: Peter Korsgaard @ 2019-01-24 10:59 UTC (permalink / raw)
  To: buildroot

>>>>> "Peter" == Peter Korsgaard <peter@korsgaard.com> 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.

 > 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 <peter@korsgaard.com>

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

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-01-24 10:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-03 10:56 [Buildroot] [PATCH 1/2] Revert "utils/get-developers: make it callable from elsewhere than the toplevel directory" Peter Korsgaard
2019-01-03 10:56 ` [Buildroot] [PATCH 2/2] utils/get-developers: really make it callable from elsewhere than the toplevel directory Peter Korsgaard
2019-01-04 12:24   ` Peter Korsgaard
2019-01-24 10:59   ` Peter Korsgaard
2019-01-04 12:24 ` [Buildroot] [PATCH 1/2] Revert "utils/get-developers: make it callable from elsewhere than the toplevel directory" Peter Korsgaard
2019-01-24 10:59 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox