diff options
author | HÃ¥kan Mattsson <[email protected]> | 2010-01-27 10:04:32 +0000 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2010-01-27 10:04:32 +0000 |
commit | 50cc08bfabb0510ebf42170650217dfeec229ce7 (patch) | |
tree | 669bcb53eb07450a513e07fad0d5ba5165e9ee7f /lib/kernel/src | |
parent | cdc1bdc2ad424deb1e1a158455d5e6845b5ce874 (diff) | |
download | otp-50cc08bfabb0510ebf42170650217dfeec229ce7.tar.gz otp-50cc08bfabb0510ebf42170650217dfeec229ce7.tar.bz2 otp-50cc08bfabb0510ebf42170650217dfeec229ce7.zip |
OTP-8387 Explicit top directories in archive files are now optional.
For example, if an archive (app-vsn.ez) just contains an
app-vsn/ebin/mod.beam file, the file info for the app-vsn and
app-vsn/ebin directories are faked using the file info from the
archive file as origin. The virtual direcories can also be
listed. For short, the top directories are virtual if they does
not exist.
Diffstat (limited to 'lib/kernel/src')
-rw-r--r-- | lib/kernel/src/code.erl | 24 | ||||
-rw-r--r-- | lib/kernel/src/code_server.erl | 14 |
2 files changed, 21 insertions, 17 deletions
diff --git a/lib/kernel/src/code.erl b/lib/kernel/src/code.erl index fef11d7e6e..89d893f8c1 100644 --- a/lib/kernel/src/code.erl +++ b/lib/kernel/src/code.erl @@ -1,19 +1,19 @@ %% %% %CopyrightBegin% -%% -%% Copyright Ericsson AB 1996-2009. All Rights Reserved. -%% +%% +%% Copyright Ericsson AB 1996-2010. All Rights Reserved. +%% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Public License along with this software. If not, it can be %% retrieved online at http://www.erlang.org/. -%% +%% %% Software distributed under the License is distributed on an "AS IS" %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See %% the License for the specific language governing rights and limitations %% under the License. -%% +%% %% %CopyrightEnd% %% -module(code). @@ -63,7 +63,7 @@ which/1, where_is_file/1, where_is_file/2, - set_primary_archive/2, + set_primary_archive/3, clash/0]). -include_lib("kernel/include/file.hrl"). @@ -101,7 +101,7 @@ %% unstick_dir(Dir) -> ok | error %% is_sticky(Module) -> true | false %% which(Module) -> Filename -%% set_primary_archive((FileName, Bin) -> ok | {error, Reason} +%% set_primary_archive((FileName, Bin, FileInfo) -> ok | {error, Reason} %% clash() -> -> print out %%---------------------------------------------------------------------------- @@ -420,11 +420,15 @@ where_is_file(Path, File) when is_list(Path), is_list(File) -> which(File, ".", Path) end. --spec set_primary_archive(ArchiveFile :: file:filename(), ArchiveBin :: binary()) -> 'ok' | {'error', atom()}. +-spec set_primary_archive(ArchiveFile :: file:filename(), + ArchiveBin :: binary(), + FileInfo :: #file_info{}) + -> 'ok' | {'error', atom()}. -set_primary_archive(ArchiveFile0, ArchiveBin) when is_list(ArchiveFile0), is_binary(ArchiveBin) -> +set_primary_archive(ArchiveFile0, ArchiveBin, FileInfo) + when is_list(ArchiveFile0), is_binary(ArchiveBin), is_record(FileInfo, file_info) -> ArchiveFile = filename:absname(ArchiveFile0), - case call({set_primary_archive, ArchiveFile, ArchiveBin}) of + case call({set_primary_archive, ArchiveFile, ArchiveBin, FileInfo}) of {ok, []} -> ok; {ok, _Mode, Ebins} -> diff --git a/lib/kernel/src/code_server.erl b/lib/kernel/src/code_server.erl index d4e3f0bcf8..7aeddb73d1 100644 --- a/lib/kernel/src/code_server.erl +++ b/lib/kernel/src/code_server.erl @@ -1,19 +1,19 @@ %% %% %CopyrightBegin% -%% -%% Copyright Ericsson AB 1998-2009. All Rights Reserved. -%% +%% +%% Copyright Ericsson AB 1998-2010. All Rights Reserved. +%% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Public License along with this software. If not, it can be %% retrieved online at http://www.erlang.org/. -%% +%% %% Software distributed under the License is distributed on an "AS IS" %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See %% the License for the specific language governing rights and limitations %% under the License. -%% +%% %% %CopyrightEnd% %% -module(code_server). @@ -384,8 +384,8 @@ handle_call(stop,{_From,_Tag}, S) -> handle_call({is_cached,_File}, {_From,_Tag}, S=#state{cache=no_cache}) -> {reply, no, S}; -handle_call({set_primary_archive, File, ArchiveBin}, {_From,_Tag}, S=#state{mode=Mode}) -> - case erl_prim_loader:set_primary_archive(File, ArchiveBin) of +handle_call({set_primary_archive, File, ArchiveBin, FileInfo}, {_From,_Tag}, S=#state{mode=Mode}) -> + case erl_prim_loader:set_primary_archive(File, ArchiveBin, FileInfo) of {ok, Files} -> {reply, {ok, Mode, Files}, S}; {error, Reason} -> |