mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-30 18:12:08 +02:00
eclass/wrapper: Sync with Gentoo
It's from Gentoo commit 13c48b178beee52c5eccc023fd3e8c0feead4de4.
This commit is contained in:
parent
26b0abe054
commit
bf25f19beb
@ -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
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
# @ECLASS: wrapper.eclass
|
# @ECLASS: wrapper.eclass
|
||||||
# @MAINTAINER:
|
# @MAINTAINER:
|
||||||
# base-system@gentoo.org
|
# base-system@gentoo.org
|
||||||
|
# @SUPPORTED_EAPIS: 5 6 7 8
|
||||||
# @BLURB: create a shell wrapper script
|
# @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
|
if [[ -z ${_WRAPPER_ECLASS} ]]; then
|
||||||
_WRAPPER_ECLASS=1
|
_WRAPPER_ECLASS=1
|
||||||
|
|
||||||
@ -19,7 +25,6 @@ _WRAPPER_ECLASS=1
|
|||||||
make_wrapper() {
|
make_wrapper() {
|
||||||
local wrapper=$1 bin=$2 chdir=$3 libdir=$4 path=$5
|
local wrapper=$1 bin=$2 chdir=$3 libdir=$4 path=$5
|
||||||
local tmpwrapper="${T}/tmp.wrapper.${wrapper##*/}"
|
local tmpwrapper="${T}/tmp.wrapper.${wrapper##*/}"
|
||||||
has "${EAPI:-0}" 0 1 2 && local EPREFIX=""
|
|
||||||
|
|
||||||
(
|
(
|
||||||
echo '#!/bin/sh'
|
echo '#!/bin/sh'
|
||||||
@ -30,11 +35,11 @@ make_wrapper() {
|
|||||||
else
|
else
|
||||||
var=LD_LIBRARY_PATH
|
var=LD_LIBRARY_PATH
|
||||||
fi
|
fi
|
||||||
cat <<-EOF
|
sed 's/^X//' <<-EOF || die
|
||||||
if [ "\${${var}+set}" = "set" ] ; then
|
if [ "\${${var}+set}" = "set" ] ; then
|
||||||
export ${var}="\${${var}}:${EPREFIX}${libdir}"
|
X export ${var}="\${${var}}:${EPREFIX}${libdir}"
|
||||||
else
|
else
|
||||||
export ${var}="${EPREFIX}${libdir}"
|
X export ${var}="${EPREFIX}${libdir}"
|
||||||
fi
|
fi
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
@ -52,7 +57,7 @@ make_wrapper() {
|
|||||||
newexe "${tmpwrapper}" "${wrapper}"
|
newexe "${tmpwrapper}" "${wrapper}"
|
||||||
) || die
|
) || die
|
||||||
else
|
else
|
||||||
newbin "${tmpwrapper}" "${wrapper}" || die
|
newbin "${tmpwrapper}" "${wrapper}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user