All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Anuj Mittal" <anuj.mittal@intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [gatesgarth][PATCH 07/20] meta: toolchain-shar-relocate.sh: Do not use $target_sdk_dir as regex
Date: Fri, 22 Jan 2021 00:21:52 +0800	[thread overview]
Message-ID: <b97f2901c66d6343c49d5bf90d538aa22aeae79d.1611245974.git.anuj.mittal@intel.com> (raw)
In-Reply-To: <cover.1611245974.git.anuj.mittal@intel.com>

From: Marek Vasut <marex@denx.de>

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.")
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>
---
 meta/files/toolchain-shar-relocate.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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
 	$SUDO_EXEC find $replace -type f
 done | xargs -n100 file | grep ":.*\(ASCII\|script\|source\).*text" | \
     awk -F':' '{printf "\"%s\"\n", $1}' | \
-    grep -Ev "$target_sdk_dir/(environment-setup-*|relocate_sdk*|${0##*/})" | \
+    grep -Fv -e "$target_sdk_dir/environment-setup-" \
+             -e "$target_sdk_dir/relocate_sdk" \
+             -e "$target_sdk_dir/${0##*/}" | \
     xargs -n100 $SUDO_EXEC sed -i \
         -e "s:$DEFAULT_INSTALL_DIR:$target_sdk_dir:g" \
         -e "s:^#! */usr/bin/perl.*:#! /usr/bin/env perl:g" \
-- 
2.29.2


  parent reply	other threads:[~2021-01-21 16:22 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-21 16:21 [gatesgarth][PATCH 00/20] patch review request Anuj Mittal
2021-01-21 16:21 ` [gatesgarth][PATCH 01/20] zip: whitelist CVE-2018-13410 and CVE-2018-13684 Anuj Mittal
2021-01-21 16:21 ` [gatesgarth][PATCH 02/20] scripts: oe-run-native, fix *-native directories Anuj Mittal
2021-01-21 16:21 ` [gatesgarth][PATCH 03/20] toolchain-shar-extract.sh: Handle special characters in script path Anuj Mittal
2021-01-21 16:21 ` [gatesgarth][PATCH 04/20] systemd.bbclass: improve error message when a service unit specified in SYSTEMD_SERVICE is not found Anuj Mittal
2021-01-21 16:21 ` [gatesgarth][PATCH 05/20] boost: drop arm-intrinsics.patch Anuj Mittal
2021-01-21 16:21 ` [gatesgarth][PATCH 06/20] binutils: Fix CVE-2020-35448 Anuj Mittal
2021-01-21 16:21 ` Anuj Mittal [this message]
2021-01-21 16:21 ` [gatesgarth][PATCH 08/20] meta: toolchain-shar-relocate.sh: Filter out post-relocate-setup script Anuj Mittal
2021-01-21 16:21 ` [gatesgarth][PATCH 09/20] lib/oe/utils: Return empty string in parallel_make Anuj Mittal
2021-01-21 16:21 ` [gatesgarth][PATCH 10/20] gcc: Backport patch to resolve i*86 tune configuration overrides Anuj Mittal
2021-01-21 16:21 ` [gatesgarth][PATCH 11/20] wic: Add workdir argument Anuj Mittal
2021-01-21 16:21 ` [gatesgarth][PATCH 12/20] wic: Ensure internal workdir is not reused Anuj Mittal
2021-01-21 16:21 ` [gatesgarth][PATCH 13/20] wic: Allow exec_native_cmd to run HOSTTOOLS Anuj Mittal
2021-01-21 16:21 ` [gatesgarth][PATCH 14/20] image_types_wic: Move wic working directory Anuj Mittal
2021-01-21 16:22 ` [gatesgarth][PATCH 15/20] wic: Update pseudo db when excluding content from rootfs Anuj Mittal
2021-01-21 16:22 ` [gatesgarth][PATCH 16/20] wic: Copy rootfs dir if fstab needs updating Anuj Mittal
2021-01-21 16:22 ` [gatesgarth][PATCH 17/20] wic: Optimise fstab modification for ext2/3/4 and msdos partitions Anuj Mittal
2021-01-21 16:22 ` [gatesgarth][PATCH 18/20] toolchain-shar-relocate.sh: Fix handling files with colons Anuj Mittal
2021-01-21 16:22 ` [gatesgarth][PATCH 19/20] devtool: Fix source extraction for gcc shared source Anuj Mittal
2021-01-21 16:22 ` [gatesgarth][PATCH 20/20] flex: Fix --noline option behavior Anuj Mittal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b97f2901c66d6343c49d5bf90d538aa22aeae79d.1611245974.git.anuj.mittal@intel.com \
    --to=anuj.mittal@intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.