aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src
diff options
context:
space:
mode:
authorHÃ¥kan Mattsson <[email protected]>2010-01-27 10:04:32 +0000
committerErlang/OTP <[email protected]>2010-01-27 10:04:32 +0000
commit50cc08bfabb0510ebf42170650217dfeec229ce7 (patch)
tree669bcb53eb07450a513e07fad0d5ba5165e9ee7f /lib/stdlib/src
parentcdc1bdc2ad424deb1e1a158455d5e6845b5ce874 (diff)
downloadotp-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/stdlib/src')
-rw-r--r--lib/stdlib/src/escript.erl13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/stdlib/src/escript.erl b/lib/stdlib/src/escript.erl
index 697a69b801..c0f71fb3f5 100644
--- a/lib/stdlib/src/escript.erl
+++ b/lib/stdlib/src/escript.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2007-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2007-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(escript).
@@ -180,7 +180,8 @@ parse_and_run(File, Args, Options) ->
is_binary(FormsOrBin) ->
case Source of
archive ->
- case code:set_primary_archive(File, FormsOrBin) of
+ {ok, FileInfo} = file:read_file_info(File),
+ case code:set_primary_archive(File, FormsOrBin, FileInfo) of
ok when CheckOnly ->
case code:load_file(Module) of
{module, _} ->