rebar/rebar — pull request #303 by terrencehan (2014-06-19 04:06:19+00:00)
Title: Fix upgrade error

When following instructions in `test/upgrade_project/README.md,` I failed during releasing another dummy_0.3 with an error message — `{error, {no_matching_relup, "0.3", "0.2"}}`, supposing 0.2 is the base version. Because, at this moment, rebar uses wildcard to extract the base version. — `filelib:wildcard(filename:join([Path, "releases", "*", Name ++ ".rel"]))`. In this case, we always got `releases/0.1/dummy.rel`, NOT `releases/0.2/dummy_0.2.rel`. I think that is a mistake.

In this pull request, I use `releases/start_erl.data` as a source to get the permanent version, and make sure we could get the specific `relup` and `*.rel` file for upgrade.

Beside, now, we pass `NewName` to `systools:make_relup` (`run_systools/2` in `rebar_upgrade.erl` ). That results in a mistake, I think, which leads `systool` to get NewName.rel every time. Again, in this case, `dummy_0.2` is right. So, before calling `run_systools`, I use wildcard `Name ++ "*.rel”` to expend the second parameter. Because in `sasl`, it calls `file:path_open/3` to read `.rel` file. If we pass `dummy_VERSION`, we could get the specific file.

Thanks for your reviewing.