conor 02/02/22 05:01:59
Modified: src/main/org/apache/tools/tar TarInputStream.java
Log:
Do not require tar files to be in ustar format. Old V7 format should now
be handled. The main difference is in the handling of uid vs uname which
isn't that relevant to Ant anyhow.
PR: 6634
Revision Changes Path
1.7 +4 -26
jakarta-ant/src/main/org/apache/tools/tar/TarInputStream.java
Index: TarInputStream.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/tar/TarInputStream.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -u -r1.6 -r1.7
--- TarInputStream.java 10 Jan 2002 10:40:48 -0000 1.6
+++ TarInputStream.java 22 Feb 2002 13:01:59 -0000 1.7
@@ -83,6 +83,7 @@
protected byte[] readBuf;
protected TarBuffer buffer;
protected TarEntry currEntry;
+ private boolean v7Format;
public TarInputStream(InputStream is) {
this(is, TarBuffer.DEFAULT_BLKSIZE, TarBuffer.DEFAULT_RCDSIZE);
@@ -100,6 +101,7 @@
this.oneBuf = new byte[1];
this.debug = false;
this.hasHitEOF = false;
+ this.v7Format = false;
}
/**
@@ -248,31 +250,7 @@
if (!(headerBuf[257] == 'u' && headerBuf[258] == 's'
&& headerBuf[259] == 't' && headerBuf[260] == 'a'
&& headerBuf[261] == 'r')) {
- this.entrySize = 0;
- this.entryOffset = 0;
- this.currEntry = null;
-
- throw new IOException("bad header in block "
- + this.buffer.getCurrentBlockNum()
- + " record "
- + this.buffer.getCurrentRecordNum()
- + ", " +
- "header magic is not 'ustar', but '"
- + headerBuf[257]
- + headerBuf[258]
- + headerBuf[259]
- + headerBuf[260]
- + headerBuf[261]
- + "', or (dec) "
- + ((int) headerBuf[257])
- + ", "
- + ((int) headerBuf[258])
- + ", "
- + ((int) headerBuf[259])
- + ", "
- + ((int) headerBuf[260])
- + ", "
- + ((int) headerBuf[261]));
+ this.v7Format = true;
}
if (this.debug) {
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>