From 5e9d05198cd00f74b99f697eb022ae0b2f31f136 Mon Sep 17 00:00:00 2001 From: Sam Bobroff Date: Tue, 18 May 2010 11:49:08 +1000 Subject: 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. --- lib/tools/src/make.erl | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'lib/tools') 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) -> -- cgit v1.2.3 From 7ed11a886fc8fcaf3c2b8324294e2f24e02b0f28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Holger=20Wei=C3=9F?= Date: Mon, 15 Nov 2010 12:05:16 +0100 Subject: Call chmod without the "-f" flag "-f" is a non-standard chmod option which at least SGI IRIX and HP UX do not support. As the only effect of the "-f" flag is to suppress warning messages, it can be safely omitted. --- lib/tools/test/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/tools') diff --git a/lib/tools/test/Makefile b/lib/tools/test/Makefile index 3a59be758a..65060d1346 100644 --- a/lib/tools/test/Makefile +++ b/lib/tools/test/Makefile @@ -85,7 +85,7 @@ release_spec: opt release_tests_spec: make_emakefile $(INSTALL_DIR) $(RELSYSDIR) $(INSTALL_DATA) $(SPEC_FILES) $(EMAKEFILE) $(ERL_FILES) $(RELSYSDIR) - chmod -f -R u+w $(RELSYSDIR) + chmod -R u+w $(RELSYSDIR) @tar cf - *_SUITE_data | (cd $(RELSYSDIR); tar xf -) release_docs_spec: -- cgit v1.2.3