summaryrefslogtreecommitdiffstats
path: root/pkgs/development/python-modules
diff options
context:
space:
mode:
authorFrederik Rietdijk <freddyrietdijk@fridh.nl>2016-05-10 12:22:48 +0200
committerFrederik Rietdijk <freddyrietdijk@fridh.nl>2016-05-10 12:22:48 +0200
commit1d487057e27943a86a486d0b1c4e4fb99b6b0042 (patch)
tree1877069d840d214bd63a6ccd1d91795deeba7b13 /pkgs/development/python-modules
parentea9070d43f2e5359f0dcca8d64f7a8dd494b1741 (diff)
parent97e4c19fcaa01fcc7f456f3896cbddccb25a6bb6 (diff)
Merge pull request #14900 from abbradar/python3-wrap
wrapPython: drop python suffixes
Diffstat (limited to 'pkgs/development/python-modules')
-rw-r--r--pkgs/development/python-modules/generic/wrap.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/pkgs/development/python-modules/generic/wrap.sh b/pkgs/development/python-modules/generic/wrap.sh
index fa6a4d0102f3..a67ea51f5a9b 100644
--- a/pkgs/development/python-modules/generic/wrap.sh
+++ b/pkgs/development/python-modules/generic/wrap.sh
@@ -28,8 +28,10 @@ wrapPythonProgramsIn() {
# Find all regular files in the output directory that are executable.
for f in $(find "$dir" -type f -perm -0100); do
# Rewrite "#! .../env python" to "#! /nix/store/.../python".
+ # Strip suffix, like "3" or "2.7m" -- we don't have any choice on which
+ # Python to use besides one in $python anyway.
if head -n1 "$f" | grep -q '#!.*/env.*\(python\|pypy\)'; then
- sed -i "$f" -e "1 s^.*/env[ ]*\(python\|pypy\)^#! $python^"
+ sed -i "$f" -e "1 s^.*/env[ ]*\(python\|pypy\)[^ ]*^#! $python^"
fi
# catch /python and /.python-wrapped