Avoid exporting variables in build scripts

Environment variables "pollute" the build environment of packages and
can affect their output.

This change results in the removal of some files from packages that
were not meant to be packaged. It also removes the need for a
workaround in automake 1.10.3 to manually remove such files.

Variables are now saved in an .env file for each system and included
in scripts that need them using the dot operation.
This commit is contained in:
Dor Askayo 2022-09-16 10:34:07 +03:00
parent a74f3166f3
commit 3921660396
9 changed files with 45 additions and 24 deletions

View file

@ -7,9 +7,10 @@
set -e
export PATH=/usr/bin
export PREFIX=/usr
export SOURCES=/usr/src
PREFIX=/usr
SOURCES="${PREFIX}/src"
export PATH="${PREFIX}/bin"
# shellcheck source=sysa/helpers.sh
. /usr/src/helpers.sh
@ -34,5 +35,10 @@ install_tar kexec-tools-2.0.22 0
install_tar util-linux-2.19.1 0
# Begin sysb bootstrapping process
cd /usr/src
./run.sh
cd "${SOURCES}"
# shellcheck disable=SC2129
echo "PREFIX=${PREFIX}" >> .env
echo "SOURCES=${SOURCES}" >> .env
exec ./run.sh