aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tools/src/make.erl
diff options
context:
space:
mode:
authorSam Bobroff <[email protected]>2010-05-18 11:49:08 +1000
committerRaimo Niskanen <[email protected]>2010-05-19 09:36:18 +0200
commit5e9d05198cd00f74b99f697eb022ae0b2f31f136 (patch)
treef6db9516af3cd534bb4bd499c7a1d61a822e4b62 /lib/tools/src/make.erl
parent5fe8d47a60c89f1235f9fc727e650ada491246a3 (diff)
downloadotp-5e9d05198cd00f74b99f697eb022ae0b2f31f136.tar.gz
otp-5e9d05198cd00f74b99f697eb022ae0b2f31f136.tar.bz2
otp-5e9d05198cd00f74b99f697eb022ae0b2f31f136.zip
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/src/make.erl')
-rw-r--r--lib/tools/src/make.erl15
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) ->