1 |
commit: 13c48b178beee52c5eccc023fd3e8c0feead4de4 |
2 |
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Mar 29 03:31:45 2022 +0000 |
4 |
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Apr 1 15:22:16 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=13c48b17 |
7 |
|
8 |
wrapper.eclass: Drop support for EAPIs 0 to 4 |
9 |
|
10 |
- Add EAPI conditional |
11 |
- Use sed instead of cat, to preserve indentation of output |
12 |
|
13 |
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org> |
14 |
|
15 |
eclass/wrapper.eclass | 17 +++++++++++------ |
16 |
1 file changed, 11 insertions(+), 6 deletions(-) |
17 |
|
18 |
diff --git a/eclass/wrapper.eclass b/eclass/wrapper.eclass |
19 |
index 399c7cc269d4..8d3d273d81c6 100644 |
20 |
--- a/eclass/wrapper.eclass |
21 |
+++ b/eclass/wrapper.eclass |
22 |
@@ -1,11 +1,17 @@ |
23 |
-# Copyright 1999-2020 Gentoo Authors |
24 |
+# Copyright 1999-2022 Gentoo Authors |
25 |
# Distributed under the terms of the GNU General Public License v2 |
26 |
|
27 |
# @ECLASS: wrapper.eclass |
28 |
# @MAINTAINER: |
29 |
# base-system@g.o |
30 |
+# @SUPPORTED_EAPIS: 5 6 7 8 |
31 |
# @BLURB: create a shell wrapper script |
32 |
|
33 |
+case ${EAPI} in |
34 |
+ 5|6|7|8) ;; |
35 |
+ *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; |
36 |
+esac |
37 |
+ |
38 |
if [[ -z ${_WRAPPER_ECLASS} ]]; then |
39 |
_WRAPPER_ECLASS=1 |
40 |
|
41 |
@@ -19,7 +25,6 @@ _WRAPPER_ECLASS=1 |
42 |
make_wrapper() { |
43 |
local wrapper=$1 bin=$2 chdir=$3 libdir=$4 path=$5 |
44 |
local tmpwrapper="${T}/tmp.wrapper.${wrapper##*/}" |
45 |
- has "${EAPI:-0}" 0 1 2 && local EPREFIX="" |
46 |
|
47 |
( |
48 |
echo '#!/bin/sh' |
49 |
@@ -30,11 +35,11 @@ make_wrapper() { |
50 |
else |
51 |
var=LD_LIBRARY_PATH |
52 |
fi |
53 |
- cat <<-EOF |
54 |
+ sed 's/^X//' <<-EOF || die |
55 |
if [ "\${${var}+set}" = "set" ] ; then |
56 |
- export ${var}="\${${var}}:${EPREFIX}${libdir}" |
57 |
+ X export ${var}="\${${var}}:${EPREFIX}${libdir}" |
58 |
else |
59 |
- export ${var}="${EPREFIX}${libdir}" |
60 |
+ X export ${var}="${EPREFIX}${libdir}" |
61 |
fi |
62 |
EOF |
63 |
fi |
64 |
@@ -52,7 +57,7 @@ make_wrapper() { |
65 |
newexe "${tmpwrapper}" "${wrapper}" |
66 |
) || die |
67 |
else |
68 |
- newbin "${tmpwrapper}" "${wrapper}" || die |
69 |
+ newbin "${tmpwrapper}" "${wrapper}" |
70 |
fi |
71 |
} |