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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 1389D138334 for ; Sat, 14 Jul 2018 07:54:07 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 99207E0996; Sat, 14 Jul 2018 07:54:01 +0000 (UTC) Received: from mx-out1.startmail.com (mx-out1.startmail.com [145.131.90.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 2E740E08E5 for ; Sat, 14 Jul 2018 07:54:01 +0000 (UTC) Date: Sat, 14 Jul 2018 02:52:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=startmail.com; s=2017-11; t=1531554839; bh=dUvhGYwKR510Y5dOQrahO8tyi3uFZ5krz70XNt5vyCE=; h=Date:From:To:Subject:References:In-Reply-To:From; b=pfcY0zcVMJvOxhHSePKyfDRnbq3+eRfZOENMHZ3n9+bMoCwW2Cew32dk/XwKx6PYz WH+Jrr8H8bMrsj12M5FdSF9dvQH2U604mOzRO6/auG7+dS1yvjnNOh5+3+zy/2p0Wy XJs06fo/gs8z2VX8YYa5yk+vPlDl2cJeowr9Uuqb9UuDS5XvMGLWjnmt8vK+mFr8Jy Y3iUlfHNVlEpwVoWfgP2uHvaam21qo4F0H2q+807xxkQQd0Ek2AGwENn55rYexWo+x 5h5L+W7CaOWxq4Bur/mtWrHEIGQSpT6t26EUwNIzgze/x1spewhKAef82ivz3Zh0Li FZht/KzJ0z/wA== From: "Marty E. Plummer" To: gentoo-dev@lists.gentoo.org Subject: [gentoo-dev] [PATCH v2] linux-info.eclass: account for lack of trailing slash Message-ID: <20180714075237.35rqkf5tg5homkz3@proprietary-killer> References: <20180713235723.32617-1-hanetzer@startmail.com> <23369.38518.32731.496320@a1i15.kph.uni-mainz.de> 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 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <23369.38518.32731.496320@a1i15.kph.uni-mainz.de> X-Archives-Salt: a489214f-5d1d-4f55-92ee-8b8a42ad9d95 X-Archives-Hash: 1fb37e54b4e05e42d2537bff055c2c40 In EAPI 7, D, ED, ROOT, EROOT no longer have a trailing slash[1]. This makes finding /usr/src/linux not work properly as it currently stands. Use the form "${ROOT%/}/" where apropos in order to unify behavior across EAPIs. 1: https://projects.gentoo.org/pms/7/pms.html#x1-113001r7 --- eclass/linux-info.eclass | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass index 96f94e4072a..6cd64457edd 100644 --- a/eclass/linux-info.eclass +++ b/eclass/linux-info.eclass @@ -115,7 +115,7 @@ IUSE="kernel_linux" # Overwritable environment Var's # --------------------------------------- -KERNEL_DIR="${KERNEL_DIR:-${ROOT}usr/src/linux}" +KERNEL_DIR="${KERNEL_DIR:-${ROOT%/}/usr/src/linux}" # Bug fixes @@ -554,7 +554,7 @@ get_version() { # caught before this if they are. if [[ -z ${OUTPUT_DIR} ]] ; then # Try to locate a kernel that is most relevant for us. - for OUTPUT_DIR in "${SYSROOT}" "${ROOT}" "" ; do + for OUTPUT_DIR in "${SYSROOT}" "${ROOT%/}" "" ; do OUTPUT_DIR+="/lib/modules/${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}/build" if [[ -e ${OUTPUT_DIR} ]] ; then break @@ -615,19 +615,19 @@ get_running_version() { KV_FULL=$(uname -r) - if [[ -f ${ROOT}/lib/modules/${KV_FULL}/source/Makefile && -f ${ROOT}/lib/modules/${KV_FULL}/build/Makefile ]]; then - KERNEL_DIR=$(readlink -f ${ROOT}/lib/modules/${KV_FULL}/source) - KBUILD_OUTPUT=$(readlink -f ${ROOT}/lib/modules/${KV_FULL}/build) + if [[ -f ${ROOT%/}/lib/modules/${KV_FULL}/source/Makefile && -f ${ROOT%/}/lib/modules/${KV_FULL}/build/Makefile ]]; then + KERNEL_DIR=$(readlink -f ${ROOT%/}/lib/modules/${KV_FULL}/source) + KBUILD_OUTPUT=$(readlink -f ${ROOT%/}/lib/modules/${KV_FULL}/build) unset KV_FULL get_version return $? - elif [[ -f ${ROOT}/lib/modules/${KV_FULL}/source/Makefile ]]; then - KERNEL_DIR=$(readlink -f ${ROOT}/lib/modules/${KV_FULL}/source) + elif [[ -f ${ROOT%/}/lib/modules/${KV_FULL}/source/Makefile ]]; then + KERNEL_DIR=$(readlink -f ${ROOT%/}/lib/modules/${KV_FULL}/source) unset KV_FULL get_version return $? - elif [[ -f ${ROOT}/lib/modules/${KV_FULL}/build/Makefile ]]; then - KERNEL_DIR=$(readlink -f ${ROOT}/lib/modules/${KV_FULL}/build) + elif [[ -f ${ROOT%/}/lib/modules/${KV_FULL}/build/Makefile ]]; then + KERNEL_DIR=$(readlink -f ${ROOT%/}/lib/modules/${KV_FULL}/build) unset KV_FULL get_version return $? -- 2.18.0