commit:     bd3945affbf081af5998a50b5d0a7119b117be4f
Author:     Alfred Wingate <parona <AT> protonmail <DOT> com>
AuthorDate: Sun Jul 23 01:04:10 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jul 24 01:44:27 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bd3945af

dev-python/virtualenvwrapper: fix broken sed expression

* Previous change 0c64ab0 had a mistake get through and change wasnt
  applied. Lesson learned about double and triple checking regex...
* Instead patch with @@GENTOO_PYTHON_EXECUTABLE@@ and then sed replace
  with current python interpeter.

Signed-off-by: Alfred Wingate <parona <AT> protonmail.com>
Closes: https://github.com/gentoo/gentoo/pull/32007
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...0230121-override-default-python-executable.patch | 21 +++++++++++++++++++++
 ... => virtualenvwrapper-4.8.4_p20230121-r2.ebuild} |  5 ++---
 2 files changed, 23 insertions(+), 3 deletions(-)

diff --git 
a/dev-python/virtualenvwrapper/files/virtualenvwrapper-4.8.4_p20230121-override-default-python-executable.patch
 
b/dev-python/virtualenvwrapper/files/virtualenvwrapper-4.8.4_p20230121-override-default-python-executable.patch
new file mode 100644
index 000000000000..0c7268422efe
--- /dev/null
+++ 
b/dev-python/virtualenvwrapper/files/virtualenvwrapper-4.8.4_p20230121-override-default-python-executable.patch
@@ -0,0 +1,21 @@
+https://github.com/parona-source/virtualenvwrapper/commit/9cb7bcab244c3e49d7b25b73e82566d0adce3282
+
+From 9cb7bcab244c3e49d7b25b73e82566d0adce3282 Mon Sep 17 00:00:00 2001
+From: Alfred Wingate <[email protected]>
+Date: Sun, 23 Jul 2023 05:05:59 +0300
+Subject: [PATCH] virtualenvwrapper.sh: Override default python executable
+
+--- a/virtualenvwrapper.sh
++++ b/virtualenvwrapper.sh
+@@ -47,7 +47,7 @@
+ # Locate the global Python where virtualenvwrapper is installed.
+ if [ "${VIRTUALENVWRAPPER_PYTHON:-}" = "" ]
+ then
+-    _virtualenvwrapper_python_executable="$(command -v python3)"
++    _virtualenvwrapper_python_executable="@@GENTOO_PYTHON_EXECUTABLE@@"
+     if [ -n "$_virtualenvwrapper_python_executable" ] && 
$_virtualenvwrapper_python_executable -m 'virtualenvwrapper.hook_loader' --help 
>/dev/null 2>&1
+     then
+         VIRTUALENVWRAPPER_PYTHON=$_virtualenvwrapper_python_executable
+-- 
+2.41.0
+

diff --git 
a/dev-python/virtualenvwrapper/virtualenvwrapper-4.8.4_p20230121-r1.ebuild 
b/dev-python/virtualenvwrapper/virtualenvwrapper-4.8.4_p20230121-r2.ebuild
similarity index 91%
rename from 
dev-python/virtualenvwrapper/virtualenvwrapper-4.8.4_p20230121-r1.ebuild
rename to 
dev-python/virtualenvwrapper/virtualenvwrapper-4.8.4_p20230121-r2.ebuild
index 080fc0b55799..be2e15f03d8b 100644
--- a/dev-python/virtualenvwrapper/virtualenvwrapper-4.8.4_p20230121-r1.ebuild
+++ b/dev-python/virtualenvwrapper/virtualenvwrapper-4.8.4_p20230121-r2.ebuild
@@ -44,15 +44,14 @@ BDEPEND="
 
 PATCHES=(
        "${FILESDIR}/virtualenvwrapper-${PV}-remove-use-of-which.patch"
+       
"${FILESDIR}/virtualenvwrapper-${PV}-override-default-python-executable.patch"
 )
 
 src_prepare() {
        default
 
        # specify default python interpeter to align with PYTHON_SINGLE_TARGET
-       sed -i -e \
-               
"s|\(_virtualenvwrapper_python_executable=\"\$(\).\w\((\"\)|\1command -v 
${EPYTHON}\2|" \
-               virtualenvwrapper.sh || die
+       sed -i -e "s:@@GENTOO_PYTHON_EXECUTABLE@@:${PYTHON}:" 
virtualenvwrapper.sh || die
 
        # remove tests which require an internet connection
        rm tests/test_mkvirtualenv_install.sh || die

Reply via email to