More reproducible tarball doc
* doc/tar.texi (PAX keywords): Improve discussion of how to generate reproducible tarballs.
This commit is contained in:
41
doc/tar.texi
41
doc/tar.texi
@@ -10423,6 +10423,9 @@ the following forms:
|
|||||||
When used with one of archive-creation commands,
|
When used with one of archive-creation commands,
|
||||||
this option instructs @command{tar} to omit from extended header records
|
this option instructs @command{tar} to omit from extended header records
|
||||||
that it produces any keywords matching the string @var{pattern}.
|
that it produces any keywords matching the string @var{pattern}.
|
||||||
|
If the pattern contains shell metacharacters like @samp{*}, it should
|
||||||
|
be quoted to prevent the shell from expanding the pattern before
|
||||||
|
@command{tar} sees it.
|
||||||
|
|
||||||
When used in extract or list mode, this option instructs tar
|
When used in extract or list mode, this option instructs tar
|
||||||
to ignore any keywords matching the given @var{pattern} in the extended
|
to ignore any keywords matching the given @var{pattern} in the extended
|
||||||
@@ -10431,7 +10434,7 @@ matching notation described in @acronym{POSIX 1003.2}, 3.13
|
|||||||
(@pxref{wildcards}). For example:
|
(@pxref{wildcards}). For example:
|
||||||
|
|
||||||
@smallexample
|
@smallexample
|
||||||
--pax-option delete=security.*
|
--pax-option 'delete=security.*'
|
||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
would suppress security-related information.
|
would suppress security-related information.
|
||||||
@@ -10560,11 +10563,9 @@ For example, to set all modification times to the current date, you
|
|||||||
use the following option:
|
use the following option:
|
||||||
|
|
||||||
@smallexample
|
@smallexample
|
||||||
--pax-option='mtime:=@{now@}'
|
--pax-option 'mtime:=@{now@}'
|
||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
Note quoting of the option's argument.
|
|
||||||
|
|
||||||
@cindex archives, binary equivalent
|
@cindex archives, binary equivalent
|
||||||
@cindex binary equivalent archives, creating
|
@cindex binary equivalent archives, creating
|
||||||
As another example, here is the option that ensures that any two
|
As another example, here is the option that ensures that any two
|
||||||
@@ -10572,7 +10573,7 @@ archives created using it, will be binary equivalent if they have the
|
|||||||
same contents:
|
same contents:
|
||||||
|
|
||||||
@smallexample
|
@smallexample
|
||||||
--pax-option=atime:=0
|
--pax-option delete=atime
|
||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
@noindent
|
@noindent
|
||||||
@@ -10581,27 +10582,33 @@ from them, you will also need to eliminate changes due to ctime, as
|
|||||||
shown in examples below:
|
shown in examples below:
|
||||||
|
|
||||||
@smallexample
|
@smallexample
|
||||||
--pax-option=atime:=0,ctime:=0
|
--pax-option 'delete=[ac]time'
|
||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
@noindent
|
@noindent
|
||||||
or
|
Normally @command{tar} saves an mtime value with subsecond resolution
|
||||||
|
in an extended header for any file with a timestamp that is not on a
|
||||||
|
one-second boundary. This is in addition to the traditional mtime
|
||||||
|
timestamp in the header block, which can represent integer timestamps
|
||||||
|
in the 1970-01-01 00:00:00 through 2242-03-16 12:56:31 @sc{utc}. If
|
||||||
|
this traditional timestamp suffices and you do not want subsecond
|
||||||
|
timestamp resolution, you can use:
|
||||||
|
|
||||||
@smallexample
|
@smallexample
|
||||||
--pax-option=atime:=0,delete=ctime
|
--pax-option 'delete=[acm]time'
|
||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
Notice, that if you create an archive in POSIX format (@pxref{posix})
|
If the environment variable @env{POSIXLY_CORRECT} is set, two POSIX
|
||||||
and the environment variable @env{POSIXLY_CORRECT} is set, then the
|
archives created using the same options on the same set of files might
|
||||||
two archives created using the same options on the same set of files
|
not be byte-to-byte equivalent even with the above options. This is
|
||||||
will not be byte-to-byte equivalent even with the above option. This
|
because the POSIX default for extended header names includes
|
||||||
is because the posix default for extended header names includes the
|
@command{tar}'s process @acronym{ID}, which typically differs at each
|
||||||
PID of the tar process, which is different at each run. To produce
|
run. To produce byte-to-byte equivalent archives in this case, either
|
||||||
byte-to-byte equivalent archives in this case, either unset
|
unset @env{POSIXLY_CORRECT}, or use the following option, which can be
|
||||||
@env{POSIXLY_CORRECT}, or use the following option:
|
combined with the above options:
|
||||||
|
|
||||||
@smallexample
|
@smallexample
|
||||||
---pax-option=exthdr.name=%d/PaxHeaders/%f,atime:=0,ctime:=0
|
--pax-option exthdr.name=%d/PaxHeaders/%f
|
||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
@node Checksumming
|
@node Checksumming
|
||||||
|
|||||||
Reference in New Issue
Block a user