Merge pull request #27799 from FRidh/nosite

Python: disable user site-packages for programs and environments.
This commit is contained in:
Frederik Rietdijk 2017-08-01 11:08:26 +02:00 committed by GitHub
commit 6341cc9101
2 changed files with 4 additions and 2 deletions

View File

@ -66,7 +66,9 @@ wrapPythonProgramsIn() {
# above. The script will set PYTHONPATH and PATH variables.!
# (see pkgs/build-support/setup-hooks/make-wrapper.sh)
local -a wrap_args=("$f"
--prefix PATH ':' "$program_PATH")
--prefix PATH ':' "$program_PATH"
--set PYTHONNOUSERSITE "true"
)
# Add any additional arguments provided by makeWrapperArgs
# argument to buildPythonPackage.

View File

@ -29,7 +29,7 @@ let
for prg in *; do
if [ -f "$prg" ]; then
rm -f "$out/bin/$prg"
makeWrapper "$path/bin/$prg" "$out/bin/$prg" --set PYTHONHOME "$out"
makeWrapper "$path/bin/$prg" "$out/bin/$prg" --set PYTHONHOME "$out" --set PYTHONNOUSERSITE "true"
fi
done
fi