1 |
commit: bef50010a4899db1896133fad0d6ca1d387b6ec2 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jun 22 08:42:03 2018 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Jul 16 20:51:41 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bef50010 |
7 |
|
8 |
eutils.eclass: make_wrapper, fix 'cd' error handling |
9 |
|
10 |
Reorder the generated wrapper, and add '&&' after the 'cd' call so that |
11 |
the wrapper will not try to execute the program if 'cd' command fails. |
12 |
|
13 |
eclass/eutils.eclass | 2 +- |
14 |
1 file changed, 1 insertion(+), 1 deletion(-) |
15 |
|
16 |
diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass |
17 |
index 81621df78e6..9b4767e1874 100644 |
18 |
--- a/eclass/eutils.eclass |
19 |
+++ b/eclass/eutils.eclass |
20 |
@@ -148,7 +148,6 @@ make_wrapper() { |
21 |
|
22 |
( |
23 |
echo '#!/bin/sh' |
24 |
- [[ -n ${chdir} ]] && printf 'cd "%s"\n' "${EPREFIX}${chdir}" |
25 |
if [[ -n ${libdir} ]] ; then |
26 |
local var |
27 |
if [[ ${CHOST} == *-darwin* ]] ; then |
28 |
@@ -164,6 +163,7 @@ make_wrapper() { |
29 |
fi |
30 |
EOF |
31 |
fi |
32 |
+ [[ -n ${chdir} ]] && printf 'cd "%s" &&\n' "${EPREFIX}${chdir}" |
33 |
# We don't want to quote ${bin} so that people can pass complex |
34 |
# things as ${bin} ... "./someprog --args" |
35 |
printf 'exec %s "$@"\n' "${bin/#\//${EPREFIX}/}" |