This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Remove superfluous /dev/null on grep line
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Jonathan Wakely <jwakely at redhat dot com>
- Cc: Eric Botcazou <ebotcazou at adacore dot com>, gcc-patches at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
- Date: Wed, 6 Apr 2016 11:17:08 +0200
- Subject: Re: [patch] Remove superfluous /dev/null on grep line
- Authentication-results: sourceware.org; auth=none
- References: <3554293 dot nIQqjdAT3l at polaris> <20160406085048 dot GL5814 at redhat dot com> <20160406090126 dot GU19207 at tucnak dot redhat dot com> <20160406091218 dot GM5814 at redhat dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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