Message ID | 1e2be9a04a91bd061892353b578261666a1c9b75.camel@xry111.site |
---|---|
State | Committed |
Commit | 0440b774ea3311d65027aa7b1d26b62b7d8538ea |
Headers |
Return-Path: <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1D8EF386DC50 for <patchwork@sourceware.org>; Mon, 27 Jun 2022 06:12:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1D8EF386DC50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1656310367; bh=CuVFaxW+PHe/UzM97LSz64oA5gwuP6ZPkpXYxmZhqKo=; h=Subject:To:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=UbOJhw78DESHwqHD3p4B2hl28NECpd+XMoHTAwGwYLQU/FHNDbWmYljyMTW6Tpbvb 3VVRS2hy9Debdd6tAn+YOHLvoWHVyifTpK+1ud8apgPYMxWnGM9WUgnumQUG2r+wE0 5u2V87soJxUwkj9PcLICgLFygePMHcmffQICAIVI= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from xry111.site (xry111.site [89.208.246.23]) by sourceware.org (Postfix) with ESMTPS id B087C386DC62; Mon, 27 Jun 2022 06:10:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B087C386DC62 Received: from [192.168.124.21] (unknown [113.140.11.126]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id 7037A66807; Mon, 27 Jun 2022 02:10:38 -0400 (EDT) Message-ID: <1e2be9a04a91bd061892353b578261666a1c9b75.camel@xry111.site> Subject: [PATCH v2 4/7] fortran: use grep instead of fgrep To: gcc-patches@gcc.gnu.org Date: Mon, 27 Jun 2022 14:10:36 +0800 In-Reply-To: <fb82297845486b14d51905ae3df8dbba726fcf57.camel@xry111.site> References: <fb82297845486b14d51905ae3df8dbba726fcf57.camel@xry111.site> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.2 MIME-Version: 1.0 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FROM_SUSPICIOUS_NTLD, GIT_PATCH_0, LIKELY_SPAM_FROM, RCVD_IN_BARRACUDACENTRAL, SPF_HELO_PASS, SPF_PASS, TXREP, T_PDS_OTHER_BAD_TLD, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Xi Ruoyao via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Xi Ruoyao <xry111@xry111.site> Cc: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>, Jonathan Wakely <jwakely@redhat.com>, fortran@gcc.gnu.org Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> |
Series |
Avoid using obsoleted egrep/fgrep
|
|
Commit Message
Xi Ruoyao
June 27, 2022, 6:10 a.m. UTC
fgrep has been deprecated in favor of grep -F for a long time, and the next grep release (3.8 or 4.0) will print a warning of fgrep is used. Stop using fgrep so we won't see the warning. We can't hard code grep -F here or it may break build on hosts w/o GNU grep. autoconf documentation contains a warning about this issue and suggest to use AC_PROG_FGREP and $FGREP, but these are too overkill in the specific case: there is no way "debian" could be interpreted as an non-trivial regex, so we can use a plain grep here. gcc/fortran/ChangeLog: * Make-lang.in: Use grep instead of fgrep. --- gcc/fortran/Make-lang.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Mon, 27 Jun 2022 14:10:36 +0800 Xi Ruoyao <xry111@xry111.site> wrote: > fgrep has been deprecated in favor of grep -F for a long time, and the > next grep release (3.8 or 4.0) will print a warning of fgrep is used. > Stop using fgrep so we won't see the warning. > > We can't hard code grep -F here or it may break build on hosts w/o GNU > grep. autoconf documentation contains a warning about this issue and > suggest to use AC_PROG_FGREP and $FGREP, but these are too overkill in > the specific case: there is no way "debian" could be interpreted as an > non-trivial regex, so we can use a plain grep here. LGTM but i cannot approve it. I'd say this one is trivial and obvious so you could sneak it in under the "obvious" rule.. Thanks for the patch! > > gcc/fortran/ChangeLog: > > * Make-lang.in: Use grep instead of fgrep. > --- > gcc/fortran/Make-lang.in | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gcc/fortran/Make-lang.in b/gcc/fortran/Make-lang.in > index 1cb47cb1a52..6eb597d0ca0 100644 > --- a/gcc/fortran/Make-lang.in > +++ b/gcc/fortran/Make-lang.in > @@ -278,7 +278,7 @@ $(DESTDIR)$(man1dir)/$(GFORTRAN_INSTALL_NAME)$(man1ext): doc/gfortran.1 \ > -chmod a-x $@ > > fortran.uninstall: > - if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ > + if $(SHELL) -c 'install-info --version | sed 1q | grep -s -v -i debian' >/dev/null 2>&1; then \ > echo " install-info --delete --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/gfortran.info"; \ > install-info --delete --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/gfortran.info || : ; \ > else : ; fi; \
On 10.05.23 21:29, Bernhard Reutner-Fischer via Fortran wrote: > On Mon, 27 Jun 2022 14:10:36 +0800 > Xi Ruoyao <xry111@xry111.site> wrote: > >> fgrep has been deprecated in favor of grep -F for a long time, and the >> next grep release (3.8 or 4.0) will print a warning of fgrep is used. >> Stop using fgrep so we won't see the warning. >> >> We can't hard code grep -F here or it may break build on hosts w/o GNU >> grep. autoconf documentation contains a warning about this issue and >> suggest to use AC_PROG_FGREP and $FGREP, but these are too overkill in >> the specific case: there is no way "debian" could be interpreted as an >> non-trivial regex, so we can use a plain grep here. > > LGTM but i cannot approve it. I'd say this one is trivial and obvious > so you could sneak it in under the "obvious" rule.. I concur, this could also have been obvious. Anyway, OK for trunk, and > Thanks for the patch!
On Wed, 2023-05-10 at 22:02 +0200, Thomas Koenig wrote: > On 10.05.23 21:29, Bernhard Reutner-Fischer via Fortran wrote: > > On Mon, 27 Jun 2022 14:10:36 +0800 > > Xi Ruoyao <xry111@xry111.site> wrote: > > > > > fgrep has been deprecated in favor of grep -F for a long time, and the > > > next grep release (3.8 or 4.0) will print a warning of fgrep is used. > > > Stop using fgrep so we won't see the warning. > > > > > > We can't hard code grep -F here or it may break build on hosts w/o GNU > > > grep. autoconf documentation contains a warning about this issue and > > > suggest to use AC_PROG_FGREP and $FGREP, but these are too overkill in > > > the specific case: there is no way "debian" could be interpreted as an > > > non-trivial regex, so we can use a plain grep here. > > > > LGTM but i cannot approve it. I'd say this one is trivial and obvious > > so you could sneak it in under the "obvious" rule.. > > I concur, this could also have been obvious. > > Anyway, OK for trunk, and > > > Thanks for the patch! Pushed r14-698, with a commit msg change for the status of grep release.
diff --git a/gcc/fortran/Make-lang.in b/gcc/fortran/Make-lang.in index 1cb47cb1a52..6eb597d0ca0 100644 --- a/gcc/fortran/Make-lang.in +++ b/gcc/fortran/Make-lang.in @@ -278,7 +278,7 @@ $(DESTDIR)$(man1dir)/$(GFORTRAN_INSTALL_NAME)$(man1ext): doc/gfortran.1 \ -chmod a-x $@ fortran.uninstall: - if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ + if $(SHELL) -c 'install-info --version | sed 1q | grep -s -v -i debian' >/dev/null 2>&1; then \ echo " install-info --delete --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/gfortran.info"; \ install-info --delete --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/gfortran.info || : ; \ else : ; fi; \