All of lore.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kanas <kkanas@fastmail.com>
To: buildroot@buildroot.org
Cc: Krzysztof Kanas <kkanas@fastmail.com>
Subject: [Buildroot] [PATCH 1/1] package/environment-setup/environment-setup: add zsh
Date: Mon, 30 Aug 2021 22:13:08 +0200	[thread overview]
Message-ID: <20210830201308.143849-1-kkanas@fastmail.com> (raw)

environment-setup used BASH_SOURCE which is bash specific and empty
variable for zsh (and other shell's).
Use $0 which should be work across multiple shells(tcsh, dash, zsh)
It won't work if other script is sourcing environment-setup.

Signed-off-by: Krzysztof Kanas <kkanas@fastmail.com>
---
 package/environment-setup/environment-setup | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/package/environment-setup/environment-setup b/package/environment-setup/environment-setup
index e9bc36fdd093..2b54e88d6689 100644
--- a/package/environment-setup/environment-setup
+++ b/package/environment-setup/environment-setup
@@ -16,4 +16,8 @@ Some tips:
 * To build CMake-based projects, use the "cmake" alias
 
 EOF
-SDK_PATH=$(dirname $(realpath "${BASH_SOURCE[0]}"))
+if [ x"${BASH_SOURCE}" != x"" ]; then
+        SDK_PATH=$(dirname $(realpath "${BASH_SOURCE[0]}"))
+else
+	SDK_PATH=$(dirname $(realpath $0))
+fi
-- 
2.33.0

_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

             reply	other threads:[~2021-08-30 20:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-30 20:13 Krzysztof Kanas [this message]
2021-09-01 13:26 ` [Buildroot] [PATCH 1/1] package/environment-setup/environment-setup: add zsh Arnout Vandecappelle
2021-09-01 14:48   ` Krzysztof Kanas
2021-09-01 14:59     ` Arnout Vandecappelle
2021-09-01 16:04       ` Krzysztof Kanas
     [not found]         ` <20210902112848.41512-1-kkanas@fastmail.com>
2021-09-11 14:53           ` [Buildroot] [PATCH v2 " Arnout Vandecappelle
2021-09-13 13:38           ` 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=20210830201308.143849-1-kkanas@fastmail.com \
    --to=kkanas@fastmail.com \
    --cc=buildroot@buildroot.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.