libguestfs/0005-appliance-Use-stable-owner-group-and-mtime-in-applia.patch
Richard W.M. Jones 0b82e08b9e Replace Jansson with json-c
resolves: RHEL-65292
2024-10-30 11:27:45 +00:00

54 lines
1.7 KiB
Diff

From 53632b4b8245a6dd67c95015d52d1f4c562b14ed Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Mon, 21 Oct 2024 11:50:05 +0100
Subject: [PATCH] appliance: Use stable owner, group and mtime in appliance
tarballs
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2320025
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
---
appliance/Makefile.am | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/appliance/Makefile.am b/appliance/Makefile.am
index 8cb9bd1f..7edc90e6 100644
--- a/appliance/Makefile.am
+++ b/appliance/Makefile.am
@@ -113,12 +113,17 @@ packagelist: packagelist.in Makefile guestfsd.deps
cmp -s $@ $@-t || mv $@-t $@
rm -f $@-t
+# Use stable times and owner/group (RHBZ#2320025).
+TAR_COMMAND := tar -z \
+ --owner=0 --group=0 \
+ $${SOURCE_DATE_EPOCH:+--mtime=@"$$SOURCE_DATE_EPOCH"}
+
supermin.d/daemon.tar.gz: ../daemon/guestfsd
rm -f $@ $@-t
rm -rf tmp-d
mkdir -p tmp-d$(DAEMON_SUPERMIN_DIR) tmp-d/etc
ln ../daemon/guestfsd tmp-d$(DAEMON_SUPERMIN_DIR)/guestfsd
- ( cd tmp-d && tar zcf - * ) > $@-t
+ ( cd tmp-d && $(TAR_COMMAND) -cf - * ) > $@-t
rm -r tmp-d
mv $@-t $@
@@ -139,7 +144,7 @@ supermin.d/hostfiles: hostfiles.in Makefile
supermin.d/init.tar.gz: init
rm -f $@ $@-t
- ( cd $(srcdir) && tar zcf - init ) > $@-t
+ ( cd $(srcdir) && $(TAR_COMMAND) -cf - init ) > $@-t
mv $@-t $@
# We should put this file in /lib/udev/rules.d, but put it in /etc so
@@ -149,7 +154,7 @@ supermin.d/udev-rules.tar.gz: 99-guestfs-serial.rules
rm -rf tmp-u
mkdir -p tmp-u/etc/udev/rules.d
for f in $^; do ln $$f tmp-u/etc/udev/rules.d/$$(basename $$f); done
- ( cd tmp-u && tar zcf - etc ) > $@-t
+ ( cd tmp-u && $(TAR_COMMAND) -cf - etc ) > $@-t
rm -r tmp-u
mv $@-t $@