bug-tar
[Top][All Lists]
Advanced

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

Re: [PATCH] change default --format from gnu to posix


From: Paul Eggert
Subject: Re: [PATCH] change default --format from gnu to posix
Date: Mon, 13 Dec 2021 12:50:44 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.1

On 12/13/21 03:30, Sergey Poznyakoff wrote:
Reproducible tarballs in PAX format are
easily made with the following option:

   --pax-option=exthdr.name=%d/PaxHeaders/%f,atime:=0,ctime:=0

I tried this, and unfortunately it introduced unnecessary extended pax records into the output. For example:

opts='--pax-option=exthdr.name=%d/PaxHeaders/%f,atime:=0,ctime:=0'
touch -d 2021-12-13T00:00:00Z foo
tar -cf t1 -H ustar foo
tar -cf t2 -H pax $opts foo

Although t1 and t2 should be identical, t2 contains an unnecessary pax extended header saying "ctime=0" and "atime=0".

I installed the attached patch to suggest --pax option 'delete=[ac]time' instead; this should work around the issue.

Perhaps 'tar' should be changed to not output unnecessary pax extended headers in cases like these; this would take some hacking, though, and I'm not sure it's worth it.

For tzdb I've suppressed mtime records in extended pax headers by touching all the files to integer-second-resolution timestamps as shown in the above example. I do this because I want the tarball timestamps to exactly match what's in Git.

Perhaps there should be a more convenient way for tar to generate pax-format tarballs without atime and ctime (and perhaps without extended mtime records too), as for software distro tarballs there's often little value and perhaps even some hassle with those subsecond-resolution timestamps.

Or simpler advice might be simply "use ustar format for software distros"...

Attachment: 0001-More-reproducible-tarball-doc.patch
Description: Text Data


reply via email to

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