Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Korsgaard <peter@korsgaard.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 2/2] utils/get-developers: really make it callable from elsewhere than the toplevel directory
Date: Thu,  3 Jan 2019 11:56:56 +0100	[thread overview]
Message-ID: <20190103105657.23751-2-peter@korsgaard.com> (raw)
In-Reply-To: <20190103105657.23751-1-peter@korsgaard.com>

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

  reply	other threads:[~2019-01-03 10:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2019-01-04 12:24   ` [Buildroot] [PATCH 2/2] utils/get-developers: really make it callable from elsewhere than the toplevel directory 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190103105657.23751-2-peter@korsgaard.com \
    --to=peter@korsgaard.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox