diff options
author | Marek Vasut <marex@denx.de> | 2020-12-23 17:50:02 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-01-27 09:32:45 +0000 |
commit | 13166073da7b8735c4d71e99319a1c634e6ec2da (patch) | |
tree | 24ca8cbd022e1b85827ca9afca80139b8bfccc6d /meta | |
parent | 5251cbb92ad75018ae9ec801fdea9265dd57ea86 (diff) | |
download | poky-13166073da7b8735c4d71e99319a1c634e6ec2da.tar.gz |
meta: toolchain-shar-relocate.sh: Do not use $target_sdk_dir as regex
The $target_sdk_dir path might contain special characters, for example if
the path is /opt/poky/3.2+snapshot . Prevent grep from interpreting those
as part of the regex by using the -F parameter and multiple -e parameters
to specify which strings to filter out. Also note that the previous regex
was using asterisk as wildcard (e.g. environment-setup-*), but that should
have been regex (e.g. environment-setup-.*, with dot) to match correctly,
this is also fixed by this change.
Fixes: 9721378688 ("toolchain-shar-template.sh: Make relocation optional.")
(From OE-Core rev: b97f2901c66d6343c49d5bf90d538aa22aeae79d)
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Joshua Watt <JPEWhacker@gmail.com>
Cc: Krzysztof Zawadzki <krzysztof.zawadzki@nokia.com>
Cc: Randy Witt <randy.e.witt@linux.intel.com>
Cc: Richard Purdie <richard.purdie@linuxfoundation.org>
Cc: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 19d9fa7ab6c851000bc5d24281739e1b2bb8f057)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/files/toolchain-shar-relocate.sh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/meta/files/toolchain-shar-relocate.sh b/meta/files/toolchain-shar-relocate.sh index e3c10018ef..9c358a53e2 100644 --- a/meta/files/toolchain-shar-relocate.sh +++ b/meta/files/toolchain-shar-relocate.sh | |||
@@ -56,7 +56,9 @@ for replace in "$target_sdk_dir -maxdepth 1" "$native_sysroot"; do | |||
56 | $SUDO_EXEC find $replace -type f | 56 | $SUDO_EXEC find $replace -type f |
57 | done | xargs -n100 file | grep ":.*\(ASCII\|script\|source\).*text" | \ | 57 | done | xargs -n100 file | grep ":.*\(ASCII\|script\|source\).*text" | \ |
58 | awk -F':' '{printf "\"%s\"\n", $1}' | \ | 58 | awk -F':' '{printf "\"%s\"\n", $1}' | \ |
59 | grep -Ev "$target_sdk_dir/(environment-setup-*|relocate_sdk*|${0##*/})" | \ | 59 | grep -Fv -e "$target_sdk_dir/environment-setup-" \ |
60 | -e "$target_sdk_dir/relocate_sdk" \ | ||
61 | -e "$target_sdk_dir/${0##*/}" | \ | ||
60 | xargs -n100 $SUDO_EXEC sed -i \ | 62 | xargs -n100 $SUDO_EXEC sed -i \ |
61 | -e "s:$DEFAULT_INSTALL_DIR:$target_sdk_dir:g" \ | 63 | -e "s:$DEFAULT_INSTALL_DIR:$target_sdk_dir:g" \ |
62 | -e "s:^#! */usr/bin/perl.*:#! /usr/bin/env perl:g" \ | 64 | -e "s:^#! */usr/bin/perl.*:#! /usr/bin/env perl:g" \ |