bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-tar] Tar 1.23 patch proposed to enable symlink timestamp restoratio


From: MELENNEC Ronan DGAC/CEDRe
Subject: [Bug-tar] Tar 1.23 patch proposed to enable symlink timestamp restoration
Date: Fri, 23 Apr 2010 19:33:52 +0200

Hi, hello,

I would like to propose a change (see attachment)
to Gnu Tar 1.23 in order to allow symbolic links to be restored
with their tar-archived timestamps restored as well
(on systems where the kernel and the C library support this).

I have failed to enable this functionality
by compiling tar-1.23 without source code changes,
even though I know for sure that my kernel
and C library support it (this can be proven
using "touch" compiled from Gnu coreutils 8.4).

I have noticed a patch to this effect
proposed last year by Carl Worth,
(see <http://www.mail-archive.com/address@hidden/msg02281.html>)
but apparently this patch is no longer applicable
to last released version (tar 1.23, March 2010) ;
source file having substantially changed since.

My patch only changes tar-1.23/src/extract.c :
- a test on file type barring symlink timestamps
from being restored is removed ;
- a call to utimens() is replaced by a call to lutimens().

The configuration scripts do not need to be changed.
The base code (typically providing lutimens()
as a wrapper around syscall function(s) such as utimensat())
is already functional ands does not need to be changed.

The tar -m option ("touch" option) still works as expected.

Limitations :
- as of today I can only test on Linux Ubuntu 9.10
(using a 2.6.31 kernel) ;
- I have not thoroughly analysed the relevant configuration
scripts.
Therefore I cannot make any assessment of portability.

My advice :
- this functionality is desirable as it aligns
tar with other tools such as
rsync and touch (the latter from Gnu coreutils 8.4).
- source code reuse from coreutils touch or possibly rsync
is suggested (as the configuration logic used in tar sources
remains somewhat complicated).

Cordially,
--
Ronan Melennec
<ronan.melennec "at" aviation-civile.gouv.fr>
--

Attachment: tar-1.23-src-extract.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]