Bug 42500 - tar task is incompatible with BusyBox v1.3.1 (the "old GNU format")
Summary: tar task is incompatible with BusyBox v1.3.1 (the "old GNU format")
Status: RESOLVED FIXED
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.7.0
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: 1.8.0
Assignee: Ant Notifications List
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2007-05-23 11:08 UTC by Timo Kinnunen
Modified: 2012-06-17 05:16 UTC (History)
0 users



Attachments
A header from a tarfile produced by BusyBox (2.16 KB, text/plain)
2007-05-23 11:13 UTC, Timo Kinnunen
Details
A header from a tarfile produced by ant (2.16 KB, text/plain)
2007-05-23 11:13 UTC, Timo Kinnunen
Details
A proposed patch to Tar.java (1.35 KB, patch)
2007-05-23 11:21 UTC, Timo Kinnunen
Details | Diff
A proposed patch to TarEntry.java (3.80 KB, patch)
2007-05-23 11:22 UTC, Timo Kinnunen
Details | Diff
A proposed patch to TarUtils.java (2.20 KB, patch)
2007-05-23 11:22 UTC, Timo Kinnunen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Timo Kinnunen 2007-05-23 11:08:02 UTC
Headers produced by tar task can't be read on BusyBox v1.3.1 which uses the old
GNU format ("ustar  "). The error message is:
tar: invalid number ' 11421'
indicating that BusyBox doesn't understand the checksum field. There are also
other differences: octal fields are padded with zeros and don't contain a
trailing space and devmajor and devminor fields are not filled in at all.
Comment 1 Timo Kinnunen 2007-05-23 11:13:16 UTC
Created attachment 20255 [details]
A header from a tarfile produced by BusyBox
Comment 2 Timo Kinnunen 2007-05-23 11:13:50 UTC
Created attachment 20256 [details]
A header from a tarfile produced by ant
Comment 3 Timo Kinnunen 2007-05-23 11:21:56 UTC
Created attachment 20257 [details]
A proposed patch to Tar.java

This is a reverse-engineered compatibility mode to tar task which is activated
with an experimental attribute header="oldgnu".
Comment 4 Timo Kinnunen 2007-05-23 11:22:19 UTC
Created attachment 20258 [details]
A proposed patch to TarEntry.java
Comment 5 Timo Kinnunen 2007-05-23 11:22:40 UTC
Created attachment 20259 [details]
A proposed patch to TarUtils.java
Comment 6 Steve Loughran 2007-05-24 02:41:11 UTC
hmmm. 

It would probably make sense to split this with a a new format value,
(format="busybox") rather than a header attribute, as then we'd have to deal
with with headers being set for different formats.

How well does <untar> handle busybox tar files?
Comment 7 Peter Reilly 2007-05-24 02:51:04 UTC
There was an issue with busy box before.
http://issues.apache.org/bugzilla/show_bug.cgi?id=40195
I do not know if this is related.
I would not think that busybox is the format name to use
- the initial description calls it GNU - ustar.
Is there a spec for this?
Comment 8 Timo Kinnunen 2007-05-24 03:10:48 UTC
untar as well as Winzip can handle BusyBox tars.
Comment 9 Steve Loughran 2007-05-24 03:39:42 UTC
Timo? You mean the <untar> task can handle busybox? Or the untar program?

Peter, I did a quick search for busybox+ustar; here's some relevant links

http://www.opengroup.org/onlinepubs/009695399/utilities/pax.html#tag_04_100_13_06
http://busybox.net/cgi-bin/viewcvs.cgi/trunk/busybox/docs/tar_pax.txt?rev=17252

.. ustar is a posix format ..incompatiblities between busybox and gnu are known 

discussion and apparent fix of busybox incompatibilities:
http://lists.nongnu.org/archive/html/bug-tar/2004-02/msg00014.html
http://lists.debian.org/debian-boot/2004/02/msg01250.html
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=230872

I'm not sure where those fixes leave us...if recent busybox builds are
compatible with gnu/ant files, then I'd be tempted to leave as is. 

Timo: what happens under busybox 1.5.x?

Comment 10 Timo Kinnunen 2007-05-24 04:10:12 UTC
Sorry, I meant <untar>.

I unfortunately don't have any other versions of BusyBox. The version that I
have is running in an embedded device, so I'm pretty much stuck with it.
Comment 11 Colin D Bennett 2007-10-17 13:22:27 UTC
I confirm that this occurs with BusyBox 1.7.1 when the config option
CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY is not set. However, if you set
CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY=y, then BusyBox *can* read the Ant 'tar'
task-created files.

The BusyBox help said that the OLDGNU format is usually not needed, and I think
that Ant should stop generating tar files in this obsolete format. But for now,
using the config option for "oldgnu" compatibility works around it.
Comment 12 Stefan Bodewig 2012-06-17 05:16:08 UTC
I think Ant's tar task now creates tar archives with less quirks and has been doing so for quite some time.  Likely fixed in the 1.8 series of releases.