mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 04:59:14 -07:00
eutils.eclass: make_wrapper, fix 'cd' error handling
Reorder the generated wrapper, and add '&&' after the 'cd' call so that the wrapper will not try to execute the program if 'cd' command fails.
This commit is contained in:
@@ -148,7 +148,6 @@ make_wrapper() {
|
||||
|
||||
(
|
||||
echo '#!/bin/sh'
|
||||
[[ -n ${chdir} ]] && printf 'cd "%s"\n' "${EPREFIX}${chdir}"
|
||||
if [[ -n ${libdir} ]] ; then
|
||||
local var
|
||||
if [[ ${CHOST} == *-darwin* ]] ; then
|
||||
@@ -164,6 +163,7 @@ make_wrapper() {
|
||||
fi
|
||||
EOF
|
||||
fi
|
||||
[[ -n ${chdir} ]] && printf 'cd "%s" &&\n' "${EPREFIX}${chdir}"
|
||||
# We don't want to quote ${bin} so that people can pass complex
|
||||
# things as ${bin} ... "./someprog --args"
|
||||
printf 'exec %s "$@"\n' "${bin/#\//${EPREFIX}/}"
|
||||
|
||||
Reference in New Issue
Block a user