Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Dependencies are now subtreeized

  • Loading branch information...
commit 015afcfe63faff7b106e0a357133131900ca7173 1 parent aee8df8
Yurii Rashkovskii authored
Showing with 24 additions and 4 deletions.
  1. +1 −4 Makefile
  2. +23 −0 subtreeize
View
5 Makefile
@@ -10,12 +10,9 @@ release: $(ERL) compile
@rm -rf rel/htoad
@$(REBAR) generate
-compile: $(ERL) deps
+compile: $(ERL)
@$(REBAR) compile
-deps: $(ERL)
- @$(REBAR) get-deps
-
$(ERL):
@KERL_CONFIGURE_OPTIONS=$(KERL_CONFIG_OPTS) KERL_INSTALL_AGNERIZED_REBAR=n HOME=$(HERE) ./kerl build R15B01 r15b01
@KERL_CONFIGURE_OPTIONS=$(KERL_CONFIG_OPTS) KERL_INSTALL_AGNERIZED_REBAR=n HOME=$(HERE) ./kerl install r15b01 erlang
View
23 subtreeize
@@ -0,0 +1,23 @@
+#! /usr/bin/env escript
+
+main(_) ->
+ GitDeps = filelib:wildcard("*/.git", "deps"),
+ Deps = [ hd(string:tokens(Dep,"/")) || Dep <- GitDeps ],
+ io:format("Conversion plan: ~p~n",[Deps]),
+ [ subtreeize(Dep) || Dep <- Deps ].
+
+subtreeize(Dep) ->
+ io:format("=== Processing: ~s~n", [Dep]),
+ Path = filename:join(["deps", Dep]),
+ Url = string:strip(os:cmd("cd " ++ Path ++ " && git config remote.origin.url"), right, $\n),
+ Tag = string:strip(os:cmd("cd " ++ Path ++ " && git log -n 1 --pretty=format:%h ."), right, $\n),
+ io:format("git origin: ~s~n",[Url]),
+ io:format("git version: ~s~n",[Tag]),
+ MoveOutCmd = "rm -rf " ++ Path,
+ FetchCmd = "git remote add " ++ Dep ++ " " ++ Url ++ " ; git fetch -n " ++ Dep,
+ SubtreeCmd = "git subtree add -P " ++ Path ++ " " ++ Tag,
+ Cmds = [MoveOutCmd, FetchCmd, SubtreeCmd],
+ io:format("Commands: ~p~n",[Cmds]),
+ [ os:cmd(Cmd) || Cmd <- Cmds ],
+ io:format("~nDONE~n").
+
Please sign in to comment.
Something went wrong with that request. Please try again.