From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 12FCA15838C for ; Tue, 23 Jan 2024 19:43:22 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D557AE2A7B; Tue, 23 Jan 2024 19:43:16 +0000 (UTC) Received: from mx0.riseup.net (mx0.riseup.net [198.252.153.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 5AAB3E2A4E for ; Tue, 23 Jan 2024 19:43:16 +0000 (UTC) Received: from fews02-sea.riseup.net (fews02-sea-pn.riseup.net [10.0.1.112]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx0.riseup.net (Postfix) with ESMTPS id 4TKHZC2Q66z9wNZ for ; Tue, 23 Jan 2024 19:43:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1706038995; bh=6esZHjq6uQOKk4Y9ZWEV/O+Rkqb5PzyHKsT4mgJk1vg=; h=Date:From:To:Subject:In-Reply-To:References:From; b=XgI+XIWqVHqymWZXppsAuu7x5tUw4krAF49x6rOct+sA7YQHqN73O+mflrSYNNbmP 5BhD3cftuT1WPkaoihTTe9hXgDHOgu+i6PQ0kcndZz2CgW6MvBAdiH/ggVuVy+2KBf Zl0AX176jWt7+heQ1IAPq1s8gFcEGImWJXNXMELY= X-Riseup-User-ID: 0FD683D4DA1FDC3E191F7B151761E0D0ED30C570B2C4BA010E0B16AB2C27BC0F Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews02-sea.riseup.net (Postfix) with ESMTPSA id 4TKHZC098czFvxv for ; Tue, 23 Jan 2024 19:43:14 +0000 (UTC) Date: Tue, 23 Jan 2024 11:43:13 -0800 From: orbea To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] [PATCH] cargo.eclass: add CARGO_TOML_DIR Message-ID: <20240123114313.6b51a617@Akita> In-Reply-To: <416b1bde323d9616dfb9d97e535b5365587b0a02.camel@gentoo.org> References: <20240122161434.991554-1-sam@gentoo.org> <20240122193222.7d9a5b0e@Akita> <20240123061347.20781a5d@Akita> <416b1bde323d9616dfb9d97e535b5365587b0a02.camel@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 4c904e00-1d79-4331-ba46-6d0fcdd68923 X-Archives-Hash: fae9ddf1a41b0d840702875e60c3d1cf On Tue, 23 Jan 2024 17:48:25 +0100 Micha=C5=82 G=C3=B3rny wrote: > On Tue, 2024-01-23 at 06:13 -0800, orbea wrote: > > On Tue, 23 Jan 2024 04:48:02 +0100 > > Micha=C5=82 G=C3=B3rny wrote: > > =20 > > > On Mon, 2024-01-22 at 19:32 -0800, orbea wrote: =20 > > > > This is required when cargo_live_src_unpack needs to be find a > > > > Cargo.toml file in a directory other than ${S} > > > >=20 > > > > Signed-off-by: orbea > > > > --- > > > > eclass/cargo.eclass | 11 ++++++++++- > > > > 1 file changed, 10 insertions(+), 1 deletion(-) > > > >=20 > > > > diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass > > > > index 3bdbb5e3ec64..692623382c56 100644 > > > > --- a/eclass/cargo.eclass > > > > +++ b/eclass/cargo.eclass > > > > @@ -116,6 +116,15 @@ ECARGO_VENDOR=3D"${ECARGO_HOME}/gentoo" > > > > # other src_functions of this eclass. > > > > # Note that cargo_gen_config is automatically called by > > > > cargo_src_unpack.=20 > > > > +# @ECLASS_VARIABLE: CARGO_TOML_DIR > > > > +# @DEFAULT_UNSET > > > > +# @DESCRIPTION: > > > > +# Optional variable containing the directory path to the > > > > Cargo.toml file. +# Should be defined before calling > > > > cargo_live_src_unpack. +# > > > > +# This is required for live ebuilds when Cargo.toml in a > > > > directory other +# than ${S}. > > > > + > > > > # @ECLASS_VARIABLE: myfeatures > > > > # @DEFAULT_UNSET > > > > # @DESCRIPTION: > > > > @@ -403,7 +412,7 @@ cargo_live_src_unpack() { > > > > umask "${EVCS_UMASK}" || die "Bad options to > > > > umask: ${EVCS_UMASK}" fi > > > > =20 > > > > - pushd "${S}" > /dev/null || die > > > > + pushd "${CARGO_TOML_DIR:-$S}" > /dev/null || die =20 > > >=20 > > > Please respect the current variable style. =20 > >=20 > > Sorry for being dense, but could you elaborate what you mean? > > =20 >=20 > You changed '${S}' to '$S' which goes against the established style. >=20 Thanks for spelling that out, I corrected the patch. ------------- This is required when cargo_live_src_unpack needs to be find a Cargo.toml file in a directory other than ${S}. This may happen in cases where the package has a rust component within a subdirectory where the program otherwise use another language. Signed-off-by: orbea --- eclass/cargo.eclass | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass index 3bdbb5e3ec64..f88b3b82d8ed 100644 --- a/eclass/cargo.eclass +++ b/eclass/cargo.eclass @@ -116,6 +116,15 @@ ECARGO_VENDOR=3D"${ECARGO_HOME}/gentoo" # other src_functions of this eclass. # Note that cargo_gen_config is automatically called by cargo_src_unpack. =20 +# @ECLASS_VARIABLE: CARGO_TOML_DIR +# @DEFAULT_UNSET +# @DESCRIPTION: +# Optional variable containing the directory path to the Cargo.toml file. +# Should be defined before calling cargo_live_src_unpack. +# +# This is required for live ebuilds when Cargo.toml in a directory other +# than ${S}. + # @ECLASS_VARIABLE: myfeatures # @DEFAULT_UNSET # @DESCRIPTION: @@ -403,7 +412,7 @@ cargo_live_src_unpack() { umask "${EVCS_UMASK}" || die "Bad options to umask: ${EVCS_UMASK}" fi =20 - pushd "${S}" > /dev/null || die + pushd "${CARGO_TOML_DIR:-${S}}" > /dev/null || die =20 # Respect user settings before cargo_gen_config is called. if [[ ! ${CARGO_TERM_COLOR} ]]; then --=20 2.41.0