diff options
author | Björn Gustavsson <[email protected]> | 2013-01-10 07:27:20 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2013-01-10 07:27:20 +0100 |
commit | 34d865a7dfdb33ee1e69fc28885f68baeeadfd98 (patch) | |
tree | ed59257e66ac052cbf6757f2219b3d1e71dcefac /lib/sasl/src/systools_make.erl | |
parent | a409316b490b5d61a8d6a1d6acd764b61412ed4c (diff) | |
parent | 66846d0dbcb6e21c9d22a6e9096ff5e17850d346 (diff) | |
download | otp-34d865a7dfdb33ee1e69fc28885f68baeeadfd98.tar.gz otp-34d865a7dfdb33ee1e69fc28885f68baeeadfd98.tar.bz2 otp-34d865a7dfdb33ee1e69fc28885f68baeeadfd98.zip |
Merge branch 'bjorn/remove-packages/OTP-10348'
* bjorn/remove-packages/OTP-10348: (22 commits)
kernel: Remove the packages module
kernel: Eliminate use of packages in code and code_server
edoc: Remove support for packages
syntax_tools: Remove support for packages
reltool: Remove support for packages
test_server: Remove support for packages
sasl: Remove support for packages
debugger: Remove support for packages
c: Remove support for packages
filename: Remove support for packages
erl_pp_SUITE: Remove test of packages
shell: Remove support for packages
erl_parse: Remove support for packages
qlc: Remove support for packages
erl_eval: Remove support for packages
erl_expand_records: Remove support for packages
erl_lint: Remove support for packages
compiler: Remove support for packages
erts: Remove the packages aliases for BIFs
erl_expand_records_SUITE: Eliminate use of packages
...
Diffstat (limited to 'lib/sasl/src/systools_make.erl')
-rw-r--r-- | lib/sasl/src/systools_make.erl | 40 |
1 files changed, 8 insertions, 32 deletions
diff --git a/lib/sasl/src/systools_make.erl b/lib/sasl/src/systools_make.erl index 29c4a0d168..9b2e2c809b 100644 --- a/lib/sasl/src/systools_make.erl +++ b/lib/sasl/src/systools_make.erl @@ -1067,11 +1067,10 @@ check_mod(Mod,App,Dir,Ext,IncPath) -> end. mod_to_filename(Dir, Mod, Ext) -> - Parts = packages:split(Mod), - filename:join([Dir | Parts]) ++ Ext. + filename:join(Dir, atom_to_list(Mod) ++ Ext). check_module(Mod, Dir, ObjModTime, IncPath) -> - {SrcDirs,_IncDirs}= smart_guess(Mod, Dir,IncPath), + {SrcDirs,_IncDirs}= smart_guess(Dir,IncPath), case locate_src(Mod,SrcDirs) of {ok,_FDir,_File,LastModTime} -> if @@ -1085,7 +1084,7 @@ check_module(Mod, Dir, ObjModTime, IncPath) -> end. locate_src(Mod,[Dir|Dirs]) -> - File = filename:join(Dir, mod_to_fname(Mod) ++ ".erl"), + File = mod_to_filename(Dir, Mod, ".erl"), case file:read_file_info(File) of {ok,FileInfo} -> LastModTime = FileInfo#file_info.mtime, @@ -1096,9 +1095,6 @@ locate_src(Mod,[Dir|Dirs]) -> locate_src(_,[]) -> false. -mod_to_fname(Mod) -> - hd(lists:reverse(packages:split(Mod))). - %%______________________________________________________________________ %% smart_guess(Mod, Dir,IncludePath) -> {[Dirs],[IncDirs]} @@ -1106,17 +1102,12 @@ mod_to_fname(Mod) -> %% src-dir should be one of .../src or .../src/e_src %% If dir does not contain .../ebin set dir to the same directory. -smart_guess(Mod, Dir,IncPath) -> +smart_guess(Dir,IncPath) -> case reverse(filename:split(Dir)) of ["ebin"|D] -> - Subdirs = case packages:split(Mod) of - [_] -> []; - [_|_] = Parts -> - lists:reverse(tl(lists:reverse(Parts))) - end, D1 = reverse(D), - Dirs = [filename:join(D1 ++ ["src" | Subdirs]), - filename:join(D1 ++ ["src", "e_src" | Subdirs])], + Dirs = [filename:join(D1 ++ ["src"]), + filename:join(D1 ++ ["src", "e_src"])], {Dirs,Dirs ++ IncPath}; _ -> {[Dir],[Dir] ++ IncPath} @@ -1423,23 +1414,8 @@ load_appl_mods([], _, _, _) -> [{progress, modules_loaded}]. load_commands(Mods, Path) -> - SplitMods = lists:foldl( - fun({Parts,M}, [{Last, Acc}|Rest]) -> - [_|Tail] = lists:reverse(Parts), - case lists:reverse(Tail) of - Subs when Subs == Last -> - [{Last,[M|Acc]}|Rest]; - Subs -> - [{Subs, [M]}|[{Last,Acc}|Rest]] - end - end, [{[],[]}], - lists:sort([{packages:split(M),M} || M <- Mods])), - lists:foldl( - fun({Subs,Ms}, Cmds) -> - [{path, [filename:join([Path | Subs])]}, - {primLoad,lists:sort(Ms)} | Cmds] - end, [], SplitMods). - + [{path, [filename:join([Path])]}, + {primLoad,lists:sort(Mods)}]. %%______________________________________________________________________ %% Pack an application to an application term. |