1 |
commit: d53245ce5666e61659ee995ff3645b26fcc5cbbb |
2 |
Author: Tim Harder <radhermit <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Feb 6 09:56:59 2018 +0000 |
4 |
Commit: Tim Harder <radhermit <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Feb 6 10:25:46 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d53245ce |
7 |
|
8 |
net-proxy/sshuttle: use upstream python3 patch |
9 |
|
10 |
.../files/sshuttle-0.78.3-remote-python.patch | 67 ++++++++++++++++++++-- |
11 |
...-0.78.3-r1.ebuild => sshuttle-0.78.3-r2.ebuild} | 0 |
12 |
2 files changed, 62 insertions(+), 5 deletions(-) |
13 |
|
14 |
diff --git a/net-proxy/sshuttle/files/sshuttle-0.78.3-remote-python.patch b/net-proxy/sshuttle/files/sshuttle-0.78.3-remote-python.patch |
15 |
index d7404fd45b0..c8138f73277 100644 |
16 |
--- a/net-proxy/sshuttle/files/sshuttle-0.78.3-remote-python.patch |
17 |
+++ b/net-proxy/sshuttle/files/sshuttle-0.78.3-remote-python.patch |
18 |
@@ -1,13 +1,70 @@ |
19 |
-Check for more generic remote python versions. |
20 |
+From 9b7ce2811ec3ef35b9b7f7dfc157127bc46ece47 Mon Sep 17 00:00:00 2001 |
21 |
+From: vieira <vieira@××××.be> |
22 |
+Date: Fri, 20 Oct 2017 22:52:06 +0000 |
23 |
+Subject: [PATCH] Use versions of python3 greater than 3.5 when available (e.g. |
24 |
+ 3.6) |
25 |
|
26 |
---- sshuttle-0.78.3/sshuttle/ssh.py |
27 |
-+++ sshuttle-0.78.3/sshuttle/ssh.py |
28 |
-@@ -116,7 +116,7 @@ |
29 |
+Some Linux distros, like Alpine, Arch, etc and some BSDs, like FreeBSD, are |
30 |
+now shipping with python3.6 as the default python3. Both the client and the |
31 |
+server are failing to run in this distros, because we are specifically looking |
32 |
+for python3.5. |
33 |
+ |
34 |
+These changes make the run shell script use python3 if the version is greater |
35 |
+than 3.5, otherwise falling back as usual. |
36 |
+ |
37 |
+On the server any version of python3 will do, use it before falling back to |
38 |
+python, as the server code can run with any version of python3. |
39 |
+--- |
40 |
+ run | 28 +++++++++++++++++----------- |
41 |
+ sshuttle/ssh.py | 2 +- |
42 |
+ 2 files changed, 18 insertions(+), 12 deletions(-) |
43 |
+ |
44 |
+diff --git a/run b/run |
45 |
+index ec2d3f0..a14d831 100755 |
46 |
+--- a/run |
47 |
++++ b/run |
48 |
+@@ -1,11 +1,17 @@ |
49 |
+-#!/bin/sh |
50 |
+-source_dir="$(dirname $0)" |
51 |
+-(cd "$source_dir" && "$source_dir/setup.py" --version > /dev/null) |
52 |
+-export PYTHONPATH="$source_dir:$PYTHONPATH" |
53 |
+-if python3.5 -V >/dev/null 2>&1; then |
54 |
+- exec python3.5 -m "sshuttle" "$@" |
55 |
+-elif python2.7 -V >/dev/null 2>&1; then |
56 |
+- exec python2.7 -m "sshuttle" "$@" |
57 |
+-else |
58 |
+- exec python -m "sshuttle" "$@" |
59 |
+-fi |
60 |
++#!/usr/bin/env sh |
61 |
++set -e |
62 |
++export PYTHONPATH="$(dirname $0):$PYTHONPATH" |
63 |
++ |
64 |
++python_best_version() { |
65 |
++ if [ -x "$(command -v python3)" ]; then |
66 |
++ if python3 -c "import sys; sys.exit(not sys.version_info > (3, 5))"; then |
67 |
++ exec python3 "$@" |
68 |
++ fi |
69 |
++ elif [ -x "$(command -v python2.7)" ]; then |
70 |
++ exec python2.7 "$@" |
71 |
++ else |
72 |
++ exec python "$@" |
73 |
++ fi |
74 |
++} |
75 |
++ |
76 |
++python_best_version -m "sshuttle" "$@" |
77 |
+diff --git a/sshuttle/ssh.py b/sshuttle/ssh.py |
78 |
+index f4c84cc..a1f2997 100644 |
79 |
+--- a/sshuttle/ssh.py |
80 |
++++ b/sshuttle/ssh.py |
81 |
+@@ -116,7 +116,7 @@ def connect(ssh_cmd, rhostport, python, stderr, options): |
82 |
if python: |
83 |
pycmd = "'%s' -c '%s'" % (python, pyscript) |
84 |
else: |
85 |
- pycmd = ("P=python3.5; $P -V 2>/dev/null || P=python; " |
86 |
-+ pycmd = ("P=python3; $P -V 2>/dev/null || P=python2; $P -V 2>/dev/null || P=python; " |
87 |
++ pycmd = ("P=python3; $P -V 2>/dev/null || P=python; " |
88 |
"exec \"$P\" -c %s") % quote(pyscript) |
89 |
pycmd = ("exec /bin/sh -c %s" % quote(pycmd)) |
90 |
argv = (sshl + |
91 |
+-- |
92 |
+2.16.1 |
93 |
+ |
94 |
|
95 |
diff --git a/net-proxy/sshuttle/sshuttle-0.78.3-r1.ebuild b/net-proxy/sshuttle/sshuttle-0.78.3-r2.ebuild |
96 |
similarity index 100% |
97 |
rename from net-proxy/sshuttle/sshuttle-0.78.3-r1.ebuild |
98 |
rename to net-proxy/sshuttle/sshuttle-0.78.3-r2.ebuild |