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

sgolovan at alioth.debian.org sgolovan at alioth.debian.org
Thu Dec 15 18:37:15 UTC 2011


Author: sgolovan
Date: 2011-12-15 18:37:15 +0000 (Thu, 15 Dec 2011)
New Revision: 1365

Added:
   yaws/trunk/debian/patches/regexp.diff
Modified:
   yaws/trunk/debian/changelog
   yaws/trunk/debian/patches/series
Log:
[yaws]
  * Added patch which moves from regexp to re module because the former
    is removed from Erlang R15B.


Modified: yaws/trunk/debian/changelog
===================================================================
--- yaws/trunk/debian/changelog	2011-12-15 17:49:48 UTC (rev 1364)
+++ yaws/trunk/debian/changelog	2011-12-15 18:37:15 UTC (rev 1365)
@@ -1,8 +1,10 @@
 yaws (1.91-2~squeeze2) experimental; urgency=low
 
   * Added patch which fixes loading external drivers in Erlang R15B.
+  * Added patch which moves from regexp to re module because the former
+    is removed from Erlang R15B.
 
- -- Sergei Golovan <sgolovan at debian.org>  Thu, 15 Dec 2011 21:49:18 +0400
+ -- Sergei Golovan <sgolovan at debian.org>  Thu, 15 Dec 2011 22:36:44 +0400
 
 yaws (1.91-2) unstable; urgency=high
 

Added: yaws/trunk/debian/patches/regexp.diff
===================================================================
--- yaws/trunk/debian/patches/regexp.diff	                        (rev 0)
+++ yaws/trunk/debian/patches/regexp.diff	2011-12-15 18:37:15 UTC (rev 1365)
@@ -0,0 +1,146 @@
+Patch replaces regexp module by re one.
+
+--- yaws-1.91.orig/applications/wiki/src/wiki.erl
++++ yaws-1.91/applications/wiki/src/wiki.erl
+@@ -182,7 +182,7 @@
+             {wik002, Pwd,Email,Time,Who,TxtStr,Files,Patches} =
+                 bin_to_wik002(Root,FileDir,Bin),
+ 
+-            CurFiles = files(Root++"/"++FileDir, "*"),
++            CurFiles = files(Root++"/"++FileDir, "^"),
+ 
+             CurFileNames = [basename(CF) || CF <- CurFiles,
+                                             string:str(CF,"_wiki_thb")==0,
+@@ -215,7 +215,7 @@
+             {wik002, Pwd, Email, Time, Who, TxtStr, Files, Patches} =
+                 bin_to_wik002(Bin),
+ 
+-            CurFiles = files(FileDir, "*"),
++            CurFiles = files(FileDir, "^"),
+ 
+             CurFileNames = [basename(CF) || CF <- CurFiles],
+ 
+@@ -854,7 +854,7 @@
+     CpList = [input("hidden", "cp_"++Name, Name) ||
+                  {file, Name, _, _} <- CpFiles],
+ 
+-    PageFiles = sort(files(Root, "*.wob")),
++    PageFiles = sort(files(Root, "\\.wob$")),
+     Pages = [filename:basename(P,".wob") || P <- PageFiles, P /= File],
+ 
+     if
+@@ -1005,7 +1005,7 @@
+      i2s(Hour),":",i2s(Min),":",i2s(Sec)].
+ 
+ allPages(_, Root, Prefix) ->
+-    Files = sort(files(Root, "*.wob")),
++    Files = sort(files(Root, "\\.wob$")),
+     template2(Root, "All Pages", "All Pages",
+              [p("This is a list of all pages known to the system."),
+               lists:map(fun(I) ->
+@@ -1016,7 +1016,7 @@
+                         Files)], false).
+ 
+ lastEdited(_, Root, Prefix) ->
+-    Files = sort(files(Root, "*.wob")),
++    Files = sort(files(Root, "\\.wob$")),
+     S = lists:flatten(lists:map(fun(I) ->
+                                   "~" ++ filename:basename(I, ".wob") ++"\n\n"
+                           end, Files)),
+@@ -1155,7 +1155,7 @@
+     {File,FileDir} = page2filename(Page, Root),
+     case file:delete(File) of
+         ok ->
+-            Files = files(Root++"/"++FileDir, "*"),
++            Files = files(Root++"/"++FileDir, "^"),
+             [file:delete(F) || F <- Files],
+             file:del_dir(Root++"/"++FileDir),
+             redirect({node, "home"}, Prefix);
+@@ -1968,7 +1968,7 @@
+ 
+ 
+ ls(Root) ->
+-    Files = files(Root, "*.wob"),
++    Files = files(Root, "\\.wob$"),
+     lists:map(fun(I) -> filename:basename(I, ".wob") end, Files).
+ 
+ %%
+@@ -2008,7 +2008,7 @@
+ 
+ get_wiki_files(Root, FileDir) ->
+     Dir = Root ++ "/" ++ FileDir,
+-    files(Dir, "*").
++    files(Dir, "^").
+ 
+ %%
+ 
+@@ -2278,8 +2278,12 @@
+ %% MR: Is this really necessary ?
+ %%     We can now use filelib:fold_files/5
+ files(Dir, Re) ->
+-    Re1 = regexp:sh_to_awk(Re),
+-    find_files(Dir, Re1, []).
++    case re:compile(Re) of
++	{ok, Re1} ->
++	    find_files(Dir, Re1, []);
++	_ ->
++	    []
++    end.
+ 
+ find_files(Dir, Re, L) ->
+     case file:list_dir(Dir) of
+@@ -2291,8 +2295,8 @@
+     FullName = Dir ++  [$/|File],
+     case file_type(FullName) of
+         regular ->
+-            case regexp:match(FullName, Re) of
+-                {match, _, _}  ->
++            case re:run(FullName, Re) of
++                {match, _}  ->
+                     find_files(T, Dir, Re, [FullName|L]);
+                 _ ->
+                     find_files(T, Dir, Re, L)
+@@ -2443,7 +2447,7 @@
+         {"search", undefined, []} ->
+             [];
+         {"search", Search, []} ->
+-            case regexp:parse(Search) of
++            case re:compile(Search) of
+                 {ok, RE} ->
+                     Search;
+                 {error, Error} ->
+@@ -2476,7 +2480,7 @@
+                           [Error]))],
+                       false);
+         Search ->
+-            Files = sort(files(Root, "*.wob")),
++            Files = sort(files(Root, "\\.wob$")),
+             {Sres, _S} = lists:mapfoldl(fun(F, S) ->
+                                                 {searchPage(F, S), S} end,
+                                         Search, Files),
+@@ -2501,7 +2505,7 @@
+         {ok, Bin} ->
+             {wik002,_Pwd,_Email,_Time,_Who,Txt,_Files,_Patches} =
+                 bin_to_wik002(Bin),
+-            {match, Matches} = regexp:matches(Txt, Search),
++            {match, Matches} = re:run(Txt, Search),
+             {length(Matches), File};
+         _ ->
+             io:format("Error - failed to open ~s\n", [File]),
+--- yaws-1.91.orig/applications/wiki/src/utils.erl
++++ yaws-1.91/applications/wiki/src/utils.erl
+@@ -51,11 +51,11 @@
+ %% Wrapper for the original fold_files/5 behaviour.
+ 
+ fold_files(Dir, RegExp, Recursive, Fun, InitialAcc) ->
+-    {ok, CompiledRegExp} = regexp:parse(RegExp),
++    {ok, CompiledRegExp} = re:compile(RegExp),
+     Wrapper = fun
+                   (FullName, false, Acc) ->
+-                      NewAcc = case regexp:match(FullName, CompiledRegExp) of
+-                                   {match, _, _}  ->
++                      NewAcc = case re:run(FullName, CompiledRegExp) of
++                                   {match, _}  ->
+                                        Fun(FullName, Acc);
+                                    _ ->
+                                        Acc

Modified: yaws/trunk/debian/patches/series
===================================================================
--- yaws/trunk/debian/patches/series	2011-12-15 17:49:48 UTC (rev 1364)
+++ yaws/trunk/debian/patches/series	2011-12-15 18:37:15 UTC (rev 1365)
@@ -9,3 +9,4 @@
 m32m64.diff
 dirtraversal.diff
 driver.diff
+regexp.diff




More information about the Pkg-erlang-commits mailing list