Gentoo Archives: gentoo-dev

From: Ulrich Mueller <ulm@g.o>
To: "Maciej Barć" <xgqt@g.o>
Cc: gentoo-dev@l.g.o, ml@g.o
Subject: Re: [gentoo-dev] [PATCH] eclass/dune.eclass: fixes
Date: Thu, 09 Dec 2021 07:38:53
Message-Id: uzgpajkhu@gentoo.org
In Reply to: [gentoo-dev] [PATCH] eclass/dune.eclass: fixes by "Maciej Barć"
1 >>>>> On Thu, 09 Dec 2021, Maciej Barć wrote:
2
3 > dune-install() {
4 > + local pkgs
5 > + if [[ -n "${@}" ]] ; then
6 > + pkgs="${@}"
7 > + else
8 > + pkgs=${DUNE_PKG_NAME}
9 > + fi
10 > +
11 > + local myduneopts=(
12 > + --prefix="${ED%/}/usr"
13 > + --libdir="${D%/}$(ocamlc -where)"
14 > + --mandir="${ED%/}/usr/share/man"
15 > + )
16 > local pkg
17 > - for pkg ; do
18 > - dune install \
19 > - --prefix="${ED%/}/usr" \
20 > - --libdir="${D%/}$(ocamlc -where)" \
21 > - --mandir="${ED%/}/usr/share/man" \
22 > - "${pkg}" || die
23 > + for pkg in "${pkgs}" ; do
24 > + dune install ${myduneopts[@]} ${pkg} || die
25 > done
26 > }
27
28 Have you tested this?
29
30 IIUC, the space separated list of arguments is assigned to pkgs, with
31 a fallback to ${DUNE_PKG_NAME}. The 'for pkg in "${pkgs}"' loop isn't
32 actually a loop because ${pkgs} is inside double quotes, so it will be
33 executed only once with pkg being equal to pkgs.
34
35 The previous logic (simple 'for pkg' which will loop over $@) was
36 correct but of course without the fallback.
37
38 > +dune_src_install() {
39 > + dune-install ${1:-${DUNE_PKG_NAME}}
40 > +}
41
42 Do you even need the fallback in dune_install() if you have it here too?
43
44 Ulrich

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-dev] [PATCH] eclass/dune.eclass: fixes "Maciej Barć" <xgqt@g.o>