summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2023-06-16 12:52:07 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2023-06-18 12:52:44 +0200
commit5169ae99daf821ef820f1de635b8e93634ed061f (patch)
tree65c6f5cf2f905bca40236d7f030473a8c2360e97 /bin
parentc7cd02a9edeb34ae7bdc987ced6681a7bfe1e070 (diff)
downloadptxdist-5169ae99daf821ef820f1de635b8e93634ed061f.tar.gz
ptxdist-5169ae99daf821ef820f1de635b8e93634ed061f.tar.xz
add support for nested PTXdist execution
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ptxdist10
1 files changed, 8 insertions, 2 deletions
diff --git a/bin/ptxdist b/bin/ptxdist
index fbad28fca..5e731c6da 100755
--- a/bin/ptxdist
+++ b/bin/ptxdist
@@ -2211,10 +2211,11 @@ setup_env() {
whitelist="${*}"
whitelist="${whitelist:+|}${whitelist// /|}"
+ # Any change here should be done in ptxd_make_nested_ptxdist() as well
unset $({
export -p | sed -n 's/^declare -x \([^=]*\).*$/\1/p'
export -fp | sed -n 's/^declare -fx \([^=]*\).*$/\1/p'
- } | grep -E -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})$")
+ } | grep -E -v "^(PTXDIST_PTXRC|PTX_AUTOBUILD_DESTDIR|PTXDIST_PLATFORMDIR|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 ########
@@ -2496,7 +2497,7 @@ setup_platform_continue_with_broken_config()
# "*DIR" correct directory definitions
#
setup_platform() {
- local platform platform_version project project_version
+ local platform platform_version project project_version old_platformdir
# ptxd_get_ptxconf's return value is
platform="$(ptxd_get_ptxconf PTXCONF_PLATFORM)" || [ ${?} -eq 1 ] &&
@@ -2506,6 +2507,7 @@ setup_platform() {
# remove space and "(" ")"
project_version="${project_version//[ \(\)]/_}"
+ old_platformdir="${PTXDIST_PLATFORMDIR}"
if [ -n "${platform}" ]; then
PTXDIST_PLATFORMDIR="${PTXDIST_WORKSPACE}/platform-${platform}${platform_version}"
PTXDIST_PLATFORMSUFFIX=".${platform}"
@@ -2514,6 +2516,10 @@ setup_platform() {
PTXDIST_PLATFORMSUFFIX=""
fi
+ if [ "${old_platformdir}" = "${PTXDIST_PLATFORMDIR}" ]; then
+ ptxd_bailout "Nested PTXdist execution for the same platform is not allowed!"
+ fi
+
# reread vars with correct PTXDIST_PLATFORMDIR
source "${SCRIPTSDIR}/ptxdist_vars.sh" || return