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 via email to