summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2018-06-22 10:42:03 +0200
committerMichał Górny <mgorny@gentoo.org>2018-07-16 22:51:41 +0200
commitbef50010a4899db1896133fad0d6ca1d387b6ec2 (patch)
tree99de77a152fbd5c7fe67405d3cf2de43ff2bbef3
parentprofiles/arch/amd64-fbsd: Unmask py2.7 target (diff)
downloadgentoo-bef50010.tar.gz
gentoo-bef50010.tar.bz2
gentoo-bef50010.zip
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.
-rw-r--r--eclass/eutils.eclass2
1 files changed, 1 insertions, 1 deletions
diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass
index 81621df78e63..9b4767e1874a 100644
--- a/eclass/eutils.eclass
+++ b/eclass/eutils.eclass
@@ -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}/}"