Skip to content

Commit

Permalink
AGNER_INSTALL_PREFIX should be available for build, too (example: ./c…
Browse files Browse the repository at this point in the history
…onfigure --prefix=)
  • Loading branch information
yrashk committed Feb 5, 2011
1 parent 84ada00 commit 858f8c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/agner_main.erl
Expand Up @@ -405,6 +405,8 @@ handle_command(fetch, Opts) ->
Caveats when is_list(Caveats) ->
io:format("=== CAVEATS ===~n~n~s~n~n",[Caveats])
end,
InstallPrefix = filename:join([os:getenv("AGNER_PREFIX"),"packages",Package ++ "-" ++ Version]),
os:putenv("AGNER_INSTALL_PREFIX", InstallPrefix),

case proplists:get_value(build, Opts) of
true ->
Expand Down Expand Up @@ -449,10 +451,8 @@ handle_command(fetch, Opts) ->
ignore;
true ->
filelib:ensure_dir(filename:join([os:getenv("AGNER_PREFIX"),"packages"]) ++ "/"),
InstallPrefix = filename:join([os:getenv("AGNER_PREFIX"),"packages",Package ++ "-" ++ Version]),
os:cmd("rm -rf " ++ InstallPrefix),
ok = filelib:ensure_dir(InstallPrefix ++ "/"),
os:putenv("AGNER_INSTALL_PREFIX", InstallPrefix),
case proplists:get_value(install_command, Spec) of
undefined ->
io:format("ERROR: No install_command specified, can't install this package~n");
Expand Down

0 comments on commit 858f8c6

Please sign in to comment.