GNU bug report logs - #19614
make dist exits succesfully even when tar exits with error

Previous Next

Package: automake;

Reported by: Dimitrios Apostolou <jimis <at> gmx.net>

Date: Fri, 16 Jan 2015 15:02:02 UTC

Severity: normal

Tags: confirmed

Full log


View this message in rfc822 format

From: Dimitrios Apostolou <jimis <at> gmx.net>
To: Eric Blake <eblake <at> redhat.com>
Cc: 19614 <at> debbugs.gnu.org
Subject: bug#19614: make dist exits succesfully even when tar exits with error
Date: Fri, 16 Jan 2015 18:15:08 +0100 (CET)
On Fri, 16 Jan 2015, Eric Blake wrote:
> On 01/16/2015 08:01 AM, Dimitrios Apostolou wrote:
>> Relevant output from "make V=1 dist":
>>
>> tardir=cfengine-3.7.0a1.5ffcc54 && tar --format=ustar -chf - "$tardir" |
>> GZIP=--best gzip -c >cfengine-3.7.0a1.5ffcc54.tar.gz
>
> It is portable to do something hairy like:
>
> { tar ...; echo $? > file; } | gzip ...
> inspect file
>
> It is even possible to avoid an intermediate file with even hairier exec
> operations to shuffle fds around.
>
> It may be simpler to break things into two steps, with an intermediate
> file instead of a pipeline, although I'm not sure it would be efficient.
>
> But you definitely make a point that we should fix things to detect tar
> failure.

What if we just grep stderr for *any* output from any command in the 
pipeline?

{ tar ... | gzip ... ; } 2>&1 1>/dev/null | grep .

Nobody guarantees that it can't fail silently or it can't succeed despite 
output in stderr, but it's pretty rare.


Dimitris





This bug report was last modified 1 year and 333 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.