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,12 +7,13 @@
set -e
export PATH=/usr/bin:/usr/sbin
export PREFIX=/usr
export SOURCES=/usr/src
export DESTDIR=/tmp/destdir
export DISTFILES=/distfiles
export SRCDIR="${SOURCES}"
PREFIX=/usr
SOURCES="${PREFIX}/src"
DESTDIR=/tmp/destdir
DISTFILES=/distfiles
SRCDIR="${SOURCES}"
export PATH="${PREFIX}/bin:${PREFIX}/sbin"
export HOME=/tmp
export SOURCE_DATE_EPOCH=0
@ -61,4 +62,12 @@ ln -s /usr/bin/bash /usr/bin/sh
# Begin sysc bootstrapping process
cd "${SOURCES}"
# shellcheck disable=SC2129
echo "PREFIX=${PREFIX}" >> .env
echo "SOURCES=${SOURCES}" >> .env
echo "DESTDIR=${DESTDIR}" >> .env
echo "DISTFILES=${DISTFILES}" >> .env
echo "SRCDIR=${SRCDIR}" >> .env
exec ./run.sh