Michał Górny <mgo...@gentoo.org> writes:
>> +# Run rebar with verbose flag. Die on failure.
>> +erebar() {
>> +    debug-print-function ${FUNCNAME} "${@}"
>> +
>> +    (( $# > 0 )) || die 'erebar: at least one target is required'
>
> Why not [[ $# -gt 0 ]]? It's the first time I see someone using (( ))
> for conditionals.

'>' reads better than some '-gt'.


>> +    evar_push ERL_LIBS
>> +    export ERL_LIBS="${EPREFIX}$(get_erl_libs)"
>
> local -x ERL_LIBS=...
>
> We don't really have to employ terribly ugly eval hackery to have
> a local variable.

Fixed. I hoped there's better way! (-:


> I meant indent like this:
>
> +     eawk rebar.config \
> +             -v erl_libs="${erl_libs}" -v pn="${pn}" -v pv="${pv}" \
> +             '/^{[[:space:]]*erl_opts[[:space:]]*,/, /}[[:space:]]*\.$/ {
> +                     pattern = "\"(./)?deps/" pn "/include\"";
> +                     if (match($0, "{i,[[:space:]]*" pattern 
> "[[:space:]]*}")) {
> +                             sub(pattern, "\"" erl_libs "/" pn "-" pv 
> "/include\"");
> +                     }
> +                     print $0;
> +                     next;
> +             }
> +             1
> +     ' || die "failed to fix include paths in rebar.config"

OK.


>> +    insinto "${dest}"
>> +    doins -r ebin
>> +    [[ -d include ]] && doins -r include
>> +    [[ -d bin ]] && for bin in bin/*; do dobin "$bin"; done
>> +    [[ -d priv ]] && cp -pR priv "${ED}${dest}/"
>
> Missing ||die. Just don't do it as one-liner :-P.

You've got me! ;-)


Thanks,
-- 
Amadeusz Żołnowski

Attachment: signature.asc
Description: PGP signature

Reply via email to