public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Jaco Kroon <jaco@uls.co.za>
To: gentoo-dev@lists.gentoo.org, Ulrich Mueller <ulm@gentoo.org>,
	Sam James <sam@gentoo.org>
Cc: base-system@gentoo.org, kde@gentoo.org
Subject: Re: [gentoo-dev] [PATCH] cmake.eclass: workaround S=${WORKDIR} creating builddir above ${WORKDIR}
Date: Mon, 26 Jun 2023 12:45:56 +0200	[thread overview]
Message-ID: <5ba4d13b-6f67-a37e-117c-1ffeac736042@uls.co.za> (raw)
In-Reply-To: <u1qhypl2g@gentoo.org>

Hi,

On 2023/06/26 12:36, Ulrich Mueller wrote:
>>>>>> On Mon, 26 Jun 2023, Sam James wrote:
>> +
>> +		# Avoid creating ${WORKDIR}_build (which is above WORKDIR).
>> +		# TODO: For EAPI > 8, we should ban S=WORKDIR for CMake.
>> +		# See bug #889420.
>> +		if [[ ${S} == ${WORKDIR} && ${BUILD_DIR} == ${WORKDIR}_build ]] ; then
> I'd suggest adding quotes to the RHS of the expression, to prevent
> globbing.
>
> But I think what you really want is to check whether ${BUILD_DIR}
> (whatever its name is) is a subdirectory of ${WORKDIR}? Maybe a test
> like this would make that intent clearer:
>
>      if [[ ${BUILD_DIR} != "${WORKDIR}"/* ]]; then

BUILD_DIR="${WORKDIR}/../build"

I know it's pathological ... but still.  readlink -f should be 
considered here unless it can be guaranteed that BUILD_DIR will not 
contain .. components at this stage.

Kind Regards,
Jaco



  reply	other threads:[~2023-06-26 10:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-26  9:57 [gentoo-dev] [PATCH] cmake.eclass: workaround S=${WORKDIR} creating builddir above ${WORKDIR} Sam James
2023-06-26 10:36 ` Ulrich Mueller
2023-06-26 10:45   ` Jaco Kroon [this message]
2023-06-26 11:14     ` Ulrich Mueller
2023-06-26 15:24   ` Sam James

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5ba4d13b-6f67-a37e-117c-1ffeac736042@uls.co.za \
    --to=jaco@uls.co.za \
    --cc=base-system@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    --cc=kde@gentoo.org \
    --cc=sam@gentoo.org \
    --cc=ulm@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox