From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 33521 invoked by alias); 6 Apr 2016 09:17:16 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 33501 invoked by uid 89); 6 Apr 2016 09:17:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=UD:top, p X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 06 Apr 2016 09:17:14 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0BA4BC049E1E; Wed, 6 Apr 2016 09:17:13 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-113-22.phx2.redhat.com [10.3.113.22]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u369HBA9032133 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 6 Apr 2016 05:17:12 -0400 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id u369H9Ob009683; Wed, 6 Apr 2016 11:17:10 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id u369H8GP009682; Wed, 6 Apr 2016 11:17:08 +0200 Date: Wed, 06 Apr 2016 09:17:00 -0000 From: Jakub Jelinek To: Jonathan Wakely Cc: Eric Botcazou , gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org Subject: Re: [patch] Remove superfluous /dev/null on grep line Message-ID: <20160406091708.GV19207@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <3554293.nIQqjdAT3l@polaris> <20160406085048.GL5814@redhat.com> <20160406090126.GU19207@tucnak.redhat.com> <20160406091218.GM5814@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160406091218.GM5814@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-IsSubscribed: yes X-SW-Source: 2016-04/txt/msg00280.txt.bz2 On Wed, Apr 06, 2016 at 10:12:18AM +0100, Jonathan Wakely wrote: > >As it is a make variable, can't make be used to test this? > >So perhaps > > chmod +w $@.tmp > >ifneq ($(port_specific_symbol_files),) > > if grep '^# Appended to version file.' \ > > $(port_specific_symbol_files) /dev/null > /dev/null 2>&1; then \ > > cat $(port_specific_symbol_files) >> $@.tmp; \ > > else \ > > sed -n '1,/DO NOT DELETE/p' $@.tmp > tmp.top; \ > > sed -n '/DO NOT DELETE/,$$p' $@.tmp > tmp.bottom; \ > > cat tmp.top $(port_specific_symbol_files) tmp.bottom > $@.tmp; \ > > rm tmp.top tmp.bottom; \ > > fi; > >endif > >? Though, I think the initial and trailing whitespace is removed during > >expansion (or already parsing of the vars), so even the > >test "x$(port_specific_symbol_files)" != x > >check should work right. > > OK, I have no objection to the original patch then. To correct myself, only leading whitespace is removed, trailing is not, but when we do care about vars containing only whitespace, that means removing everything. Jakub