On Sat, 2020-05-02 at 19:02 +0200, Hanno Böck wrote:
> Due to an update of dev-erlang/fast_tls I noticed an issue in the
> rebar
> eclass with tests.
>
> It seems the way the eclass currently works it is running tests with
> the library installed in the system, not the code just compiled.
>
> This is obviously not what we want and it also obviously can fail if
> the new tests use features that aren't present in the old version in
> the system.
>
> The patch below fixes this and runs tests with libs from the current
> directory.
>
> Closes: https://bugs.gentoo.org/720448
> Signed-off-by: Hanno Böck <[email protected]>
> ---
>
> diff --git a/eclass/rebar.eclass b/eclass/rebar.eclass
> index 92dd16b08..f9849f0ff 100644
> --- a/eclass/rebar.eclass
> +++ b/eclass/rebar.eclass
> @@ -105,6 +105,9 @@ erebar() {
> (( $# > 0 )) || die "erebar: at least one target is required"
>
> local -x ERL_LIBS="${EPREFIX}$(get_erl_libs)"
> + if [ "$1" = "eunit" ]; then
> + local -x ERL_LIBS="."
> + fi
> rebar -v skip_deps=true "$@" || die -n "rebar $@ failed"
> }
>
>
>
Please use proper bash brackets and shorten everything to
[[ ${1} == eunit ]] && local -x ERL_LIBS="."