[arch-commits] Commit in mitmproxy/trunk (PKGBUILD fix-test.patch)

Felix Yan felixonmars at archlinux.org
Thu Mar 16 08:55:24 UTC 2017


    Date: Thursday, March 16, 2017 @ 08:55:23
  Author: felixonmars
Revision: 216682

upgpkg: mitmproxy 2.0.1-1

Added:
  mitmproxy/trunk/fix-test.patch
Modified:
  mitmproxy/trunk/PKGBUILD

----------------+
 PKGBUILD       |   18 +++++++++++-------
 fix-test.patch |   23 +++++++++++++++++++++++
 2 files changed, 34 insertions(+), 7 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2017-03-16 08:55:01 UTC (rev 216681)
+++ PKGBUILD	2017-03-16 08:55:23 UTC (rev 216682)
@@ -4,7 +4,7 @@
 # Contributor: Olivier Biesmans <olivier at biesmans dot fr>
 
 pkgname=mitmproxy
-pkgver=2.0.0
+pkgver=2.0.1
 pkgrel=1
 pkgdesc="SSL-capable man-in-the-middle HTTP proxy"
 arch=('any')
@@ -17,18 +17,22 @@
          'python-setuptools' 'python-sortedcontainers' 'python-tornado' 'python-urwid'
          'python-watchdog')
 optdepends=('protobuf: Contentviews - Extended content decoding')
-makedepends=('git')
 checkdepends=('python-beautifulsoup4' 'python-flask' 'python-pytz' 'python-pytest-runner'
               'protobuf')
 provides=('pathod')
 conflicts=('pathod')
 replaces=('pathod')
-source=("git+https://github.com/mitmproxy/mitmproxy.git#tag=v$pkgver")
-sha256sums=('SKIP')
+source=("$pkgname-$pkgver.tar.gz::https://github.com/mitmproxy/mitmproxy/archive/v$pkgver.tar.gz"
+        fix-test.patch)
+sha256sums=('b0ccc49924762ea78290d62c463be8c041f1837f9005f583ad09c47122547e9d'
+            'f9fc3e3732ba1867b3a0befc7c15c52ddd6b32723fc348c42c1eae546d021f1f')
 
 prepare() {
-  cd mitmproxy
+  cd mitmproxy-$pkgver
 
+  # https://github.com/mitmproxy/mitmproxy/pull/2170
+  patch -p1 -i ../fix-test.patch
+
   # Let's remove all the upper bounds and use system certificate store
   sed -e '/certifi/d' \
       -e 's/, *<[0-9=.]*//' \
@@ -39,11 +43,11 @@
 }
 
 check() {
-  cd mitmproxy
+  cd mitmproxy-$pkgver
   LC_CTYPE=en_US.UTF-8 python setup.py pytest
 }
 
 package() {
-  cd mitmproxy
+  cd mitmproxy-$pkgver
   python setup.py install --root="$pkgdir" -O1
 }

Added: fix-test.patch
===================================================================
--- fix-test.patch	                        (rev 0)
+++ fix-test.patch	2017-03-16 08:55:23 UTC (rev 216682)
@@ -0,0 +1,23 @@
+From b3525570929ba47c10d9d08696876c39487f7000 Mon Sep 17 00:00:00 2001
+From: Felix Yan <felixonmars at archlinux.org>
+Date: Thu, 16 Mar 2017 16:48:21 +0800
+Subject: [PATCH] Fix test_format_xml with dot in path
+
+When the path contains dot ".", replacing all dots will generate a non-exist result and raises a FileNotFoundError. Replacing only the last dot fixes this.
+---
+ test/mitmproxy/contentviews/test_xml_html.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/test/mitmproxy/contentviews/test_xml_html.py b/test/mitmproxy/contentviews/test_xml_html.py
+index 899ecfd..2b0aee4 100644
+--- a/test/mitmproxy/contentviews/test_xml_html.py
++++ b/test/mitmproxy/contentviews/test_xml_html.py
+@@ -23,7 +23,7 @@ def test_format_xml(filename):
+     path = data.path(filename)
+     with open(path) as f:
+         input = f.read()
+-    with open(path.replace(".", "-formatted.")) as f:
++    with open("-formatted.".join(path.rsplit(".", 1))) as f:
+         expected = f.read()
+     tokens = xml_html.tokenize(input)
+     assert xml_html.format_xml(tokens) == expected


More information about the arch-commits mailing list