Bladeren bron

update package index url and README list of tasks

pull/3/head
Tristan Sloughter 10 jaren geleden
bovenliggende
commit
2523b93ebc
4 gewijzigde bestanden met toevoegingen van 16 en 11 verwijderingen
  1. +8
    -2
      README.md
  2. +1
    -1
      src/rebar_fetch.erl
  3. +6
    -6
      src/rebar_prv_install_deps.erl
  4. +1
    -2
      src/rebar_prv_update.erl

+ 8
- 2
README.md Bestand weergeven

@ -23,15 +23,21 @@ This is an experimental branch.
| Command | Description |
|----------- |------------ |
| compile | Build project |
| do |
| update <dep> | Update dep source |
| update | Update package index |
| pkgs | List available packages |
| shell | Run shell with project apps in path |
| escriptize | Create escript from project |
The following commands are still in the works.
| Command | Description |
|----------- |------------ |
| release | Build release of project |
| tar | Package release into tarball |
| new | |
| eunit | |
| ct | |
| do | |
### Missing

+ 1
- 1
src/rebar_fetch.erl Bestand weergeven

@ -46,7 +46,7 @@ current_ref(AppDir, {git, _, _}) ->
download_source(AppDir, Source) ->
TmpDir = ec_file:insecure_mkdtemp(),
case download_source_tmp(TmpDir, Source) of
ok ->
{ok, _} ->
ec_file:mkdir_p(AppDir),
ok = ec_file:copy(TmpDir, binary_to_list(filename:absname(AppDir)), [recursive]);
{tarball, File} ->

+ 6
- 6
src/rebar_prv_install_deps.erl Bestand weergeven

@ -138,7 +138,7 @@ update_deps(State, Deps) ->
UnbuiltApps = rebar_app_discover:find_unbuilt_apps([DepsDir]),
FoundApps = rebar_app_discover:find_apps([DepsDir]),
download_missing_deps(State, DepsDir, FoundApps, UnbuiltApps, Deps).
download_missing_deps(State, DepsDir, FoundApps, Deps).
%% Find source deps to build and download
@ -147,12 +147,12 @@ update_src_deps(State, Deps, Goals) ->
%% Find available apps to fulfill dependencies
%% Should only have to do this once, not every iteration
UnbuiltApps = rebar_app_discover:find_unbuilt_apps([DepsDir]),
%UnbuiltApps = rebar_app_discover:find_unbuilt_apps([DepsDir]),
FoundApps = rebar_app_discover:find_apps([DepsDir]),
%% Resolve deps and their dependencies
{Deps1, NewGoals} = handle_src_deps(Deps, UnbuiltApps++FoundApps, Goals),
case download_missing_deps(State, DepsDir, FoundApps, UnbuiltApps, Deps1) of
{Deps1, NewGoals} = handle_src_deps(Deps, FoundApps, Goals),
case download_missing_deps(State, DepsDir, FoundApps, Deps1) of
{State1, []} ->
{State1, Deps1, NewGoals};
{State1, Missing} ->
@ -169,12 +169,12 @@ handle_src_deps(Deps, Found, Goals) ->
end, {Deps, Goals}, Found).
%% Fetch missing deps from source
download_missing_deps(State, DepsDir, Found, Unbuilt, Deps) ->
download_missing_deps(State, DepsDir, Found, Deps) ->
Missing =
lists:filter(fun(#dep{name=Name}) ->
not lists:any(fun(F) ->
Name =:= rebar_app_info:name(F)
end, Found++Unbuilt)
end, Found)
end, Deps),
lists:foreach(fun(#dep{name=Name, source=Source}) ->
TargetDir = get_deps_dir(DepsDir, Name),

+ 1
- 2
src/rebar_prv_update.erl Bestand weergeven

@ -52,7 +52,7 @@ do(State) ->
{ok, State1};
[] ->
?INFO("Updating package index...", []),
Url = rebar_state:get(State, rebar_packages_url, "http://localhost:8080"),
Url = rebar_state:get(State, rebar_packages_url, "http://polar-caverns-6802.herokuapp.com/"),
ec_file:mkdir_p(filename:join([os:getenv("HOME"), ".rebar"])),
PackagesFile = filename:join([os:getenv("HOME"), ".rebar", "packages"]),
{ok, RequestId} = httpc:request(get, {Url, []}, [], [{stream, PackagesFile}, {sync, false}]),
@ -62,7 +62,6 @@ do(State) ->
wait(RequestId, State) ->
receive
{http, {RequestId, saved_to_file}} ->
io:format("~n"),
{ok, State}
after
500 ->

Laden…
Annuleren
Opslaan