From: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Date: Thu, 6 Jun 2013 14:31:25 +0300
Subject: Mangle PAX headers when using posix tar format

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.

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 d36e51b..4421068 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);
