Skip to content
Browse files

--no-fetch was completely broken, fixed

  • Loading branch information...
1 parent 8c37f46 commit b42e9ea3be2b6c4bea595e05093c22738d918341 @yrashk yrashk committed May 11, 2011
Showing with 8 additions and 7 deletions.
  1. +8 −7 src/agner_fetch.erl
View
15 src/agner_fetch.erl
@@ -24,7 +24,8 @@
install,
spec,
package_path,
- quiet
+ quiet,
+ nofetch
}).
-record(state, {
@@ -148,14 +149,14 @@ handle_state(fetchable, #state{ opts = #opts_rec{ spec = Spec, package_path = Pa
handle_state(fetchable, State#state{ opts = Opts#opts_rec{ spec = {spec, agner_spec:normalize(Spec0)} }, repo_dir = PackagePath } );
%% Everything is ready to go, fetch
+handle_state(fetchable, #state{ opts = #opts_rec{version = Version, directory = Directory, nofetch = true }
+ } = State) when is_list(Directory) andalso is_list(Version) ->
+ gen_fsm2:send_event(self(), next),
+ {ok, State};
+
handle_state(fetchable, #state{ opts = #opts_rec{spec = {spec, Spec}, version = Version, directory = Directory }
} = State) when is_list(Directory) andalso is_list(Version) ->
- case proplists:get_value(nofetch, Spec, false) of
- true ->
- ignore;
- false ->
- agner:fetch(Spec, Version, Directory)
- end,
+ agner:fetch(Spec, Version, Directory),
gen_fsm2:send_event(self(), next),
{ok, State};

0 comments on commit b42e9ea

Please sign in to comment.
Something went wrong with that request. Please try again.