[python-paste] Tarball is missing files, use a snapshot to get those files and also pick up several bug fixes (one

Toshio くらとみ toshio at fedoraproject.org
Thu Dec 22 00:15:16 UTC 2011


commit 5b340cb690392ccfefcd531f183edde61ee4f96a
Author: Toshio Kuratomi <toshio at fedoraproject.org>
Date:   Wed Dec 21 16:15:08 2011 -0800

    Tarball is missing files, use a snapshot to get those files and also pick up
    several bug fixes (one related to serving CGI scripts, another for http
    Continue requests, and a third regarding digest authentication and internet
    explorer)

 .gitignore              |    3 --
 paste-digest-snap.patch |   50 +++++++++++++++++++++++++++++++++++++++++++++++
 paste-manifest.patch    |   15 ++++++++++++++
 python-paste.spec       |   43 +++++++++++++++++++++++++++-------------
 sources                 |    3 +-
 5 files changed, 95 insertions(+), 19 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index be9e71f..9564fd0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1 @@
-Paste-1.7.4.tar.gz
-/Paste-1.7.5.tar.gz
 Paste-1.7.5.1.tar.gz
-/paste-snap-testdata.tar.gz
diff --git a/paste-digest-snap.patch b/paste-digest-snap.patch
new file mode 100644
index 0000000..ca230e4
--- /dev/null
+++ b/paste-digest-snap.patch
@@ -0,0 +1,50 @@
+diff -r abaf4a78f69b paste/auth/digest.py
+--- a/paste/auth/digest.py	Wed Dec 21 09:00:48 2011 -0800
++++ b/paste/auth/digest.py	Wed Dec 21 16:03:49 2011 -0800
+@@ -38,6 +38,34 @@
+ import time, random
+ from urllib import quote as url_quote
+ 
++def _split_auth_string(auth_string):
++    """ split a digest auth string into individual key=value strings """
++    prev = None
++    for item in auth_string.split(","):
++        try:
++            if prev.count('"') == 1:
++                prev = "%s,%s" % (prev, item)
++                continue
++        except AttributeError:
++            if prev == None:
++                prev = item
++                continue
++            else:
++                raise StopIteration
++        yield prev.strip()
++        prev = item
++
++    yield prev.strip()
++    raise StopIteration
++
++def _auth_to_kv_pairs(auth_string):
++    """ split a digest auth string into key, value pairs """
++    for item in _split_auth_string(auth_string):
++        (k, v) = item.split("=", 1)
++        if v.startswith('"') and len(v) > 1 and v.endswith('"'):
++            v = v[1:-1]
++        yield (k, v)
++
+ def digest_password(realm, username, password):
+     """ construct the appropriate hashcode needed for HTTP digest """
+     return md5("%s:%s:%s" % (username, realm, password)).hexdigest()
+@@ -98,10 +126,7 @@
+         (authmeth, auth) = authorization.split(" ", 1)
+         if 'digest' != authmeth.lower():
+             return self.build_authentication()
+-        amap = {}
+-        for itm in auth.split(","):
+-            (k,v) = [s.strip() for s in itm.strip().split("=", 1)]
+-            amap[k] = v.replace('"', '')
++        amap = dict(_auth_to_kv_pairs(auth))
+         try:
+             username = amap['username']
+             authpath = amap['uri']
diff --git a/paste-manifest.patch b/paste-manifest.patch
new file mode 100644
index 0000000..4f7ee93
--- /dev/null
+++ b/paste-manifest.patch
@@ -0,0 +1,15 @@
+diff -r 852439f67241 -r abaf4a78f69b MANIFEST.in
+--- a/MANIFEST.in	Wed Aug 17 15:52:53 2011 -0500
++++ b/MANIFEST.in	Wed Dec 21 09:00:48 2011 -0800
+@@ -1,6 +1,8 @@
+-recursive-include docs *.txt
++recursive-include docs *.txt *.css *.js
++include docs/_templates/*.html
+ include docs/conf.py
++include docs/test_server.ini
+ recursive-exclude docs/_build/_sources *
+ recursive-include docs/_build *.html
+-recursive-include tests *.txt *.py
+-recursive-include paste *.js *.jpg
++recursive-include tests *.txt *.py *.cgi *.html
++recursive-include paste *.js *.jpg *.png
diff --git a/python-paste.spec b/python-paste.spec
index 16bcfc2..41bae86 100644
--- a/python-paste.spec
+++ b/python-paste.spec
@@ -6,7 +6,7 @@
 
 Name:           python-paste
 Version:        1.7.5.1
-Release:        3%{?dist}
+Release:        4.20111221hg1498%{?dist}
 Summary:        Tools for using a Web Server Gateway Interface stack
 Group:          System Environment/Libraries
 # Most of the code is MIT
@@ -17,17 +17,27 @@ Group:          System Environment/Libraries
 # doctest24.py, Public Domain
 License: MIT and ZPLv2.0 and Python and Public Domain and (AFL or MIT) and (MIT or ASL 2.0)
 URL:            http://pythonpaste.org
-Source0:        http://pypi.python.org/pypi/packages/source/P/Paste/Paste-%{version}.tar.gz
-# test data left out of the tarball.  Captured from a checkout
-# https://bitbucket.org/ianb/paste
-# changeset:   1498:852439f67241
-# cd paste ; tar -czf paste-snap-testdata.tar.gz tests/cgiapp_data
-Source1: paste-snap-testdata.tar.gz
+# All files arent included in the 0.7.5.1 release.  Take a snapshot to get
+# unittests working and pick up three bugfixes as well
+# hg clone -r 1498 https://bitbucket.org/ianb/paste
+# cd paste
+# patch -p1 < ../paste-manifest.patch
+# python setup.py sdist
+# Source is in dist/Paste-1.7.5.1.tar.gz
+Source0:        Paste-%{version}.tar.gz
+Source1: digest.py
+#Source0:        http://pypi.python.org/pypi/packages/source/P/Paste/Paste-%{version}.tar.gz
 # In one remaining place, make sure we check for string in the stdlib before we use our copy
 Patch0: paste-unbundle-stdlib.patch
 # Use a system version of python-tempita before our bundled copy
 Patch1: paste-unbundle-tempita.patch
 Patch2: paste-27-lambda.patch
+# Fix parsing of digest key value pairs
+# Submitted upstream pull request
+Patch3: paste-digest-snap.patch
+# Submitted upstream pull request with this change.
+# This patch is needed when creating the tarball, not during rpm build
+Patch100: paste-manifest.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch:      noarch
 
@@ -72,14 +82,17 @@ interfaces.
 
 %prep
 %setup -q -n Paste-%{version}
-tar -xzf %{SOURCE1}
 %patch0 -p1 -b .stdlib
 rm paste/util/subprocess24.py
 %patch1 -p1 -b .tmpta
 %patch2 -p1 -b .27lambda
+%patch3 -p1 -b .digest
 # Strip #! lines that make these seem like scripts
 %{__sed} -i -e '/^#!.*/,1 d' paste/util/scgiserver.py paste/debug/doctest_webapp.py
 
+#####TESTING
+#cp %{SOURCE1} paste/auth/digest.py
+
 # clean docs directory
 pushd docs
 rm StyleGuide.txt
@@ -112,13 +125,9 @@ popd
 %endif # with_python3
 
 %check
-# At least we're running *some* of the unittests now.
-# Tests here that fail with localhost probably shouldn't be failing, though
 export PYTHONPATH=$(pwd)
-nosetests -e '.*test_static_parser' \
-	-e '.*test_deep' \
-	-e '.*test_find_file' \
-	-e '.*test_paste_website' \
+# We don't have access to the wider internet in the buildsystem
+nosetests -e '.*test_paste_website'
 
 %if 0%{?with_python3}
 pushd %{py3dir}
@@ -145,6 +154,12 @@ rm -rf %{buildroot}
 
 
 %changelog
+* Wed Dec 21 2011 Toshio Kuratomi <toshio at fedoraproject.org> - 1.7.5.1-4.20111221hg1498
+- Tarball is missing files, use a snapshot to get those files and also pick up
+  several bug fixes (one related to serving CGI scripts, another for http
+  Continue requests, and a third regarding digest authentication and internet
+  explorer)
+
 * Tue Dec 20 2011 Toshio Kuratomi <toshio at fedoraproject.org> - 1.7.5.1-3
 - Ugh.  Enable unittests and make a note that the python3 module is totally
   non-functional.  Open a bug for that for the actual package maintainers to
diff --git a/sources b/sources
index 4c342bf..353a72f 100644
--- a/sources
+++ b/sources
@@ -1,2 +1 @@
-7ea5fabed7dca48eb46dc613c4b6c4ed  Paste-1.7.5.1.tar.gz
-506c9963be1e165239aa6594a58b80d8  paste-snap-testdata.tar.gz
+bd38d4611a60ed65f1f7fe550c1b0ecc  Paste-1.7.5.1.tar.gz


More information about the scm-commits mailing list