>>>>> On Thu, 09 Dec 2021, Maciej Barć wrote:

>  dune-install() {
> +     local pkgs
> +     if [[ -n "${@}" ]] ; then
> +             pkgs="${@}"
> +     else
> +             pkgs=${DUNE_PKG_NAME}
> +     fi
> +
> +     local myduneopts=(
> +             --prefix="${ED%/}/usr"
> +             --libdir="${D%/}$(ocamlc -where)"
> +             --mandir="${ED%/}/usr/share/man"
> +     )
>       local pkg
> -     for pkg ; do
> -             dune install \
> -                     --prefix="${ED%/}/usr" \
> -                     --libdir="${D%/}$(ocamlc -where)" \
> -                     --mandir="${ED%/}/usr/share/man" \
> -                     "${pkg}" || die
> +     for pkg in "${pkgs}" ; do
> +             dune install ${myduneopts[@]} ${pkg} || die
>       done
>  }

Have you tested this?

IIUC, the space separated list of arguments is assigned to pkgs, with
a fallback to ${DUNE_PKG_NAME}. The 'for pkg in "${pkgs}"' loop isn't
actually a loop because ${pkgs} is inside double quotes, so it will be
executed only once with pkg being equal to pkgs.

The previous logic (simple 'for pkg' which will loop over $@) was
correct but of course without the fallback.

> +dune_src_install() {
> +     dune-install ${1:-${DUNE_PKG_NAME}}
> +}

Do you even need the fallback in dune_install() if you have it here too?

Ulrich

Attachment: signature.asc
Description: PGP signature

Reply via email to