[Pkg-privacy-commits] [obfsproxy] 154/353: Add a patch to fix the C-obfsproxy compatilibity hack

Ximin Luo infinity0 at moszumanska.debian.org
Sat Aug 22 13:01:53 UTC 2015


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository obfsproxy.

commit c09939fec4a88eaba6e82936f8a6148d9de1e24a
Author: Jérémy Bobbio <lunar at debian.org>
Date:   Thu Apr 11 09:38:53 2013 +0000

    Add a patch to fix the C-obfsproxy compatilibity hack
---
 ...ibility-hack-to-the-registred-entry-point.patch | 59 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 2 files changed, 60 insertions(+)

diff --git a/debian/patches/0001-Move-compatibility-hack-to-the-registred-entry-point.patch b/debian/patches/0001-Move-compatibility-hack-to-the-registred-entry-point.patch
new file mode 100644
index 0000000..740d430
--- /dev/null
+++ b/debian/patches/0001-Move-compatibility-hack-to-the-registred-entry-point.patch
@@ -0,0 +1,59 @@
+From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Bobbio?= <lunar at debian.org>
+Date: Thu, 11 Apr 2013 09:36:54 +0000
+Subject: Move compatibility hack to the registred entry point
+
+The /usr/bin/obfsproxy file is actually written by setuptools and runs the
+registred entry point. That is where we need to put the compatibility hack with
+C-obfsproxy, otherwise it will simply disappear.
+---
+ bin/obfsproxy            |   12 ------------
+ obfsproxy/pyobfsproxy.py |   13 +++++++++++++
+ 2 files changed, 13 insertions(+), 12 deletions(-)
+
+diff --git a/bin/obfsproxy b/bin/obfsproxy
+index cc67781..a716b18 100755
+--- a/bin/obfsproxy
++++ b/bin/obfsproxy
+@@ -8,18 +8,6 @@ path_to_project_root = os.path.abspath(os.path.join(dir_of_executable, '..'))
+ 
+ sys.path.insert(0, path_to_project_root)
+ 
+-# Pyobfsproxy's CLI uses "managed" whereas C-obfsproxy uses
+-# "--managed" to configure managed-mode. Python obfsproxy can't
+-# recognize "--managed" because it uses argparse subparsers and
+-# http://bugs.python.org/issue9253 is not yet solved. This is a crazy
+-# hack to maintain CLI compatibility between the two versions. we
+-# basically inplace replace "--managed" with "managed" in the argument
+-# list.
+-if len(sys.argv) > 1 and '--managed' in sys.argv:
+-    for n, arg in enumerate(sys.argv):
+-        if arg == '--managed':
+-            sys.argv[n] = 'managed'
+-
+ from obfsproxy.pyobfsproxy import run
+ run()
+ 
+diff --git a/obfsproxy/pyobfsproxy.py b/obfsproxy/pyobfsproxy.py
+index 92663d5..05214bb 100755
+--- a/obfsproxy/pyobfsproxy.py
++++ b/obfsproxy/pyobfsproxy.py
+@@ -134,6 +134,19 @@ def pyobfsproxy():
+ 
+ def run():
+     """Fake entry-point so that we can log unhandled exceptions."""
++
++    # Pyobfsproxy's CLI uses "managed" whereas C-obfsproxy uses
++    # "--managed" to configure managed-mode. Python obfsproxy can't
++    # recognize "--managed" because it uses argparse subparsers and
++    # http://bugs.python.org/issue9253 is not yet solved. This is a crazy
++    # hack to maintain CLI compatibility between the two versions. we
++    # basically inplace replace "--managed" with "managed" in the argument
++    # list.
++    if len(sys.argv) > 1 and '--managed' in sys.argv:
++        for n, arg in enumerate(sys.argv):
++            if arg == '--managed':
++                sys.argv[n] = 'managed'
++
+     try:
+         pyobfsproxy()
+     except Exception, e:
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..893f5ec
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+0001-Move-compatibility-hack-to-the-registred-entry-point.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/obfsproxy.git



More information about the Pkg-privacy-commits mailing list