diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2020-07-30 03:06:57 +0200 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2020-09-11 18:24:13 +0200 |
commit | 0bbc213229f6fdd6d1382e426f9ef2b9475ba60c (patch) | |
tree | 42e33538de3877e46d134e7310fc8ec2cf4309f9 /bin | |
parent | e5c3ba093ee03828b777784c93e90e7045de5152 (diff) |
cross-compile: fix PATH handling for host
Reading and exporting the PATH variable will result in a bunch of
error, so we have to work with full patch when using the grep and
sed commands. Since we just want the PATH for the rest of the host
config run, we can simply restore it.
Change-Id: I970f3bddece01c1f20ab9db7d55569e5df190675
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102476
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'bin')
-rw-r--r-- | bin/get_config_variables | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bin/get_config_variables b/bin/get_config_variables index 60a2bdc04788..aa8198a44f4f 100644 --- a/bin/get_config_variables +++ b/bin/get_config_variables @@ -11,13 +11,19 @@ elif [ "$glv_var" = "--host" ] ; then shift fi +# full path, in case we export a "wrong" PATH +test -n "$GREP" && glv_grep="$GREP" || glv_grep=$(command -v grep) +test -n "$SED" && glv_sed="$SED" || glv_sed=$(command -v sed) + while [ -n "$1" ] ; do glv_var="$1" shift - glv_value=$(grep "^ *export ${glv_var}=" ${glv_config} | sed -e "s/[^=]*=//") + glv_value=$("${glv_grep}" "^ *export ${glv_var}=" ${glv_config} | "${glv_sed}" -e 's/[^=]*=//') export ${glv_var}="${glv_value}" done unset glv_var unset glv_value unset glv_config +unset glv_sed +unset glv_grep |