1 |
commit: c3ae6116333410443f596f6dc49bc95e8cce6432 |
2 |
Author: Marty E. Plummer <hanetzer <AT> startmail <DOT> com> |
3 |
AuthorDate: Fri Jul 13 23:44:48 2018 +0000 |
4 |
Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jul 17 14:15:17 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c3ae6116 |
7 |
|
8 |
linux-info.eclass: account for lack of trailing slash |
9 |
|
10 |
In EAPI 7, D, ED, ROOT, EROOT no longer have a trailing slash[1]. This |
11 |
makes finding /usr/src/linux not work properly as it currently stands. |
12 |
|
13 |
Use the form "${ROOT%/}/" where apropos in order to unify behavior across |
14 |
EAPIs. |
15 |
|
16 |
1: https://dev.gentoo.org/~ulm/pms/head/pms.html#x1-113001r7 |
17 |
Closes: https://github.com/gentoo/gentoo/pull/9222 |
18 |
|
19 |
eclass/linux-info.eclass | 18 +++++++++--------- |
20 |
1 file changed, 9 insertions(+), 9 deletions(-) |
21 |
|
22 |
diff --git a/eclass/linux-info.eclass b/eclass/linux-info.eclass |
23 |
index 96f94e4072a..31464766038 100644 |
24 |
--- a/eclass/linux-info.eclass |
25 |
+++ b/eclass/linux-info.eclass |
26 |
@@ -115,7 +115,7 @@ IUSE="kernel_linux" |
27 |
|
28 |
# Overwritable environment Var's |
29 |
# --------------------------------------- |
30 |
-KERNEL_DIR="${KERNEL_DIR:-${ROOT}usr/src/linux}" |
31 |
+KERNEL_DIR="${KERNEL_DIR:-${ROOT%/}/usr/src/linux}" |
32 |
|
33 |
|
34 |
# Bug fixes |
35 |
@@ -554,7 +554,7 @@ get_version() { |
36 |
# caught before this if they are. |
37 |
if [[ -z ${OUTPUT_DIR} ]] ; then |
38 |
# Try to locate a kernel that is most relevant for us. |
39 |
- for OUTPUT_DIR in "${SYSROOT}" "${ROOT}" "" ; do |
40 |
+ for OUTPUT_DIR in "${SYSROOT}" "${ROOT%/}/" "" ; do |
41 |
OUTPUT_DIR+="/lib/modules/${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${KV_EXTRA}/build" |
42 |
if [[ -e ${OUTPUT_DIR} ]] ; then |
43 |
break |
44 |
@@ -615,19 +615,19 @@ get_running_version() { |
45 |
|
46 |
KV_FULL=$(uname -r) |
47 |
|
48 |
- if [[ -f ${ROOT}/lib/modules/${KV_FULL}/source/Makefile && -f ${ROOT}/lib/modules/${KV_FULL}/build/Makefile ]]; then |
49 |
- KERNEL_DIR=$(readlink -f ${ROOT}/lib/modules/${KV_FULL}/source) |
50 |
- KBUILD_OUTPUT=$(readlink -f ${ROOT}/lib/modules/${KV_FULL}/build) |
51 |
+ if [[ -f ${ROOT%/}/lib/modules/${KV_FULL}/source/Makefile && -f ${ROOT%/}/lib/modules/${KV_FULL}/build/Makefile ]]; then |
52 |
+ KERNEL_DIR=$(readlink -f ${ROOT%/}/lib/modules/${KV_FULL}/source) |
53 |
+ KBUILD_OUTPUT=$(readlink -f ${ROOT%/}/lib/modules/${KV_FULL}/build) |
54 |
unset KV_FULL |
55 |
get_version |
56 |
return $? |
57 |
- elif [[ -f ${ROOT}/lib/modules/${KV_FULL}/source/Makefile ]]; then |
58 |
- KERNEL_DIR=$(readlink -f ${ROOT}/lib/modules/${KV_FULL}/source) |
59 |
+ elif [[ -f ${ROOT%/}/lib/modules/${KV_FULL}/source/Makefile ]]; then |
60 |
+ KERNEL_DIR=$(readlink -f ${ROOT%/}/lib/modules/${KV_FULL}/source) |
61 |
unset KV_FULL |
62 |
get_version |
63 |
return $? |
64 |
- elif [[ -f ${ROOT}/lib/modules/${KV_FULL}/build/Makefile ]]; then |
65 |
- KERNEL_DIR=$(readlink -f ${ROOT}/lib/modules/${KV_FULL}/build) |
66 |
+ elif [[ -f ${ROOT%/}/lib/modules/${KV_FULL}/build/Makefile ]]; then |
67 |
+ KERNEL_DIR=$(readlink -f ${ROOT%/}/lib/modules/${KV_FULL}/build) |
68 |
unset KV_FULL |
69 |
get_version |
70 |
return $? |