Browse Source

fix resolving

Namdak Tonpa 9 years ago
parent
commit
2c1413039e
5 changed files with 6 additions and 4 deletions
  1. 1 1
      include/mad.hrl
  2. BIN
      mad
  3. 5 1
      src/package/mad_systools.erl
  4. 0 1
      src/provision/mad_repl.erl
  5. 0 1
      src/provision/mad_run.erl

+ 1 - 1
include/mad.hrl

@@ -1 +1 @@
--define(VERSION,"bccd2c").
+-define(VERSION,"a000fd").

BIN
mad


+ 5 - 1
src/package/mad_systools.erl

@@ -32,7 +32,10 @@ release(Name) ->
     {Ver,Dir} = lists:unzip(R),
     NameVer   = [ X || X <- lists:zip(L,Ver), element(1,X) /= active,
                                               element(1,X) /= fs ],
-    {{release,{Name,"1"},{erts,erlang:system_info(version)},NameVer},Sorted}.
+    Version = case lists:keyfind(list_to_atom(Name),2,Triples) of
+                  {_,_,{Vsn,_}} -> Vsn;
+                  _ -> "1" end,
+    {{release,{Name,Version},{erts,erlang:system_info(version)},NameVer},Sorted}.
 
 beam_release(N) ->
     mad_resolve:main([]),
@@ -41,6 +44,7 @@ beam_release(N) ->
     {Release,Apps} = release(N),
     file:write_file(N ++ ".rel",io_lib:format("~p.",[Release])),
     Res = systools:make_script(N),
+    systools:make_tar(N),
     Files = [ {"/bin/" ++ filename:basename(F), F}
         || F <- mad_repl:wildcards([code:root_dir() ++
             "/erts-" ++ erlang:system_info(version) ++

+ 0 - 1
src/provision/mad_repl.erl

@@ -61,7 +61,6 @@ cwd() -> case  file:get_cwd() of {ok, Cwd} -> Cwd; _ -> "." end.
 
 sh(Params) ->
     { _Cwd,_ConfigFileName,_Config } = mad_utils:configs(),
-    mad_resolve:main([]),
     SystemPath = filelib:wildcard(code:root_dir() ++ "/lib/{"
               ++ string:join([atom_to_list(X)||X<-mad_repl:system()],",") ++ "}-*/ebin"),
     UserPath   = wildcards(["{apps,deps}/*/ebin","ebin"]),

+ 0 - 1
src/provision/mad_run.erl

@@ -2,7 +2,6 @@
 -compile(export_all).
 
 start(App) ->                            % run_dir > < log_dir
-    mad_resolve:main([]),
     mad:info("Scripting: ~p~n",[escript:script_name()]),
     {_,Status,X} = sh:run("run_erl",["-daemon",".",".","exec "++escript:script_name()++" sh"],
       binary,".",