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 87EA2158009 for ; Mon, 26 Jun 2023 10:46:06 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BB6A2E08A5; Mon, 26 Jun 2023 10:46:02 +0000 (UTC) Received: from bagheera.iewc.co.za (bagheera.iewc.co.za [IPv6:2c0f:f720:0:3::9a49:2249]) (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 8DA4AE0896 for ; Mon, 26 Jun 2023 10:46:01 +0000 (UTC) Received: from [154.73.32.4] (helo=tauri.local.uls.co.za) by bagheera.iewc.co.za with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qDjjJ-0007NG-K9; Mon, 26 Jun 2023 12:45:57 +0200 Received: from [192.168.1.145] by tauri.local.uls.co.za with esmtp (Exim 4.94.2) (envelope-from ) id 1qDjjI-0003cu-PL; Mon, 26 Jun 2023 12:45:56 +0200 Message-ID: <5ba4d13b-6f67-a37e-117c-1ffeac736042@uls.co.za> Date: Mon, 26 Jun 2023 12:45:56 +0200 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 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [gentoo-dev] [PATCH] cmake.eclass: workaround S=${WORKDIR} creating builddir above ${WORKDIR} Content-Language: en-GB To: gentoo-dev@lists.gentoo.org, Ulrich Mueller , Sam James Cc: base-system@gentoo.org, kde@gentoo.org References: <20230626095716.1292297-1-sam@gentoo.org> From: Jaco Kroon Organization: Ultimate Linux Solutions (Pty) Ltd In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-report: Relay access (bagheera.iewc.co.za). X-Archives-Salt: 0aa0667b-2abf-47a8-b8ca-94d5325abbe6 X-Archives-Hash: 3fe4c676cdcbab7f7d023e692478e96c 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