From fb8732085e8e851a4f0c9cc97d949c0dc489ce3d Mon Sep 17 00:00:00 2001 From: joewilliams Date: Mon, 17 Oct 2011 18:40:45 -0700 Subject: [PATCH] Better code path handling during upgrades While building a upgrade package rebar will add new paths to the internal erlang path, these paths and their order have effects on how the package is built. This patch should fix some corner cases where a user can receive a "undefined application" error. --- src/rebar_upgrade.erl | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/rebar_upgrade.erl b/src/rebar_upgrade.erl index fb14707..8666fe5 100644 --- a/src/rebar_upgrade.erl +++ b/src/rebar_upgrade.erl @@ -111,13 +111,12 @@ setup(OldVerPath, NewVerPath, NewName, NewVer, NameVer) -> {ok, _} = file:copy(Src, Dst), ok = code:add_pathsa( lists:append([ + filelib:wildcard(filename:join([NewVerPath, + "lib", "*", "ebin"])), filelib:wildcard(filename:join([OldVerPath, "releases", "*"])), filelib:wildcard(filename:join([OldVerPath, - "lib", "*", "ebin"])), - filelib:wildcard(filename:join([NewVerPath, - "lib", "*", "ebin"])), - filelib:wildcard(filename:join([NewVerPath, "*"])) + "lib", "*", "ebin"])) ])). run_systools(NewVer, Name) ->