diff options
| author | Jean-Sébastien Pédron <jean-sebastien@rabbitmq.com> | 2015-09-10 15:46:38 +0200 |
|---|---|---|
| committer | Jean-Sébastien Pédron <jean-sebastien.pedron@dumbbell.fr> | 2015-10-20 11:10:48 +0200 |
| commit | 008e65f958c925090ce0559a94482283ed098f5b (patch) | |
| tree | 39b60f79046433d0a2a67ebaf0e177c266c7cff6 | |
| parent | b31818b598767f7c8b0109c58a37a6d626ca4abf (diff) | |
| download | rabbitmq-server-git-008e65f958c925090ce0559a94482283ed098f5b.tar.gz | |
Remove unused scripts & Makefiles
| -rwxr-xr-x | calculate-relative | 45 | ||||
| -rw-r--r-- | generate_app | 16 | ||||
| -rw-r--r-- | generate_deps | 57 | ||||
| -rw-r--r-- | version.mk | 1 |
4 files changed, 0 insertions, 119 deletions
diff --git a/calculate-relative b/calculate-relative deleted file mode 100755 index 3af18e8ff8..0000000000 --- a/calculate-relative +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env python -# -# relpath.py -# R.Barran 30/08/2004 -# Retrieved from http://code.activestate.com/recipes/302594/ - -import os -import sys - -def relpath(target, base=os.curdir): - """ - Return a relative path to the target from either the current dir or an optional base dir. - Base can be a directory specified either as absolute or relative to current dir. - """ - - if not os.path.exists(target): - raise OSError, 'Target does not exist: '+target - - if not os.path.isdir(base): - raise OSError, 'Base is not a directory or does not exist: '+base - - base_list = (os.path.abspath(base)).split(os.sep) - target_list = (os.path.abspath(target)).split(os.sep) - - # On the windows platform the target may be on a completely different drive from the base. - if os.name in ['nt','dos','os2'] and base_list[0] <> target_list[0]: - raise OSError, 'Target is on a different drive to base. Target: '+target_list[0].upper()+', base: '+base_list[0].upper() - - # Starting from the filepath root, work out how much of the filepath is - # shared by base and target. - for i in range(min(len(base_list), len(target_list))): - if base_list[i] <> target_list[i]: break - else: - # If we broke out of the loop, i is pointing to the first differing path elements. - # If we didn't break out of the loop, i is pointing to identical path elements. - # Increment i so that in all cases it points to the first differing path elements. - i+=1 - - rel_list = [os.pardir] * (len(base_list)-i) + target_list[i:] - if (len(rel_list) == 0): - return "." - return os.path.join(*rel_list) - -if __name__ == "__main__": - print(relpath(sys.argv[1], sys.argv[2])) diff --git a/generate_app b/generate_app deleted file mode 100644 index fb0eb1ea62..0000000000 --- a/generate_app +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env escript -%% -*- erlang -*- - -main([InFile, OutFile | SrcDirs]) -> - Modules = [list_to_atom(filename:basename(F, ".erl")) || - SrcDir <- SrcDirs, - F <- filelib:wildcard("*.erl", SrcDir)], - {ok, [{application, Application, Properties}]} = file:consult(InFile), - NewProperties = - case proplists:get_value(modules, Properties) of - [] -> lists:keyreplace(modules, 1, Properties, {modules, Modules}); - _ -> Properties - end, - file:write_file( - OutFile, - io_lib:format("~p.~n", [{application, Application, NewProperties}])). diff --git a/generate_deps b/generate_deps deleted file mode 100644 index ddfca816b4..0000000000 --- a/generate_deps +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env escript -%% -*- erlang -*- --mode(compile). - -%% We expect the list of Erlang source and header files to arrive on -%% stdin, with the entries colon-separated. -main([TargetFile, EbinDir]) -> - ErlsAndHrls = [ string:strip(S,left) || - S <- string:tokens(io:get_line(""), ":\n")], - ErlFiles = [F || F <- ErlsAndHrls, lists:suffix(".erl", F)], - Modules = sets:from_list( - [list_to_atom(filename:basename(FileName, ".erl")) || - FileName <- ErlFiles]), - HrlFiles = [F || F <- ErlsAndHrls, lists:suffix(".hrl", F)], - IncludeDirs = lists:usort([filename:dirname(Path) || Path <- HrlFiles]), - Headers = sets:from_list(HrlFiles), - Deps = lists:foldl( - fun (Path, Deps1) -> - dict:store(Path, detect_deps(IncludeDirs, EbinDir, - Modules, Headers, Path), - Deps1) - end, dict:new(), ErlFiles), - {ok, Hdl} = file:open(TargetFile, [write, delayed_write]), - dict:fold( - fun (_Path, [], ok) -> - ok; - (Path, Dep, ok) -> - Module = filename:basename(Path, ".erl"), - ok = file:write(Hdl, [EbinDir, "/", Module, ".beam: ", - Path]), - ok = sets:fold(fun (E, ok) -> file:write(Hdl, [" ", E]) end, - ok, Dep), - file:write(Hdl, ["\n"]) - end, ok, Deps), - ok = file:write(Hdl, [TargetFile, ": ", escript:script_name(), "\n"]), - ok = file:sync(Hdl), - ok = file:close(Hdl). - -detect_deps(IncludeDirs, EbinDir, Modules, Headers, Path) -> - {ok, Forms} = epp:parse_file(Path, IncludeDirs, [{use_specs, true}]), - lists:foldl( - fun ({attribute, _LineNumber, Attribute, Behaviour}, Deps) - when Attribute =:= behaviour orelse Attribute =:= behavior -> - case sets:is_element(Behaviour, Modules) of - true -> sets:add_element( - [EbinDir, "/", atom_to_list(Behaviour), ".beam"], - Deps); - false -> Deps - end; - ({attribute, _LineNumber, file, {FileName, _LineNumber1}}, Deps) -> - case sets:is_element(FileName, Headers) of - true -> sets:add_element(FileName, Deps); - false -> Deps - end; - (_Form, Deps) -> - Deps - end, sets:new(), Forms). diff --git a/version.mk b/version.mk deleted file mode 100644 index 5683af4a2f..0000000000 --- a/version.mk +++ /dev/null @@ -1 +0,0 @@ -VERSION?=0.0.0 |
