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.
This commit is contained in:
joewilliams 2011-10-17 18:40:45 -07:00
parent 644bb0a312
commit fb8732085e

View file

@ -111,13 +111,12 @@ setup(OldVerPath, NewVerPath, NewName, NewVer, NameVer) ->
{ok, _} = file:copy(Src, Dst), {ok, _} = file:copy(Src, Dst),
ok = code:add_pathsa( ok = code:add_pathsa(
lists:append([ lists:append([
filelib:wildcard(filename:join([NewVerPath,
"lib", "*", "ebin"])),
filelib:wildcard(filename:join([OldVerPath, filelib:wildcard(filename:join([OldVerPath,
"releases", "*"])), "releases", "*"])),
filelib:wildcard(filename:join([OldVerPath, filelib:wildcard(filename:join([OldVerPath,
"lib", "*", "ebin"])), "lib", "*", "ebin"]))
filelib:wildcard(filename:join([NewVerPath,
"lib", "*", "ebin"])),
filelib:wildcard(filename:join([NewVerPath, "*"]))
])). ])).
run_systools(NewVer, Name) -> run_systools(NewVer, Name) ->