[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-tar] [PATCH] Do not fail when 'compress' is unable to provide suffi
From: |
Pavel Raiskup |
Subject: |
[Bug-tar] [PATCH] Do not fail when 'compress' is unable to provide sufficient compress ratio |
Date: |
Mon, 25 Feb 2013 11:13:14 +0100 |
Hello,
as is written in compress manual page
[...]
Exit status is normally 0; if the last file is larger after (attempted)
compression, the status is 2; if an error occurs, exit status is 1.
the compress utility could end with exit value 2 which does not mean fatal
error. It is just some kind of warning. Gnu tar is unable to recognize
this error value and it thinks that some fatal error happened in the
background.. The easiest way how to reproduce this:
$ dd if=/dev/urandom of=testfile bs=1K count=1024
$ tar -cZf test.tar.Z testfile
-rw-rw-r-- praiskup/praiskup 1048576 2013-02-22 16:49 testfile
/home/praiskup/projects/tar/src/tar: Child returned status 2
/home/praiskup/projects/tar/src/tar: Error is not recoverable: exiting now
$ echo $?
2
See: https://bugzilla.redhat.com/show_bug.cgi?id=914733
I know that the 'compress' utility could be considered antique but it may
still be used by some users (this problem was originally reported
by our customer https://bugzilla.redhat.com/show_bug.cgi?id=759371). It
is also quite pity to have such detail in tar.
I'm attaching one possible solution, could you look at it? As usually,
I'd be glad to fix issues you see in this patch, but feel free to scratch
this and fix it by different way ;),
Thanks for comments!
Pavel
0001-tar-The-Lempel-Ziv-coding-bugfix.patch
Description: Text Data
- [Bug-tar] [PATCH] Do not fail when 'compress' is unable to provide sufficient compress ratio,
Pavel Raiskup <=