bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-tar] tar: do not fail hardly when compressor just warns


From: Antonio Diaz Diaz
Subject: Re: [Bug-tar] tar: do not fail hardly when compressor just warns
Date: Mon, 29 Apr 2013 20:26:45 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.7.11) Gecko/20050905

Pavel Raiskup wrote:
Hi Antonio, thanks for comments,

You are welcome. :-)


Exit value 2 is a general warning exit status among compressors

Then those compressors have a serious problem with their APIs that should be fixed, or at least carefully documented. Callers like tar do not mind if there were warnings or not, only if the data was succesfully compressed or not.


if important programs like GNU tar begin accepting an exit status of '2'
as success for those compressors, it will prevent them from switching to
the correct and sane API

This is not so truth, nobody prevents anyone from switching

Suppose that gzip-1.6 begins returning '2' to mean fatal error, just as most compressors are already doing (see below). This would work fine with the current tar. But if '-z' is modified to accept '2' as success, then the new tar with gzip-1.6 would produce truncated archives without a warning. This is far worse than giving an spurious error. Therefore, if tar is modified, gzip won't.


This patch is intended just to make tar work *now* .. don't wait forever.

Passing -f to compress and considering all warnings from gzip as errors is the simplest and safest way of making tar work now without compromising the future.


And even if some standard compressor change its API (I see this as an
highly unlikely), it is very easily configurable on target distribution
tar (distro maintainers can know, which API its distributed compressor
uses) - not possible now, thats why I am trying to solve this.

If tar is modified and later some compressor changes its API, user's scripts will break and chaos will develop as soon as a partial update is made.


It seems that pigz does not use the compress API.

Thanks for this info!  Tried to find it in manual page and wasn't
successful.

I had to look at the source.

In addition to bzip2 and lzip (and all their derivatives and parallel versions), it seems that all parallel compressors use the standard API, not the compress one.

Pixz, for example, returns '2' in case of fatal error[1].
[1] https://github.com/vasi/pixz/blob/master/pixz.c


Best regards,
Antonio.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]