Package: tsung
Version: 1.4.1-1
Severity: normal
Tags: patch

Hi!

Tsung builder script doesn't work well with Erlang R15B, which I'd like to
upload to Debian sid sometimes.

The attached patch fixes it. If you don't mind I'd like to do NMU to
experimental (where the Erlang R15B is currently) and then the second one to
unstable after the R15B will go there.

-- System Information:
Debian Release: 6.0.3
  APT prefers proposed-updates
  APT policy: (990, 'proposed-updates'), (990, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-5-686-bigmem (SMP w/8 CPU cores)
Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages tsung depends on:
ii  erlang-base               1:15.b-dfsg-1~ Erlang/OTP virtual machine and bas
ii  erlang-nox                1:15.b-dfsg-1~ Erlang/OTP applications that don't

Versions of packages tsung recommends:
ii  gnuplot                4.4.0-1.1         A command-line driven interactive 
ii  libtemplate-perl       2.22-0.1          template processing system written
ii  perl                   5.10.1-17squeeze2 Larry Wall's Practical Extraction 
pn  ssh                    <none>            (no description available)

tsung suggests no packages.
diff -Nru tsung-1.4.1/debian/changelog tsung-1.4.1/debian/changelog
--- tsung-1.4.1/debian/changelog	2011-11-16 19:26:51.000000000 +0400
+++ tsung-1.4.1/debian/changelog	2011-12-25 12:24:24.000000000 +0400
@@ -1,3 +1,10 @@
+tsung (1.4.1-1.1) experimental; urgency=low
+
+  * Non-maintainer upload.
+  * Fixes build script compatibility with Erlang R15B.
+
+ -- Sergei Golovan <sgolo...@debian.org>  Sun, 25 Dec 2011 02:38:14 +0400
+
 tsung (1.4.1-1) unstable; urgency=low
 
   * Initial release. (Closes: #317568)
diff -Nru tsung-1.4.1/debian/patches/02_r15b_compatibility.diff tsung-1.4.1/debian/patches/02_r15b_compatibility.diff
--- tsung-1.4.1/debian/patches/02_r15b_compatibility.diff	1970-01-01 03:00:00.000000000 +0300
+++ tsung-1.4.1/debian/patches/02_r15b_compatibility.diff	2011-12-25 12:21:12.000000000 +0400
@@ -0,0 +1,130 @@
+Description: Patch fixes build script compatibility with Erlang R15B.
+Author: Sergei Golovan <sgolo...@debian.org>
+Last-Update: Sun, 25 Dec 2011 12:19:58 +0400
+
+--- tsung-1.4.1.orig/priv/builder.erl
++++ tsung-1.4.1/priv/builder.erl
+@@ -500,7 +500,7 @@ try_get_config(AppName, Ebin, Dict) ->
+ get_config_data({file,F}) ->
+     ?report(debug, "get_config_data({file, ~p})~n", [F]),
+     case file:consult(F) of
+-	{ok, [Terms]} when list(Terms) ->
++	{ok, [Terms]} when is_list(Terms) ->
+ 	    Terms;
+ 	{error, Reason} ->
+ 	    exit({config, {F, Reason}})
+@@ -508,7 +508,7 @@ get_config_data({file,F}) ->
+ get_config_data({M,F,A}) ->
+     ?report(debug, "get_config_data(~p)~n", [{M,F,A}]),
+     apply(M,F,A);
+-get_config_data(Data) when list(Data) ->
++get_config_data(Data) when is_list(Data) ->
+     Data.
+ 
+ 
+@@ -742,8 +742,8 @@ sh_script(Fname, Mode,Dict) ->
+ 		    []
+ 	    end,
+     OptionalSname =
+-	case regexp:match(XOpts, "-sname") of
+-	    {match,_,_} -> false;
++	case re:run(XOpts, "-sname") of
++	    {match,_} -> false;
+ 	    nomatch -> true
+ 	end,
+     ?report(debug, "OptionalSname (~p) = ~p~n", [XOpts, OptionalSname]),
+@@ -993,8 +993,8 @@ parse_mod_expr1({record_field,_,R,{atom,
+ 
+ 
+ check_f(F, Ext) -> 
+-    case regexp:match(F, ".*"++Ext++"\$") of
+-	{match, _, _} -> true;
++    case re:run(F, ".*"++Ext++"\$") of
++	{match, _} -> true;
+ 	_ -> false
+     end.
+ 
+@@ -1028,7 +1028,7 @@ merge_apps(RelApps, AppApps, AppInfo) ->
+ 			     App;
+ 			({App,Vsn}) ->
+ 			     App;
+-			(App) when atom(App) ->
++			(App) when is_atom(App) ->
+ 			     App
+ 		     end, RelApps),
+     with(Acc0,
+@@ -1057,7 +1057,7 @@ app_info(Apps, Dict) ->
+     MyVsn = dict:fetch(app_vsn, Dict),
+     MyEbin = ebin_dir(Dict),
+     Info = lists:map(
+-	     fun(A) when atom(A) -> {A,unknown,unknown};
++	     fun(A) when is_atom(A) -> {A,unknown,unknown};
+ 		({A,V})          -> {A,V,unknown};
+ 		({A,V,D})        -> {A,V,D}
+ 	     end, Apps),
+@@ -1344,8 +1344,17 @@ d_expand(Ds) ->
+     d_expand(Ds, [Cwd]).
+ 
+ 
++replace_spec(P) ->
++    replace_spec(P, []).
++replace_spec([], Pat) ->
++    lists:reverse(Pat);
++replace_spec([$.|T], Pat) ->
++    replace_spec(T, [$.,$\\|Pat]);
++replace_spec([H|T], Pat) ->
++    replace_spec(T, [H|Pat]).
++
+ d_expand([D|Ds], Cur) ->
+-    Pat = regexp:sh_to_awk(D),
++    Pat = replace_spec(D),
+     Cur1 = lists:foldl(
+ 	     fun(C, Acc) ->
+ 		     case list_dir(C) of
+@@ -1363,8 +1372,8 @@ d_expand([], Cur) ->
+     Cur.
+ 
+ matches(Str, Pat) ->
+-    case regexp:match(Str,Pat) of
+-	{match,_,_} ->
++    case re:run(Str,Pat) of
++	{match,_} ->
+ 	    true;
+ 	nomatch ->
+ 	    false
+@@ -1401,14 +1410,14 @@ apps(Apps, Dict) ->
+     do_apps(Apps, Vss).
+ 
+ app(D) ->
+-    case regexp:match(D,".*-[0-9].*") of
++    case re:run(D,".*-[0-9].*") of
+ 	nomatch -> false;
+ 	_ -> true
+     end.
+ do_apps([], Vss) -> [];
+-do_apps([App|Apps], Vss) when list(App) -> 
++do_apps([App|Apps], Vss) when is_list(App) -> 
+     do_apps([list_to_atom(App)|Apps], Vss);
+-do_apps([App|Apps], Vss) when atom(App) ->
++do_apps([App|Apps], Vss) when is_atom(App) ->
+     [{App, get_vsn(atom_to_list(App), Vss)}|do_apps(Apps, Vss)].
+ 
+ 
+@@ -1442,7 +1451,7 @@ read_app_file(Dict) ->
+     App = case file:consult(AppF) of
+ 	      {ok, [{application, _Name, Options}]} ->
+ 		  app_options(Options);
+-	      {ok, [Options]} when list(Options) ->
++	      {ok, [Options]} when is_list(Options) ->
+ 		  app_options(Options);
+ 	      {error, enoent} ->
+ 		  RealAppF = filename:join(ebin_dir(Dict), 
+@@ -1590,7 +1599,7 @@ rpt_level(none) -> 0;
+ rpt_level(progress) -> 1;
+ rpt_level(verbose) -> 2;
+ rpt_level(debug) -> 3;
+-rpt_level(N) when integer(N), N >= 0 ->
++rpt_level(N) when is_integer(N), N >= 0 ->
+     N.
+     
+ push_report_level(Level, Dict) ->
diff -Nru tsung-1.4.1/debian/patches/series tsung-1.4.1/debian/patches/series
--- tsung-1.4.1/debian/patches/series	2011-11-16 19:27:02.000000000 +0400
+++ tsung-1.4.1/debian/patches/series	2011-12-25 12:18:44.000000000 +0400
@@ -1 +1,2 @@
 01_spelling_corrections.diff
+02_r15b_compatibility.diff

Reply via email to