From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Fri, 10 Feb 2023 17:03:28 +0100 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pQVs2-003Dz9-0Q for lore@lore.pengutronix.de; Fri, 10 Feb 2023 17:03:28 +0100 Received: from localhost ([127.0.0.1] helo=metis.ext.pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1pQVrz-0002kP-SA; Fri, 10 Feb 2023 17:03:27 +0100 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pQVrb-0002kF-Tn; Fri, 10 Feb 2023 17:03:03 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pQVra-0041cE-2O; Fri, 10 Feb 2023 17:03:03 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pQVra-002T3e-Io; Fri, 10 Feb 2023 17:03:02 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: ptxdist@pengutronix.de Date: Fri, 10 Feb 2023 17:02:58 +0100 Message-Id: <20230210160258.12558-1-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Developer-Signature: v=1; a=openpgp-sha256; l=1434; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Yw2TVILkDsf1/xBDvujXJowPZvqt9iokEx06iaRL/p8=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBj5mqumaBjjAtmQwMcNH5vlnx/2NT9BBLYGiU9dJUb qYOFQsiJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCY+ZqrgAKCRDB/BR4rcrsCXLiB/ 9r3sk0M0SijX0Gvb7xrD9Dy8c2c/SqjCWHkcX9wYghNeHRkN3OlY499ss2gv4XFnNErnFYMWDSHvqf pbKDVZq1bYviXXcthpYi5ILLnY4G3arpMz2C13AQGjtHB9b4KnICuix7e7UWFNtg8VHdbCcDEMYbS+ sLYbdE18a68S6pY52hcVdFdnxEQJhP8R8VFZUOdQeUSwarc3svVWSYtGbnP88kbpy2zfJQpEulzaVO FwTPLWmiJIx0JEkI3mpfTKteud2wX9H46GMuZqseczG1IwC3xtu3a9q5FGmu16hv9Uy3QDI8xMauif WqHj/C/uKcDZ+aW4BUe0ajL3d42sA7 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: 8bit Subject: [ptxdist] [PATCH] ptxd_make_world_compile_commands_filter: Fix grep for uptodate check X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false The intend here is to check the return code of grep, no need to call [ (i.e. test). This fixes an error message: environment: line 10: [: syntax error: `-q' unexpected Additionally add -e to force interpretation of "${PTXDIST_CROSS_CPPFLAGS}" as pattern. For me ${PTXDIST_CROSS_CPPFLAGS} starts with -isystem; without -e this is interpreted as option to grep instead of pattern which makes grep emit grep: invalid option -- 't' .) Also add -F to make grep use a fixed-string compare (instead of interpreting ${PTXDIST_CROSS_CPPFLAGS} as regexp). Fixes: ac0aac7fc727 ("impove compile_commands.json handling") Signed-off-by: Uwe Kleine-König --- scripts/lib/ptxd_make_world_compile_commands.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/lib/ptxd_make_world_compile_commands.sh b/scripts/lib/ptxd_make_world_compile_commands.sh index 56d7378fa28b..2703b5497799 100644 --- a/scripts/lib/ptxd_make_world_compile_commands.sh +++ b/scripts/lib/ptxd_make_world_compile_commands.sh @@ -21,7 +21,7 @@ ptxd_make_world_compile_commands_filter() { fi if [ "${src_cmds}" = "${dst_cmds}" ]; then - if [ grep -q "${PTXDIST_CROSS_CPPFLAGS}" "${src_cmds}" ]; then + if grep -q -F -e "${PTXDIST_CROSS_CPPFLAGS}" "${src_cmds}"; then ptxd_warning "compile_commands.json is already up to date!" return fi -- 2.39.0