[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-tar] globexthdr.mtime should accept sub-second precision
From: |
Kang-Che Sung |
Subject: |
[Bug-tar] globexthdr.mtime should accept sub-second precision |
Date: |
Tue, 20 Feb 2018 23:48:36 +0800 |
The pax option "globexthdr.mtime" does not yet accept a timestamp that contains
fraction of seconds. It should accept it, and intelligently cut it to an
integer of seconds.
Steps to reproduce:
$ d=2018-02-20T15:04:42.020859855Z
$ echo hello >test.txt
$ touch -d "${d}" test.txt
$ x="globexthdr.name=pax_global_header,exthdr.name=%d/PaxHeaders/%f"
$ x="${x},delete=atime,delete=ctime"
$ opt="${x},globexthdr.mtime={${d}},comment=hello"
$ tar -c --format=pax --pax-option="$opt" -f test1.tar test.txt
$ opt="${x},globexthdr.mtime={$(echo ${d}|sed 's/\.[0-9]*//')},comment=hello"
$ tar -c --format=pax --pax-option="$opt" -f test2.tar test.txt
The steps above should be deterministic and test1.tar and test2.tar should be
bit-identical.
Actual result: (tested on both 1.27.1-1ubuntu0.1 and 1.30)
The first command produces error "tar: Time stamp is out of allowed range" and
has pax_global_header in the current time.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Bug-tar] globexthdr.mtime should accept sub-second precision,
Kang-Che Sung <=