commit:     2d8d447f040148e4374a00c9fca323e537a92cd1
Author:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 25 09:58:19 2019 +0000
Commit:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
CommitDate: Mon Feb 25 09:58:35 2019 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=2d8d447f

dev-lang/python: drop .exe from script shebangs

Python creates symlink usr/bin/python3.6.exe->python3.6m.exe and uses
usr/bin/python3.6.exe as shebang.  As we recreate python3.6 without .exe
and Cygwin would resolve python3.6 to both python3.6 and python3.6.exe,
we can just drop the .exe extensions from shebangs, even if we won't
recreate any symlink.

Package-Manager: Portage-2.3.55.1-prefix, Repoman-2.3.12
Signed-off-by: Michael Haubenwallner <haubi <AT> gentoo.org>

 dev-lang/python/python-3.6.6.ebuild | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/dev-lang/python/python-3.6.6.ebuild 
b/dev-lang/python/python-3.6.6.ebuild
index 3003efd0da..78ddb6364b 100644
--- a/dev-lang/python/python-3.6.6.ebuild
+++ b/dev-lang/python/python-3.6.6.ebuild
@@ -308,6 +308,12 @@ src_install() {
        # Fix collisions between different slots of Python.
        rm -f "${ED}usr/$(get_libdir)/libpython3.so"
 
+       if use elibc_Cygwin; then
+               # We may recreate symlinks, but without any .exe extension.  
Cygwin
+               # can resolv either without it, so just drop .exe from shebangs:
+               sed -i -e '1s/\.exe//' "$ED"/usr/bin/* || die
+       fi
+
        # Cheap hack to get version with ABIFLAGS
        local abiver=$(cd "${ED}usr/include"; echo python*)
        if [[ ${abiver} != python${PYVER} ]]; then

Reply via email to