patch for "lone zero block" warning when untarring packages
| From: | Andreas Korthaus | Date: | Wed, 21 Sep 2005 11:31:20 +0000 |
| Subject: | patch for "lone zero block" warning when untarring packages | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-39890@lists.php.net to get a copy of this message | ||
Hi!
When extracting .tgz files created with PEAR::Archive_Tar (e.g. PECL and PEAR packages), newer GNU tar implementations show a warning like:
'tar: A lone zero block at *'
The reason for this message is that GNU tar format has been changed to require TWO zero blocks marking the end of the archive but PEAR::Archive_Tar is writing only ONE zero block.
Details: http://www.gnu.org/software/tar/manual/html_chapter/tar_8.html#SEC134
I found the solution here (fix for Ant): http://issues.apache.org/bugzilla/show_bug.cgi?id=28776
The solution should be quite simple:
Index: Tar.php
===================================================================
RCS file: /repository/pear-core/Archive/Tar.php,v
retrieving revision 1.20
diff -u -p -r1.20 Tar.php
--- Tar.php 8 Jan 2004 17:33:09 -0000 1.20 +++ Tar.php 19 Sep 2005 12:40:15 -0000@@ -719,6 +719,7 @@ class Archive_Tar extends PEAR
// ----- Write the last 0 filled block for end of archive
$v_binary_data = pack("a512", '');
$this->_writeBlock($v_binary_data);
+ $this->_writeBlock($v_binary_data);
}
return true;
}
cvs diff: Diffing docs
Should not be a problem with BC, as a zero block is used to finish an archive.
this will fix:
-> http://pear.php.net/bugs/bug.php?id=3694
-> http://pear.php.net/bugs/bug.php?id=5452
best regards
Andreas