summaryrefslogtreecommitdiff
path: root/eclass/wrapper.eclass
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-04-06 22:33:41 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-04-06 22:33:41 +0100
commite68d405c5d712af4387159df07e226217bdda049 (patch)
tree009ab0f3d427f0813e62930d71802cb054c07e30 /eclass/wrapper.eclass
parent401101f9c8077911929d3f2b60a37098460a5d89 (diff)
gentoo resync : 06.04.2022
Diffstat (limited to 'eclass/wrapper.eclass')
-rw-r--r--eclass/wrapper.eclass17
1 files changed, 11 insertions, 6 deletions
diff --git a/eclass/wrapper.eclass b/eclass/wrapper.eclass
index 399c7cc269d4..8d3d273d81c6 100644
--- a/eclass/wrapper.eclass
+++ b/eclass/wrapper.eclass
@@ -1,11 +1,17 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: wrapper.eclass
# @MAINTAINER:
# base-system@gentoo.org
+# @SUPPORTED_EAPIS: 5 6 7 8
# @BLURB: create a shell wrapper script
+case ${EAPI} in
+ 5|6|7|8) ;;
+ *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
+esac
+
if [[ -z ${_WRAPPER_ECLASS} ]]; then
_WRAPPER_ECLASS=1
@@ -19,7 +25,6 @@ _WRAPPER_ECLASS=1
make_wrapper() {
local wrapper=$1 bin=$2 chdir=$3 libdir=$4 path=$5
local tmpwrapper="${T}/tmp.wrapper.${wrapper##*/}"
- has "${EAPI:-0}" 0 1 2 && local EPREFIX=""
(
echo '#!/bin/sh'
@@ -30,11 +35,11 @@ make_wrapper() {
else
var=LD_LIBRARY_PATH
fi
- cat <<-EOF
+ sed 's/^X//' <<-EOF || die
if [ "\${${var}+set}" = "set" ] ; then
- export ${var}="\${${var}}:${EPREFIX}${libdir}"
+ X export ${var}="\${${var}}:${EPREFIX}${libdir}"
else
- export ${var}="${EPREFIX}${libdir}"
+ X export ${var}="${EPREFIX}${libdir}"
fi
EOF
fi
@@ -52,7 +57,7 @@ make_wrapper() {
newexe "${tmpwrapper}" "${wrapper}"
) || die
else
- newbin "${tmpwrapper}" "${wrapper}" || die
+ newbin "${tmpwrapper}" "${wrapper}"
fi
}