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 B5565138334 for ; Fri, 13 Jul 2018 23:58:55 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E0C59E0955; Fri, 13 Jul 2018 23:58:49 +0000 (UTC) Received: from mx-out2.startmail.com (mx-out2.startmail.com [145.131.90.155]) (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 575D1E0936 for ; Fri, 13 Jul 2018 23:58:49 +0000 (UTC) From: "Marty E. Plummer" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=startmail.com; s=2017-11; t=1531526327; bh=N43eJfUu9lkjaK1U8uY3cxTCKwH2CqUUr9v45EN6ZsE=; h=From:To:Cc:Subject:Date:From; b=Hauv9Xhbg+Mea4b6OPuVMRJagKFsrnLo0a0OgsMykqk7/fqeFTI7Y1e6kleyePo5S WqvsrB+fWXNMlq52K3y3bcq/KCMu/SQqz68TMLweCunUI+ZZ3v+58ztH9BClmTHGfR yxOS3aBARNkSqh+dupgKxeSQJzljXnWkMN2rN6/4kTBCZHthnTeuWGxkJKWtjItU99 fiBUUEzNE3Xe3c6vczEbLDHY1R0KkNIPlIo8KPGDbDIPEpKn9ggmmtPA+dWeley2fV JVx/KCAGfMj6Wl09sbVH8UnWxauzm1QN4JatIqMQqUvgEiNU93S4m+PaPkxxEV/HzE 02027JaVKa9Vw== To: gentoo-dev@lists.gentoo.org Cc: "Marty E. Plummer" Subject: [gentoo-dev] [PATCH] linux-info.eclass: account for lack of trailing slash Date: Fri, 13 Jul 2018 18:57:23 -0500 Message-Id: <20180713235723.32617-1-hanetzer@startmail.com> 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-Archives-Salt: f9a4323d-d8de-4533-9f32-3f4ed57ab64f X-Archives-Hash: 9865b0cd5a0ed5eff165b3e2cb3c4e4c 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://dev.gentoo.org/~ulm/pms/head/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..31464766038 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