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

Bug#807586: [PATCH] Mangle PAX headers when using posix tar format



Package: pristine-tar
Version: 1.33
Tags: patch

Remove all timestamps from extended PAX headers in order to guarantee
that created tarballs are always identical so that the delta can be
applied cleanly.

The timestamps can break pristine-tar generation as they are different
every time an archive is generated from git (when using tree id
instead of commit id as the sha-1 to checkout). Git uses the current
time as the modification time of files when a tree is archived.

Change-Id: Iceba202e5b4a6a01def724b8922028dbf3e3a2b3
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
---
 pristine-tar | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/pristine-tar b/pristine-tar
index 0bf44e8..da59de9 100755
--- a/pristine-tar
+++ b/pristine-tar
@@ -378,6 +378,11 @@ sub recreatetarball_helper {
             "--files-from", "$tempdir/manifest");
 	if (exists $options{tar_format}) {
 		push @cmd, ("-H", $options{tar_format});
+		if ($options{tar_format} eq 'posix') {
+			# Mangle PAX headers so that created tarballs are always identical
+			# so that delta can be successfully applied
+			push @cmd, ('--pax-option=exthdr.name=%d/PaxHeaders/%f,mtime:=0,atime:=0,ctime:=0');
+		}
 	}
 
 	doit(@cmd);
-- 
2.1.4


Reply to: