From 58fd80917a2fab2353bc19f9f4bc648d8e54db92 Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Fri, 7 Jan 2011 16:32:36 +0100 Subject: [PATCH] Fix file existence checks --- src/rebar_erlydtl_compiler.erl | 2 +- src/rebar_eunit.erl | 2 +- src/rebar_neotoma_compiler.erl | 2 +- src/rebar_rel_utils.erl | 2 +- src/rebar_templater.erl | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/rebar_erlydtl_compiler.erl b/src/rebar_erlydtl_compiler.erl index 6b2160c..b746642 100644 --- a/src/rebar_erlydtl_compiler.erl +++ b/src/rebar_erlydtl_compiler.erl @@ -174,7 +174,7 @@ referenced_dtls1(Step, Config, Seen) -> end, Step)), DocRoot = option(doc_root, DtlOpts), WithPaths = [ filename:join([DocRoot, F]) || F <- AllRefs ], - Existing = [F || F <- WithPaths, filelib:is_file(F)], + Existing = [F || F <- WithPaths, filelib:is_regular(F)], New = sets:subtract(sets:from_list(Existing), Seen), case sets:size(New) of 0 -> Seen; diff --git a/src/rebar_eunit.erl b/src/rebar_eunit.erl index 1341f9d..f1ddead 100644 --- a/src/rebar_eunit.erl +++ b/src/rebar_eunit.erl @@ -195,7 +195,7 @@ is_quickcheck_avail() -> {error, bad_name} -> IsAvail = false; Dir -> - IsAvail = filelib:is_file(filename:join(Dir, "eqc.hrl")) + IsAvail = filelib:is_regular(filename:join(Dir, "eqc.hrl")) end, erlang:put(is_quickcheck_avail, IsAvail), ?DEBUG("Quickcheck availability: ~p\n", [IsAvail]), diff --git a/src/rebar_neotoma_compiler.erl b/src/rebar_neotoma_compiler.erl index c2e6f0d..ce7a0d3 100644 --- a/src/rebar_neotoma_compiler.erl +++ b/src/rebar_neotoma_compiler.erl @@ -133,7 +133,7 @@ referenced_pegs1(Step, Config, Seen) -> end, Step)), DocRoot = option(doc_root, NeoOpts), WithPaths = [ filename:join([DocRoot, F]) || F <- AllRefs ], - Existing = [F || F <- WithPaths, filelib:is_file(F)], + Existing = [F || F <- WithPaths, filelib:is_regular(F)], New = sets:subtract(sets:from_list(Existing), Seen), case sets:size(New) of 0 -> Seen; diff --git a/src/rebar_rel_utils.erl b/src/rebar_rel_utils.erl index b955a53..978f9d6 100644 --- a/src/rebar_rel_utils.erl +++ b/src/rebar_rel_utils.erl @@ -33,7 +33,7 @@ is_rel_dir() -> is_rel_dir(Dir) -> Fname = filename:join([Dir, "reltool.config"]), - case filelib:is_file(Fname) of + case filelib:is_regular(Fname) of true -> {true, Fname}; false -> diff --git a/src/rebar_templater.erl b/src/rebar_templater.erl index b241fd5..748c8b6 100644 --- a/src/rebar_templater.erl +++ b/src/rebar_templater.erl @@ -259,7 +259,7 @@ render(Bin, Context) -> write_file(Output, Data, Force) -> %% determine if the target file already exists - FileExists = filelib:is_file(Output), + FileExists = filelib:is_regular(Output), %% perform the function if we're allowed, %% otherwise just process the next template