summaryrefslogtreecommitdiff
path: root/packaging/0008-Mangle-PAX-headers-when-using-posix-tar-format.patch
blob: d2862b0eacb1d7873e9dab42df0cdd7fae1d7a3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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);