From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Fri, 17 Feb 2023 16:36:35 +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 1pT2mp-00AE6g-86 for lore@lore.pengutronix.de; Fri, 17 Feb 2023 16:36:35 +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 1pT2mn-0004Lv-G7; Fri, 17 Feb 2023 16:36:33 +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 1pT2mE-0002Bb-Nd; Fri, 17 Feb 2023 16:35:58 +0100 Received: from [2a0a:edc0:0:1101:1d::54] (helo=dude05.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pT2mC-005cKo-Iy; Fri, 17 Feb 2023 16:35:57 +0100 Received: from mol by dude05.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pT2mD-005ORA-5e; Fri, 17 Feb 2023 16:35:57 +0100 From: Michael Olbrich To: ptxdist@pengutronix.de Date: Fri, 17 Feb 2023 16:35:57 +0100 Message-Id: <20230217153557.1284566-1-m.olbrich@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230210160258.12558-1-u.kleine-koenig@pengutronix.de> References: <20230210160258.12558-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: [ptxdist] [APPLIED] 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 Cc: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= 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 Thanks, applied as 609521efdc7d55d0fccca2c881f34adf23d22516. Michael [sent from post-receive hook] On Fri, 17 Feb 2023 16:35:56 +0100, Uwe Kleine-König wrote: > 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 > Acked-by: Alexander Dahl > Message-Id: <20230210160258.12558-1-u.kleine-koenig@pengutronix.de> > Signed-off-by: Michael Olbrich > > 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