diff options
author | Sam Bobroff <samb@m5networks.com.au> | 2010-05-18 11:49:08 +1000 |
---|---|---|
committer | Raimo Niskanen <raimo@erlang.org> | 2010-05-19 09:36:18 +0200 |
commit | 5e9d05198cd00f74b99f697eb022ae0b2f31f136 (patch) | |
tree | f6db9516af3cd534bb4bd499c7a1d61a822e4b62 /lib/tools | |
parent | 5fe8d47a60c89f1235f9fc727e650ada491246a3 (diff) | |
download | erlang-5e9d05198cd00f74b99f697eb022ae0b2f31f136.tar.gz |
Change make:files to behave more like erlc
Currently make:files will fail with the atom 'error' and
no message when the input (.erl) file is unreadable or the
output (.beam) file is unwritable. This differs from erlc
which will print a useful error message, or when possible,
remove the unwritable output file and continue successfully.
This change removes the unnecessary checks on the files when
make:files is called and allows the error checking to be
done in compile:file, where the error messages are produced.
It does not affect the return value.
In particular this resolves the mysterious problem of make:files
failing but erlc succeeding, caused by an unwritable (usually
root owned) beam file in an otherwise writable build directory.
Diffstat (limited to 'lib/tools')
-rw-r--r-- | lib/tools/src/make.erl | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/lib/tools/src/make.erl b/lib/tools/src/make.erl index 77c354651b..e78e2a43a4 100644 --- a/lib/tools/src/make.erl +++ b/lib/tools/src/make.erl @@ -222,12 +222,7 @@ recompilep(File, NoExec, Load, Opts) -> recompilep1(File, NoExec, Load, Opts, ObjFile) -> {ok, Erl} = file:read_file_info(lists:append(File, ".erl")), {ok, Obj} = file:read_file_info(ObjFile), - case {readable(Erl), writable(Obj)} of - {true, true} -> - recompilep1(Erl, Obj, File, NoExec, Load, Opts); - _ -> - error - end. + recompilep1(Erl, Obj, File, NoExec, Load, Opts). recompilep1(#file_info{mtime=Te}, #file_info{mtime=To}, File, NoExec, Load, Opts) when Te>To -> @@ -277,14 +272,6 @@ exists(File) -> false end. -readable(#file_info{access=read_write}) -> true; -readable(#file_info{access=read}) -> true; -readable(_) -> false. - -writable(#file_info{access=read_write}) -> true; -writable(#file_info{access=write}) -> true; -writable(_) -> false. - coerce_2_list(X) when is_atom(X) -> atom_to_list(X); coerce_2_list(X) -> |