Merge lp:~dobey/ubuntu/oneiric/couchdb/fix-780972 into lp:ubuntu/oneiric/couchdb

Proposed by dobey
Status: Merged
Merged at revision: 56
Proposed branch: lp:~dobey/ubuntu/oneiric/couchdb/fix-780972
Merge into: lp:ubuntu/oneiric/couchdb
Diff against target: 143 lines (+131/-0)
2 files modified
debian/changelog (+6/-0)
debian/patches/couchdb-svn1039345-backport.patch (+125/-0)
To merge this branch: bzr merge lp:~dobey/ubuntu/oneiric/couchdb/fix-780972
Reviewer Review Type Date Requested Status
Mathieu Trudel-Lapierre Approve
Ubuntu branches Pending
Review via email: mp+75238@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

It looks good, and builds fine. Uploading.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2011-06-14 17:47:09 +0000
3+++ debian/changelog 2011-09-13 18:21:22 +0000
4@@ -1,3 +1,9 @@
5+couchdb (1.0.1-0ubuntu17) oneiric; urgency=high
6+
7+ * Backport svn r1039345 from 1.0.3 (LP: #780972)
8+
9+ -- John S Gruber <johnsgruber@gmail.com> Fri, 02 Sep 2011 01:02:01 -0400
10+
11 couchdb (1.0.1-0ubuntu16) oneiric; urgency=low
12
13 * Update Spidermonkey 1.8.5 patchset to the more palatable ones I'm
14
15=== added file 'debian/patches/couchdb-svn1039345-backport.patch'
16--- debian/patches/couchdb-svn1039345-backport.patch 1970-01-01 00:00:00 +0000
17+++ debian/patches/couchdb-svn1039345-backport.patch 2011-09-13 18:21:22 +0000
18@@ -0,0 +1,125 @@
19+=== modified file 'src/erlang-oauth/oauth.app.in'
20+--- old/src/erlang-oauth/oauth.app.in 2010-07-26 10:24:11 +0000
21++++ new/src/erlang-oauth/oauth.app.in 2011-09-13 17:32:12 +0000
22+@@ -1,6 +1,6 @@
23+ {application, oauth, [
24+ {description, "Erlang OAuth implementation"},
25+- {vsn, "dev"},
26++ {vsn, "7d85d3ef"},
27+ {modules, [
28+ oauth,
29+ oauth_hmac_sha1,
30+
31+=== modified file 'src/erlang-oauth/oauth_hmac_sha1.erl'
32+--- old/src/erlang-oauth/oauth_hmac_sha1.erl 2010-07-26 10:24:11 +0000
33++++ new/src/erlang-oauth/oauth_hmac_sha1.erl 2011-09-13 17:32:12 +0000
34+@@ -8,4 +8,4 @@ signature(BaseString, CS, TS) ->
35+ base64:encode_to_string(crypto:sha_mac(Key, BaseString)).
36+
37+ verify(Signature, BaseString, CS, TS) ->
38+- couch_util:verify(signature(BaseString, CS, TS), Signature).
39++ Signature =:= signature(BaseString, CS, TS).
40+
41+=== modified file 'src/erlang-oauth/oauth_http.erl'
42+--- old/src/erlang-oauth/oauth_http.erl 2009-08-24 15:44:14 +0000
43++++ new/src/erlang-oauth/oauth_http.erl 2011-09-13 17:32:12 +0000
44+@@ -10,7 +10,7 @@ post(URL, Data) ->
45+ request(post, {URL, [], "application/x-www-form-urlencoded", Data}).
46+
47+ request(Method, Request) ->
48+- http:request(Method, Request, [{autoredirect, false}], []).
49++ httpc:request(Method, Request, [{autoredirect, false}], []).
50+
51+ response_params(Response) ->
52+ oauth_uri:params_from_string(response_body(Response)).
53+
54+=== modified file 'src/erlang-oauth/oauth_plaintext.erl'
55+--- old/src/erlang-oauth/oauth_plaintext.erl 2010-07-26 10:24:11 +0000
56++++ new/src/erlang-oauth/oauth_plaintext.erl 2011-09-13 17:32:12 +0000
57+@@ -7,4 +7,4 @@ signature(CS, TS) ->
58+ oauth_uri:calate("&", [CS, TS]).
59+
60+ verify(Signature, CS, TS) ->
61+- couch_util:verify(signature(CS, TS), Signature).
62++ Signature =:= signature(CS, TS).
63+
64+=== modified file 'src/erlang-oauth/oauth_uri.erl'
65+--- old/src/erlang-oauth/oauth_uri.erl 2009-08-24 15:44:14 +0000
66++++ new/src/erlang-oauth/oauth_uri.erl 2011-09-13 17:32:12 +0000
67+@@ -6,14 +6,6 @@
68+
69+ -import(lists, [concat/1]).
70+
71+--define(is_uppercase_alpha(C), C >= $A, C =< $Z).
72+--define(is_lowercase_alpha(C), C >= $a, C =< $z).
73+--define(is_alpha(C), ?is_uppercase_alpha(C); ?is_lowercase_alpha(C)).
74+--define(is_digit(C), C >= $0, C =< $9).
75+--define(is_alphanumeric(C), ?is_alpha(C); ?is_digit(C)).
76+--define(is_unreserved(C), ?is_alphanumeric(C); C =:= $-; C =:= $_; C =:= $.; C =:= $~).
77+--define(is_hex(C), ?is_digit(C); C >= $A, C =< $F).
78+-
79+
80+ normalize(URI) ->
81+ case http_uri:parse(URI) of
82+@@ -66,23 +58,41 @@ intersperse(_, [X]) -> [X];
83+ intersperse(Sep, [X|Xs]) ->
84+ [X, Sep|intersperse(Sep, Xs)].
85+
86+-decode(Chars) ->
87+- decode(Chars, []).
88++-define(is_alphanum(C), C >= $A, C =< $Z; C >= $a, C =< $z; C >= $0, C =< $9).
89+
90+-decode([], Decoded) ->
91+- lists:reverse(Decoded);
92+-decode([$%,A,B|Etc], Decoded) when ?is_hex(A), ?is_hex(B) ->
93+- decode(Etc, [erlang:list_to_integer([A,B], 16)|Decoded]);
94+-decode([C|Etc], Decoded) when ?is_unreserved(C) ->
95+- decode(Etc, [C|Decoded]).
96+-
97+-encode(Chars) ->
98+- encode(Chars, []).
99+-
100+-encode([], Encoded) ->
101+- lists:flatten(lists:reverse(Encoded));
102+-encode([C|Etc], Encoded) when ?is_unreserved(C) ->
103+- encode(Etc, [C|Encoded]);
104+-encode([C|Etc], Encoded) ->
105+- Value = io_lib:format("%~2.1.0s", [erlang:integer_to_list(C, 16)]),
106+- encode(Etc, [Value|Encoded]).
107++encode(Term) when is_integer(Term) ->
108++ integer_to_list(Term);
109++encode(Term) when is_atom(Term) ->
110++ encode(atom_to_list(Term));
111++encode(Term) when is_list(Term) ->
112++ encode(lists:reverse(Term, []), []).
113++
114++encode([X | T], Acc) when ?is_alphanum(X); X =:= $-; X =:= $_; X =:= $.; X =:= $~ ->
115++ encode(T, [X | Acc]);
116++encode([X | T], Acc) ->
117++ NewAcc = [$%, dec2hex(X bsr 4), dec2hex(X band 16#0f) | Acc],
118++ encode(T, NewAcc);
119++encode([], Acc) ->
120++ Acc.
121++
122++decode(Str) when is_list(Str) ->
123++ decode(Str, []).
124++
125++decode([$%, A, B | T], Acc) ->
126++ decode(T, [(hex2dec(A) bsl 4) + hex2dec(B) | Acc]);
127++decode([X | T], Acc) ->
128++ decode(T, [X | Acc]);
129++decode([], Acc) ->
130++ lists:reverse(Acc, []).
131++
132++-compile({inline, [{dec2hex, 1}, {hex2dec, 1}]}).
133++
134++dec2hex(N) when N >= 10 andalso N =< 15 ->
135++ N + $A - 10;
136++dec2hex(N) when N >= 0 andalso N =< 9 ->
137++ N + $0.
138++
139++hex2dec(C) when C >= $A andalso C =< $F ->
140++ C - $A + 10;
141++hex2dec(C) when C >= $0 andalso C =< $9 ->
142++ C - $0.
143+

Subscribers

People subscribed via source and target branches

to all changes: