Subject: | Could not update timestamp warning on symlinks |
Date: | Thu, 28 Feb 2008 13:47:34 -0500 |
To: | bug-archive-tar [...] rt.cpan.org |
From: | "Chapman, Keith" <keith.chapman [...] lmco.com> |
TWIMC,
I may misunderstand the expected behavior of tar (if so, you can just
say that and not have to explain), but it appears that
Archive::Tar::_extract_file (on line 675 in version 1.38) attempts to
update the timestamps on the extracted file even if it is a symlink. On
Solaris (at least), this always results in an attempt to modify the
timestamp of the target of the link, which I don't believe is correct
behavior. In my case, I get warnings because the symlinks point to
files that have read-only permissions.
GNU tar 1.15.1 does not seem to give these same warnings, but I don't
know if that's because it's not attempting to change the timestamps or
it's just not mentioning the failure.
If you agree, a fix may be to wrap lines 675-676 with an "if" like that
on line 685:
if ( not -l $full ) {
utime time, $entry->mtime - TIME_OFFSET, $full or
$self->_error( ... );
}
This may have to be refined to only act this way on Unix platforms; I
don't know anything about the behavior of symlinks on other platforms.
Even if you don't agree, please consider adding the name of the file in
question to the error message (that seems to be the only error condition
in that subroutine that doesn't mention the file that's having a
problem).
For reference, my operating environment is:
OS: Unix
uname -a output: SunOS itlccdevsvr2 5.10 Generic_120011-14 sun4u sparc
SUNW,Sun-Fire-280R
perl -v output: This is perl, v5.8.7 built for sun4-solaris
Thanks for your attention,
--keith