Skip to content

Commit 7a80a6e

Browse files
committed
prepare: Use stable owner, group and mtime in base.tar.gz
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2320025 Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
1 parent 685f148 commit 7a80a6e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/mode_prepare.ml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,12 @@ let prepare debug (copy_kernel, format, host_cpu,
166166
let base = outputdir // "base.tar.gz" in
167167
if debug >= 1 then printf "supermin: writing %s\n%!" base;
168168
let cmd =
169-
sprintf "tar%s -C %s -zcf %s -T %s"
169+
let mtime =
170+
try sprintf "--mtime=@%s" (quote (Sys.getenv "SOURCE_DATE_EPOCH"))
171+
with Not_found -> "" in
172+
sprintf "tar%s -C %s -z --owner=0 --group=0 %s -cf %s -T %s"
170173
(if debug >=1 then " -v" else "")
171-
(quote dir) (quote base) (quote files_from) in
174+
(quote dir) mtime (quote base) (quote files_from) in
172175
run_command cmd;
173176
)
174177
else (

0 commit comments

Comments
 (0)