diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2018-12-01 21:07:39 -0500 |
---|---|---|
committer | Levente Polyak <anthraxx@archlinux.org> | 2019-08-09 19:41:51 +0200 |
commit | e76d56047719c88351492ace896c5899a6786e14 (patch) | |
tree | 4651fb3777f4cef8298c0de2abdea759d97c9eaa /mkarchroot.in | |
parent | 27ff286ee78eb2faac803e3ef67f3171ddfa0098 (diff) | |
download | devtools-e76d56047719c88351492ace896c5899a6786e14.tar.xz |
Revert "mkarchroot: Don't let the environment affect pacstrap (sans proxy settings)."
This reverts commit 578a62f1e0713b0df9722470146fb85fb819202c.
mkarchroot is run as root (via check_root if needed) so the environment
should already be clean. If not, the user has broken their root
environment, and we cannot support this. It's unclear what environment
settings may or may not be messing with anything, ever, but the original
bug report happened on Parabola who perform extensive patching to
"libretools" such that the code no longer resembles devtools at all.
It's therefore likely any such bug is parabola specific, but we will
never know since the original commit message states that they don't know
why they do it either.
Parsing the user's entire exported environment via both sed and grep is
overkill for a non-bug, especially when it doesn't work for variables
declared -rx and doesn't work for things like:
export fooled_you=$'wow such hax\ndeclare -x http_proxy=lol'
Also if done properly this would rely on compgen -e to print all
exported shell variables. Or even better, loop through /proc/$$/environ
which is both null-delimited and easily parsed with the read builtin and
[[ ]]
Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
Diffstat (limited to 'mkarchroot.in')
-rw-r--r-- | mkarchroot.in | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/mkarchroot.in b/mkarchroot.in index 7d97318..7da19dc 100644 --- a/mkarchroot.in +++ b/mkarchroot.in @@ -81,11 +81,6 @@ for file in "${files[@]}"; do cp "$file" "$working_dir$file" done -_env=() -while read -r varname; do - _env+=("$varname=${!varname}") -done < <(declare -x | sed -r 's/^declare -x ([^=]*)=.*/\1/' | grep -i '_proxy$') -env -i "${_env[@]}" \ pacstrap -Mcd ${pac_conf:+-C "$pac_conf"} "$working_dir" \ "${cache_dirs[@]/#/--cachedir=}" "$@" || die 'Failed to install all packages' |