init.sh: move PATH init to set_env

we must only set this in the parent instance, not
child instances. this prevents the variable from
being over-populated with repeated entries.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2025-05-18 11:25:35 +01:00
parent e05a18d351
commit 253aa81a3f
+5 -3
View File
@@ -12,11 +12,10 @@ projectsite="https://libreboot.org/"
[ -z "${PATH+x}" ] && \ [ -z "${PATH+x}" ] && \
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games" export PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
xbmkpath="$PATH"
eval "`setvars "" _nogit board reinstall versiondate aur_notice configdir \ eval "`setvars "" _nogit board reinstall versiondate aur_notice configdir \
datadir version xbmkpwd relname xbmkpwd xbmktmp python pyver xbmklocal \ datadir version xbmkpwd relname xbmkpwd xbmktmp python pyver xbmklocal \
xbmklock cvxbmk cvchk`" xbmklock cvxbmk cvchk xbmkpath`"
xbmk_init() xbmk_init()
{ {
@@ -123,6 +122,7 @@ xbmk_set_version()
xbmk_set_env() xbmk_set_env()
{ {
xbmkpath="$PATH"
export LOCALVERSION="-$projectname-${version%%-*}" export LOCALVERSION="-$projectname-${version%%-*}"
# XBMK_CACHE is a directory, for caching downloads and git repon # XBMK_CACHE is a directory, for caching downloads and git repon
@@ -157,6 +157,9 @@ xbmk_set_env()
export TMPDIR="/tmp" export TMPDIR="/tmp"
export TMPDIR="$(mktemp -d -t xbmk_XXXXXXXX)" export TMPDIR="$(mktemp -d -t xbmk_XXXXXXXX)"
xbmktmp="$TMPDIR" xbmktmp="$TMPDIR"
export PATH="$XBMK_CACHE/xbmkpath:$XBMK_CACHE/gnupath:$PATH"
xbmkpath="$PATH"
} }
xbmk_lock() xbmk_lock()
@@ -196,7 +199,6 @@ xbmk_create_tmpdir()
xbmk_create_pathdirs() xbmk_create_pathdirs()
{ {
remkdir "$XBMK_CACHE/gnupath" "$XBMK_CACHE/xbmkpath" remkdir "$XBMK_CACHE/gnupath" "$XBMK_CACHE/xbmkpath"
export PATH="$XBMK_CACHE/xbmkpath:$XBMK_CACHE/gnupath:$PATH"
( (
# set up python v3.x in PATH, in case it's not set up correctly. # set up python v3.x in PATH, in case it's not set up correctly.
# see code above that detected the correct python3 command. # see code above that detected the correct python3 command.