New option: --set-mtime-command

* NEWS: Document new option.
* src/common.h (COMMAND_MTIME): New constant.
* src/create.c (set_mtime_command)
(set_mtime_format): New globals.
(sys_exec_setmtime_script): New prototype.
* src/system.c (start_header): Handle COMMAND_MTIME.
* src/tar.c (sys_exec_setmtime_script): New function.
This commit is contained in:
Sergey Poznyakoff
2023-08-01 15:39:15 +03:00
parent eb30aa7801
commit 9a30bb2674
5 changed files with 242 additions and 3 deletions

21
NEWS
View File

@@ -1,10 +1,29 @@
GNU tar NEWS - User visible changes. 2023-07-24
GNU tar NEWS - User visible changes. 2023-08-01
Please send GNU tar bug reports to <bug-tar@gnu.org>
version TBD
* New manual section "Reproducibility", for reproducible tarballs.
* New options: --set-mtime-command and --set-mtime-format
Both options are valid when archiving files.
** --set-mtime-command=COMMAND
For each FILE being archived, run "COMMAND FILE", parse its
output as time string and set mtime value of the archive member
from the result.
Unless --set-mtime-format is also used, the output is parsed
as argument to --mtime option (see GNU tar manual, chapter 4
"Date input formats".
** --set-mtime-format=FMT
Defines output format for the COMMAND set by the above option. If
used, command output will be parsed using strptime(3).
version 1.35 - Sergey Poznyakoff, 2023-07-18