From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 7B01F3851A8C for ; Fri, 24 Jun 2022 11:35:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7B01F3851A8C Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-418-wBMOmKPkMkK8bFpgjsjwEg-1; Fri, 24 Jun 2022 07:35:35 -0400 X-MC-Unique: wBMOmKPkMkK8bFpgjsjwEg-1 Received: by mail-ed1-f69.google.com with SMTP id o11-20020a056402438b00b0043676efd75dso1597730edc.16 for ; Fri, 24 Jun 2022 04:35:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zK5GdbhFRP+Hh1EjIKYd+rkullG3PepgqRnCFHJ4kH4=; b=iEty5FUSSmFa/9xVA4KrmVQorP4ulUOSat59LPCWIsSOunHnM3/gjlzEQqDru2nVK/ rgVZaJj3l1twc1noWHCUVNGdTPLUT7QiGvtZrk5be/XxQVnRsO5BNFRpmGci1ECv0pyA mbOlT2yf6z7YzmKHQQpblEjBGQEKUQqBp6YTgw3FAbLmpdi0vc3Kua+eo/wrjtchewFj duBmxup0hAl3MBPa/PxSzax73Q2tHVZx+VeMukZWgNyOm5/vtNLUfUbm1yhmC0A5xbZ/ +eJynCR3MU34g3NTsVRpRMyEeDTY9ppQ4R0C47dM3qbJwbPOy9s3pFzCGdt9nVeZ5MCO CaPA== X-Gm-Message-State: AJIora9sTCxswqCzASzo/YnVBs7FPox1aJs4/9LbiEqLSG5NfVd9vRm2 dRiqmnqivk0G3gGjG+fVsxEVtF1jQVmiIRQJC//UWzI3S9/hhrBglQh2gyYm9sjA++hwxKYbgrF jYV18dFtPWXty0v4aM+fyAnzRXbu6yKc= X-Received: by 2002:a17:906:65c8:b0:713:ee3e:254d with SMTP id z8-20020a17090665c800b00713ee3e254dmr13210020ejn.0.1656070533756; Fri, 24 Jun 2022 04:35:33 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sAzTsxce3auVXUDpH5Wn/vfvF/8XhYeGYQJaYeAveyjf0CCybrTzY8zCvHhnTy+o/r/lZVUEs+JMiOOi6NI0I= X-Received: by 2002:a17:906:65c8:b0:713:ee3e:254d with SMTP id z8-20020a17090665c800b00713ee3e254dmr13209992ejn.0.1656070533476; Fri, 24 Jun 2022 04:35:33 -0700 (PDT) MIME-Version: 1.0 References: <74ea0c62ebe19db186263053e4051f81d46e9da4.camel@xry111.site> In-Reply-To: From: Jonathan Wakely Date: Fri, 24 Jun 2022 12:35:22 +0100 Message-ID: Subject: Re: [PATCH 3/8] libstdc++: use grep -E instead of egrep in scripts To: Xi Ruoyao Cc: Jonathan Wakely , "libstdc++" , gcc-patches , Rainer Orth X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP, 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: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2022 11:35:37 -0000 On Fri, 24 Jun 2022 at 12:18, Jonathan Wakely wrote: > > On Fri, 24 Jun 2022 at 12:08, Xi Ruoyao via Libstdc++ > wrote: > > > > On Fri, 2022-06-24 at 11:00 +0100, Jonathan Wakely wrote: > > > On Fri, 24 Jun 2022 at 08:03, Xi Ruoyao via Libstdc++ > > > wrote: > > > > > > > > egrep has been deprecated in favor of grep -E for a long time, and > > > > the > > > > next grep release (3.8 or 4.0) will print a warning of egrep is > > > > used. > > > > Stop using egrep so we won't see the warning. > > > > > > > > libstdc++-v3/ChangeLog: > > > > > > > > * scripts/extract_symvers.in: Use grep -E instead of egrep. > > > > * libstdc++-v3/scripts/run_doxygen: Likewise. > > > > > > This should be just scripts/run_doxygen here. You can use the git > > > gcc-verify alias to check your changelog format. > > > > > > > > > With that fixed it's OK for trunk and gcc-12 and gcc-11 branches, > > > thanks! > > > > I'll need some rework as Rainer told me "grep -E" may not work on some > > Solaris systems w/o GNU grep, and the code snippet in extract_symvers.in > > is exactly for Solaris... > > I checked that, and it's not :-) > > The egrep uses in extract_symvers.in are for everything *except* > SunOS. For Solaris we use the scripts/extract_symvers.pl script > instead. > > Your change might break generation of Doxygen API docs on Solaris, but > maybe we can live with that. /usr/xpg4/bin/grep supports the -E flag, so I was going to say that it's acceptable to require that version in the PATH when generating the API docs with doxygen. But in fact that script already assumes GNU grep anyway, using egrep --files-without-match and POSIX grep does not support --files-without-match, or the short form of that option, -L. And in fact, neither of the uses of egrep in scripts/run_doxygen actually needs to use extended regular expressions. Plain ol' grep with Basic Regular Expressions will work fine: problematic=`egrep -l '#include <.*h>' [a-z]*.3` problematic=`egrep --files-without-match '^\.SH SYNOPSIS' [A-Z]*.3` There are no ERE special characters here, so itcould just use 'grep' not 'egrep'. And it won't work with Solaris grep anyway.