mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [RFC 1/2] ptxdist: print a note when calling ptxdist inside 'ptxdist bash'
@ 2021-01-14 22:51 Roland Hieber
  2021-01-14 22:51 ` [ptxdist] [RFC 2/2] ptxd_lib_dgen: recompile when certain global kconfig options change Roland Hieber
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Roland Hieber @ 2021-01-14 22:51 UTC (permalink / raw)
  To: ptxdist; +Cc: Roland Hieber

For debugging purposes it might be useful to run ptxdist inside a
'ptxdist bash' session, but under normal conditions this will not work
out of the box. Mention the fact to prevent confusion and useless
debugging sessions:

    $ ptxdist
    FATAL didn't find /scripts/ptxdist_vars.sh
    Note: PTXdist was called inside 'ptxdist bash' – things may be broken.

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 bin/ptxdist | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/bin/ptxdist b/bin/ptxdist
index 0a252e4ab22e..da3adb134962 100755
--- a/bin/ptxdist
+++ b/bin/ptxdist
@@ -1695,6 +1695,7 @@ parse_second()
 . ~/.bashrc
 PS1="[ptx] \${PS1}"
 PATH="${PATH}"
+export INSIDE_PTXDIST_BASH=1
 alias ptxsudo='sudo env PATH=$PATH'
 EOF
 				"${BASH}" --init-file "${bashrc}"
@@ -2111,7 +2112,7 @@ setup_env() {
 	unset $({
 		export -p  | sed -n 's/^declare -x \([^=]*\).*$/\1/p'
 		export -fp | sed -n 's/^declare -fx \([^=]*\).*$/\1/p'
-		} | egrep -v "^(PTXDIST_PTXRC|PTX_AUTOBUILD_DESTDIR|CCACHE_.*|PWD|HOME|USER|PATH|TERM|COLUMNS|LINES|DISPLAY|TMPDIR|KCONFIG_ALLCONFIG|KCONFIG_SEED|http_proxy|https_proxy|ftp_proxy|no_proxy${whitelist})$")
+		} | egrep -v "^(INSIDE_PTXDIST_BASH|PTXDIST_PTXRC|PTX_AUTOBUILD_DESTDIR|CCACHE_.*|PWD|HOME|USER|PATH|TERM|COLUMNS|LINES|DISPLAY|TMPDIR|KCONFIG_ALLCONFIG|KCONFIG_SEED|http_proxy|https_proxy|ftp_proxy|no_proxy${whitelist})$")
 
 	######## the environment is clean now ########
 
@@ -2134,6 +2135,10 @@ ptxdist_trap_exit_handler() {
 	local retval="${?}"
 	local file
 
+	if [ -n "${INSIDE_PTXDIST_BASH}" ]; then
+		echo "Note: PTXdist was called inside 'ptxdist bash' – things may be broken." >/dev/tty
+	fi
+
 	if [ -n "${PTXDIST_TEMPDIR}" -a -d "${PTXDIST_TEMPDIR}" ]; then
 		rm -fr -- "${PTXDIST_TEMPDIR}"
 	fi
-- 
2.30.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

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

end of thread, other threads:[~2021-06-16 10:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-14 22:51 [ptxdist] [RFC 1/2] ptxdist: print a note when calling ptxdist inside 'ptxdist bash' Roland Hieber
2021-01-14 22:51 ` [ptxdist] [RFC 2/2] ptxd_lib_dgen: recompile when certain global kconfig options change Roland Hieber
2021-01-15  7:02   ` Michael Olbrich
2021-01-15 10:09     ` Roland Hieber
2021-01-15  6:35 ` [ptxdist] [RFC 1/2] ptxdist: print a note when calling ptxdist inside 'ptxdist bash' Michael Olbrich
2021-01-15  6:43   ` Michael Olbrich
2021-06-06 13:53 ` [ptxdist] [PATCH v1] " Roland Hieber
2021-06-16 10:35   ` [ptxdist] [APPLIED] " Michael Olbrich

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