[Pkg-erlang-commits] r1941 - in yaws/trunk/debian: . patches

sgolovan at alioth.debian.org sgolovan at alioth.debian.org
Mon Jul 10 08:39:17 UTC 2017


Author: sgolovan
Date: 2017-07-10 08:39:16 +0000 (Mon, 10 Jul 2017)
New Revision: 1941

Added:
   yaws/trunk/debian/patches/e20-2.patch
   yaws/trunk/debian/patches/e20.patch
Modified:
   yaws/trunk/debian/changelog
   yaws/trunk/debian/patches/series
Log:
[yaws]
  * Added a few patches from upstream which fix FTBFS with new Erlang R20.


Modified: yaws/trunk/debian/changelog
===================================================================
--- yaws/trunk/debian/changelog	2017-07-08 07:40:16 UTC (rev 1940)
+++ yaws/trunk/debian/changelog	2017-07-10 08:39:16 UTC (rev 1941)
@@ -1,8 +1,8 @@
-yaws (2.0.4+dfsg-2) UNRELEASED; urgency=medium
+yaws (2.0.4+dfsg-2) unstable; urgency=medium
 
-  * NOT RELEASED YET
+  * Added a few patches from upstream which fix FTBFS with new Erlang R20.
 
- -- Sergei Golovan <sgolovan at debian.org>  Thu, 22 Sep 2016 15:06:04 +0300
+ -- Sergei Golovan <sgolovan at debian.org>  Mon, 10 Jul 2017 11:38:44 +0300
 
 yaws (2.0.4+dfsg-1) unstable; urgency=medium
 

Added: yaws/trunk/debian/patches/e20-2.patch
===================================================================
--- yaws/trunk/debian/patches/e20-2.patch	                        (rev 0)
+++ yaws/trunk/debian/patches/e20-2.patch	2017-07-10 08:39:16 UTC (rev 1941)
@@ -0,0 +1,84 @@
+From: Christopher Faulet <christopher.faulet at capflam.org>
+Date: Fri, 21 Apr 2017 21:28:44 +0200
+Subject: [PATCH] Remove 'export_all' compile option and export public
+ functions explicitly
+ .
+ Unlike the testsuite, modules updated by this patch have been updated to export
+ explicitly public functions instead of using 'expor_all' compile option. This
+ remove compilation errors in Erlang/OTP 20.
+
+--- a/applications/mail/src/attachment.erl
++++ b/applications/mail/src/attachment.erl
+@@ -6,7 +6,8 @@
+ %%% Created :  4 Feb 2004 by  <klacke at hyber.org>
+ %%%-------------------------------------------------------------------
+ -module(attachment).
+--compile(export_all).
++
++-export([out/1]).
+ 
+ out(A) ->
+     case mail:check_session(A) of
+--- a/applications/wiki/src/wiki.erl
++++ b/applications/wiki/src/wiki.erl
+@@ -21,7 +21,6 @@
+ 
+ -module('wiki').
+ -author('jb at son.bevemyr.com').
+--compile(export_all).
+ 
+ -export([showPage/3, createNewPage/3, showHistory/3, allPages/3,
+          lastEdited/3, wikiZombies/3, editPage/3, editFiles/3,
+@@ -42,6 +41,13 @@
+ -export([getPassword/1]).
+ -export([importFiles/1]).
+ 
++%% Function exported to avoid warnings
++-export([copyFiles2/3, session_proc/2, textarea/3, b/1, br/0,
++         pre/1, bgcolor/1, top_header/1, add_blanks_nicely/1,
++         big_letter/1, little_letter/1, show_error/1,
++         str2fileencoded/1, fileencoded2str/1, mime_type/1,
++         check_precon/2, getopt_options/2]).
++
+ -import(lists, [reverse/1, map/2, sort/1]).
+ 
+ -import(wiki_templates, [template/5, template2/5]).
+--- a/applications/wiki/src/wiki_format_txt.erl
++++ b/applications/wiki/src/wiki_format_txt.erl
+@@ -45,8 +45,8 @@
+ %%                                       and the * (or Header) and Text
+ %%                                       are not significant.
+ 
+--export([format/3, collect_wiki_link/1]).
+--compile(export_all).
++-export([format/3, format_url/2, collect_wiki_link/1, emb/4,
++         enc_month/1, enc_day/1]).
+ 
+ -import(lists, [member/2, map/2, reverse/1, reverse/2]).
+ 
+--- a/www/code/myappmod.erl
++++ b/www/code/myappmod.erl
+@@ -2,7 +2,8 @@
+ -author('klacke at bluetail.com').
+ 
+ -include("../../include/yaws_api.hrl").
+--compile(export_all).
++
++-export([out/1]).
+ 
+ box(Str) ->
+     {'div',[{class,"box"}],
+--- a/www/shoppingcart/shopcart.erl
++++ b/www/shoppingcart/shopcart.erl
+@@ -7,10 +7,10 @@
+ -module(shopcart).
+ -author('klacke at hyber.org').
+ 
+--compile(export_all).
+ -include("../../include/yaws_api.hrl").
+ -include_lib("kernel/include/inet.hrl").
+ 
++-export([top/1, buy/1, index/1, loginpost/1, login/1, logout/1, formupdate/1]).
+ 
+ %% this is the opaque structure we pass to the
+ %% yaws cookie session server

Added: yaws/trunk/debian/patches/e20.patch
===================================================================
--- yaws/trunk/debian/patches/e20.patch	                        (rev 0)
+++ yaws/trunk/debian/patches/e20.patch	2017-07-10 08:39:16 UTC (rev 1941)
@@ -0,0 +1,133 @@
+From: Steve Vinoski <vinoski at ieee.org>, Ning <ning.m.zhang at gmail.com>
+Date: Tue, 27 Jun 2017 17:17:52 -0400
+Subject: [PATCH] Changes for Erlang/OTP 20.0
+ .
+ In testsuite.erl, explicitly disable SNI if not set because in
+ Erlang/OTP 20.0, it is set by default to the Host value used in
+ ssl:connect/4 (Christopher).
+ .
+ Fix old-style catch in yaws_server.erl that caused a compilation
+ warning under Erlang/OTP 20.0 (Steve).
+ .
+ Remove an old zlib workaround in yaws_zlib.erl, as it's no longer
+ needed (Christopher).
+ .
+ [PATCH] Simplified the rand/0 function by relying on yaws_dynopts
+ module in all cases.
+
+--- a/src/yaws_server.erl
++++ b/src/yaws_server.erl
+@@ -2127,21 +2127,7 @@ handle_auth(ARG, _Auth_H, Auth_methods=#auth{users=[],pam=false,mod=[]}, Ret) ->
+     {Ret, Auth_methods};
+ 
+ handle_auth(ARG, Auth_H, Auth_methods = #auth{mod = Mod}, Ret) when Mod /= [] ->
+-    case catch Mod:auth(ARG, Auth_methods) of
+-        {'EXIT', Reason} ->
+-            L = ?F("authmod crashed ~n~p:auth(~p, ~n ~p) \n"
+-                   "Reason: ~p~n"
+-                   "Stack: ~p~n",
+-                   [Mod, ARG, Auth_methods, Reason,
+-                    erlang:get_stacktrace()]),
+-            handle_crash(ARG, L),
+-            CliSock = case yaws_api:get_sslsocket(ARG#arg.clisock) of
+-                          {ok, SslSock} -> SslSock;
+-                          undefined     -> ARG#arg.clisock
+-                      end,
+-            deliver_accumulated(CliSock),
+-            exit(normal);
+-
++    try Mod:auth(ARG, Auth_methods) of
+         %% appmod means the auth headers are undefined, i.e. false.
+         %% TODO: change so that authmods simply return true/false
+         {true, User} ->
+@@ -2160,6 +2146,20 @@ handle_auth(ARG, Auth_H, Auth_methods = #auth{mod = Mod}, Ret) when Mod /= [] ->
+         _ ->
+             maybe_auth_log(403, ARG),
+             false_403
++    catch
++        _:Reason ->
++            L = ?F("authmod crashed ~n~p:auth(~p, ~n ~p) \n"
++                   "Reason: ~p~n"
++                   "Stack: ~p~n",
++                   [Mod, ARG, Auth_methods, Reason,
++                    erlang:get_stacktrace()]),
++            handle_crash(ARG, L),
++            CliSock = case yaws_api:get_sslsocket(ARG#arg.clisock) of
++                          {ok, SslSock} -> SslSock;
++                          undefined     -> ARG#arg.clisock
++                      end,
++            deliver_accumulated(CliSock),
++            exit(normal)
+     end;
+ 
+ %% if the headers are undefined we do not need to check Pam or Users
+--- a/src/yaws_zlib.erl
++++ b/src/yaws_zlib.erl
+@@ -44,7 +44,7 @@ gzipDeflate(Z, undefined, Bin, Flush) ->
+ 
+ gzipDeflate(Z, {Crc32,Size}, Bin, Flush) ->
+     Bs = zlib:deflate(Z, Bin, Flush),
+-    {ok, Crc1} = crc32(Z, Crc32, Bin),
++    Crc1 = zlib:crc32(Z, Crc32, Bin),
+     Size1 = Size+size(Bin),
+     Data =
+         if
+@@ -101,12 +101,3 @@ gzip_loop(Z, P, [], C, A) ->
+     gzip_loop(Z, P, C, [], A);
+ gzip_loop(Z, P, I, C, A) when is_integer(I) ->
+     gzip_loop(Z, P, <<I>>, C, A).
+-
+-
+-%% To work around a bug in zlib.
+-
+-crc32(Z, CRC, Binary) ->
+-    case port_control(Z, 17, <<CRC:32, Binary/binary>>) of
+-        [2,A,B,C,D] -> {ok, (A bsl 24)+(B bsl 16)+(C bsl 8)+D}
+-    end.
+-
+--- a/testsuite/testsuite.erl
++++ b/testsuite/testsuite.erl
+@@ -457,7 +457,13 @@ set_default_sockopts(https, SockOpts) ->
+                     {verify, _} -> SockOpts;
+                     false       -> [{verify, verify_none}|SockOpts]
+                 end,
+-    set_default_sockopts(http, SockOpts1);
++    %% Explicitly disable SNI if not set because in Erlang/OTP 20.0, it is set
++    %% by default to the Host value used in ssl:connect/4.
++    SockOpts2 = case lists:keyfind(server_name_indication, 1, SockOpts1) of
++                    {server_name_indication, _} -> SockOpts1;
++                    false -> [{server_name_indication, disable}|SockOpts1]
++                end,
++    set_default_sockopts(http, SockOpts2);
+ set_default_sockopts(http, SockOpts) ->
+     [binary, {active, false}|SockOpts].
+ 
+--- a/src/yaws_ctl.erl
++++ b/src/yaws_ctl.erl
+@@ -54,23 +54,9 @@ run(GC) ->
+     end.
+ 
+ rand() ->
+-    case os:type() of
+-        {win32, _} ->
+-            {A1, A2, A3}=yaws:get_time_tuple(),
+-            yaws_dynopts:random_seed(A1, A2, A3),
+-            yaws_dynopts:random_uniform(1 bsl 64);
+-        _ ->
+-            try
+-                crypto:start(),
+-                crypto:rand_uniform(0, 1 bsl 64)
+-            catch
+-                _:_ ->
+-                    error_logger:warning_msg("Running without crypto app\n"),
+-                    {A1, A2, A3}=yaws:get_time_tuple(),
+-                    yaws_dynopts:random_seed(A1, A2, A3),
+-                    yaws_dynopts:random_uniform(1 bsl 64)
+-            end
+-    end.
++    {A1, A2, A3} = yaws:get_time_tuple(),
++    yaws_dynopts:random_seed(A1, A2, A3),
++    yaws_dynopts:random_uniform(1 bsl 64).
+ 
+ 
+ 

Modified: yaws/trunk/debian/patches/series
===================================================================
--- yaws/trunk/debian/patches/series	2017-07-08 07:40:16 UTC (rev 1940)
+++ yaws/trunk/debian/patches/series	2017-07-10 08:39:16 UTC (rev 1941)
@@ -1 +1,2 @@
-# Nothing here
+e20.patch
+e20-2.patch




More information about the Pkg-erlang-commits mailing list