bug-tar
[Top][All Lists]
Advanced

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

Re: [Bug-tar] tar-1.28 released [stable]


From: Denis Excoffier
Subject: Re: [Bug-tar] tar-1.28 released [stable]
Date: Wed, 30 Jul 2014 20:26:12 +0200

On 2014-07-28 22:53, Denis Excoffier wrote:

> Hello,
> 
> On 2014-07-27 23:29 Sergey Poznyakoff wrote:
>> * New option --sort
>> 
>> The --sort=ORDER option instructs tar to sort directory entries
>> according to ORDER.  It takes effect when creating archives.
> Can we expect an LC_COLLATE-aware version of the sort algorithm in some near 
> future?
> See for example 
> http://lists.gnu.org/archive/html/bug-tar/2012-07/msg00014.html
> 
> Second point: under Darwin 13.3.0, linux extended attributes don’t seem
> to work, therefore i used ‘configure --without-xattrs’. But this is not enough
> to compile successfully because lib/xattrs-at.c has also to be withdrawn
> (or made inactive by '#if 0 ... #endif’ or otherwise).
> 
> Last (and minor) point: s/warniing/warning/ in ChangeLog.
> 
> 
I have another four points:

1) I have some problems to make
--create --format=posix --pax-option=mtime:=1,atime:=2,ctime:=3
to work as expected. I expect an extended header to be created for
all archive members. Apparently, the extended header is present only when it is
created for other reasons (eg path too long), and in this case, the keywords
are indeed set with the values indicated. The following patch works for me in
this respect, at least for archive creation:

--- xheader.c.original  2014-02-25 23:25:37.000000000 +0100
+++ xheader.c.patched   2014-07-30 18:29:25.000000000 +0200
@@ -803,10 +803,11 @@
   t = locate_handler (keyword);
   if (!t || !t->coder)
     return;
-  if (xheader_keyword_deleted_p (keyword)
-      || xheader_keyword_override_p (keyword))
+  if (xheader_keyword_deleted_p (keyword))
     return;
   xheader_init (&st->xhdr);
+  if (xheader_keyword_override_p (keyword))
+    return;
   t->coder (st, keyword, &st->xhdr, data);
 }
 

2) I suggest that the value of the --mtime option (when
specified) be used as the default value for exthdr.mtime,
instead of using the modification time of the corresponding
member. This is implemented in the following patch (a test case
is missing):

diff -uNr tar-1.28.original/doc/tar.texi tar-1.28.patched/doc/tar.texi
--- tar-1.28.original/doc/tar.texi      2014-07-22 02:37:16.000000000 +0200
+++ tar-1.28.patched/doc/tar.texi       2014-07-30 18:50:10.000000000 +0200
@@ -9925,8 +9925,10 @@
 
 This keyword defines the value of the @samp{mtime} field that
 is written into the ustar header blocks for the extended headers.
-By default, the @samp{mtime} field is set to the modification time
-of the archive member described by that extended headers.
+By default, the @samp{mtime} field is set to the argument of the
address@hidden option if it is specified, otherwise it is set to
+the modification time of the archive member described by
+that extended headers.
 
 @item address@hidden
 This keyword allows user control over the name that is written into
diff -uNr tar-1.28.original/src/create.c tar-1.28.patched/src/create.c
--- tar-1.28.original/src/create.c      2014-03-02 20:06:36.000000000 +0100
+++ tar-1.28.patched/src/create.c       2014-07-30 18:36:05.000000000 +0200
@@ -706,7 +706,7 @@
     {
       type = XHDTYPE;
       p = xheader_xhdr_name (st);
-      t = st->stat.st_mtime;
+      t = set_mtime_option ? mtime_option.tv_sec : st->stat.st_mtime;
     }
   xheader_write (type, p, t, &st->xhdr);
   free (p);


3) About the documentation: in the node 'PAX keywords' it is indicated
that any two archives created using
--pax-option=exthdr.name=%d/PaxHeaders/%f,atime:=0
will be binary equivalent. Although this can be understood to be true
in theory, in practice you always have to manage 'ctime' (eg once your
archive is created, you cannot extract + create it again and still obtain
the same archive). Therefore i'd suggest that 'delete=ctime' or 'ctime:=0'
is added if one is especially concerned with binary equivalence.


4)
s/pax.opion/pax.option/ in NEWS
s/that extended headers/that extended header/ in tar.texi


Regards,

Denis Excoffier.





reply via email to

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