mirror of
https://github.com/fosslinux/live-bootstrap.git
synced 2026-03-10 21:35:24 +01:00
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:
parent
a74f3166f3
commit
3921660396
9 changed files with 45 additions and 24 deletions
|
|
@ -5,4 +5,6 @@
|
|||
|
||||
# Replace this hook if you wish to do more
|
||||
|
||||
. /usr/src/.env
|
||||
|
||||
exec env - PATH="${PREFIX}/bin" PS1="\w # " bash -i
|
||||
|
|
|
|||
21
sysc/init
21
sysc/init
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -8,6 +8,9 @@
|
|||
|
||||
set -e
|
||||
|
||||
# shellcheck source=/dev/null
|
||||
. .env
|
||||
|
||||
# shellcheck source=sysa/helpers.sh
|
||||
. helpers.sh
|
||||
|
||||
|
|
@ -55,4 +58,4 @@ fi
|
|||
|
||||
build bash-5.1
|
||||
|
||||
exec env -i PATH="${PATH}" PREFIX="${PREFIX}" SOURCES="${SOURCES}" DESTDIR="${DESTDIR}" DISTFILES="${DISTFILES}" SRCDIR="${SRCDIR}" HOME="${HOME}" SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH}" bash run2.sh
|
||||
exec env -i PATH="${PATH}" HOME="${HOME}" SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH}" bash run2.sh
|
||||
|
|
|
|||
|
|
@ -9,6 +9,9 @@
|
|||
|
||||
set -e
|
||||
|
||||
# shellcheck source=/dev/null
|
||||
. .env
|
||||
|
||||
# shellcheck disable=SC2153
|
||||
trap 'env - PATH=${PREFIX}/bin PS1="\w # " bash -i' EXIT
|
||||
|
||||
|
|
@ -140,4 +143,4 @@ fi
|
|||
echo "Bootstrapping completed."
|
||||
|
||||
cd "/"
|
||||
exec env -i PATH="${PATH}" PREFIX="${PREFIX}" SOURCES="${SOURCES}" DESTDIR="${DESTDIR}" DISTFILES="${DISTFILES}" HOME="${HOME}" SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH}" bash "${SOURCES}/after.sh"
|
||||
exec env -i PATH="${PATH}" HOME="${HOME}" SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH}" bash "${SOURCES}/after.sh"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue