From a74d8907fb3b25f4da14e6e9db061f7f0c36c550 Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Fri, 23 Aug 2013 01:04:56 +0300 Subject: [PATCH] Fix posix tar generation Remove all timestamps the PAX extended headers of posix tar archives. Change-Id: I5db7d76be5256442d10b6ed1d35fe2b868dd693c Signed-off-by: Markus Lehtonen --- debian/changelog | 6 +++++ ...-obey-the-XDELTA_PROGRAM-build-parameter.patch} | 0 ...ch => 0002-implement-tar-format-guessing.patch} | 0 ... => 0003-Use-posix-tar-format-by-default.patch} | 0 ...-PAX-headers-when-using-posix-tar-format.patch} | 0 ...-all-timestamps-from-extended-PAX-headers.patch | 28 ++++++++++++++++++++++ debian/patches/series | 9 +++---- ...-all-timestamps-from-extended-PAX-headers.patch | 28 ++++++++++++++++++++++ packaging/pristine-tar.changes | 3 +++ packaging/pristine-tar.spec | 3 +++ 10 files changed, 73 insertions(+), 4 deletions(-) rename debian/patches/{0005-pristine-gz-obey-the-XDELTA_PROGRAM-build-parameter.patch => 0001-pristine-gz-obey-the-XDELTA_PROGRAM-build-parameter.patch} (100%) rename debian/patches/{0007-implement-tar-format-guessing.patch => 0002-implement-tar-format-guessing.patch} (100%) rename debian/patches/{0008-Use-posix-tar-format-by-default.patch => 0003-Use-posix-tar-format-by-default.patch} (100%) rename debian/patches/{0009-Mangle-PAX-headers-when-using-posix-tar-format.patch => 0004-Mangle-PAX-headers-when-using-posix-tar-format.patch} (100%) create mode 100644 debian/patches/0005-Remove-all-timestamps-from-extended-PAX-headers.patch create mode 100644 packaging/0010-Remove-all-timestamps-from-extended-PAX-headers.patch diff --git a/debian/changelog b/debian/changelog index 8e9e43f..13c2c7f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +pristine-tar (1.28-2) unstable; urgency=low + + * Remove all timestamps from extended PAX headers of posix tarballs + + -- Markus Lehtonen Fri, 23 Aug 2013 11:28:41 +0300 + pristine-tar (1.28-1) unstable; urgency=low * Fixes Bug #998 diff --git a/debian/patches/0005-pristine-gz-obey-the-XDELTA_PROGRAM-build-parameter.patch b/debian/patches/0001-pristine-gz-obey-the-XDELTA_PROGRAM-build-parameter.patch similarity index 100% rename from debian/patches/0005-pristine-gz-obey-the-XDELTA_PROGRAM-build-parameter.patch rename to debian/patches/0001-pristine-gz-obey-the-XDELTA_PROGRAM-build-parameter.patch diff --git a/debian/patches/0007-implement-tar-format-guessing.patch b/debian/patches/0002-implement-tar-format-guessing.patch similarity index 100% rename from debian/patches/0007-implement-tar-format-guessing.patch rename to debian/patches/0002-implement-tar-format-guessing.patch diff --git a/debian/patches/0008-Use-posix-tar-format-by-default.patch b/debian/patches/0003-Use-posix-tar-format-by-default.patch similarity index 100% rename from debian/patches/0008-Use-posix-tar-format-by-default.patch rename to debian/patches/0003-Use-posix-tar-format-by-default.patch diff --git a/debian/patches/0009-Mangle-PAX-headers-when-using-posix-tar-format.patch b/debian/patches/0004-Mangle-PAX-headers-when-using-posix-tar-format.patch similarity index 100% rename from debian/patches/0009-Mangle-PAX-headers-when-using-posix-tar-format.patch rename to debian/patches/0004-Mangle-PAX-headers-when-using-posix-tar-format.patch diff --git a/debian/patches/0005-Remove-all-timestamps-from-extended-PAX-headers.patch b/debian/patches/0005-Remove-all-timestamps-from-extended-PAX-headers.patch new file mode 100644 index 0000000..4d5cbe2 --- /dev/null +++ b/debian/patches/0005-Remove-all-timestamps-from-extended-PAX-headers.patch @@ -0,0 +1,28 @@ +From: Markus Lehtonen +Date: Fri, 23 Aug 2013 00:47:12 +0300 +Subject: Remove all timestamps from extended PAX headers + +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: I25fc631c4f1c62fc5ec2c1a8112dd01c643aae90 +Signed-off-by: Markus Lehtonen +--- + pristine-tar | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pristine-tar b/pristine-tar +index 3e92a74..19af965 100755 +--- a/pristine-tar ++++ b/pristine-tar +@@ -360,7 +360,7 @@ sub recreatetarball_helper { + 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,ctime:=0'); ++ push @cmd, ('--pax-option=exthdr.name=%d/PaxHeaders/%f,mtime:=0,atime:=0,ctime:=0'); + } + } + diff --git a/debian/patches/series b/debian/patches/series index c034b74..7e32c85 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,4 +1,5 @@ -0005-pristine-gz-obey-the-XDELTA_PROGRAM-build-parameter.patch -0007-implement-tar-format-guessing.patch -0008-Use-posix-tar-format-by-default.patch -0009-Mangle-PAX-headers-when-using-posix-tar-format.patch +0001-pristine-gz-obey-the-XDELTA_PROGRAM-build-parameter.patch +0002-implement-tar-format-guessing.patch +0003-Use-posix-tar-format-by-default.patch +0004-Mangle-PAX-headers-when-using-posix-tar-format.patch +0005-Remove-all-timestamps-from-extended-PAX-headers.patch diff --git a/packaging/0010-Remove-all-timestamps-from-extended-PAX-headers.patch b/packaging/0010-Remove-all-timestamps-from-extended-PAX-headers.patch new file mode 100644 index 0000000..4d5cbe2 --- /dev/null +++ b/packaging/0010-Remove-all-timestamps-from-extended-PAX-headers.patch @@ -0,0 +1,28 @@ +From: Markus Lehtonen +Date: Fri, 23 Aug 2013 00:47:12 +0300 +Subject: Remove all timestamps from extended PAX headers + +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: I25fc631c4f1c62fc5ec2c1a8112dd01c643aae90 +Signed-off-by: Markus Lehtonen +--- + pristine-tar | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pristine-tar b/pristine-tar +index 3e92a74..19af965 100755 +--- a/pristine-tar ++++ b/pristine-tar +@@ -360,7 +360,7 @@ sub recreatetarball_helper { + 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,ctime:=0'); ++ push @cmd, ('--pax-option=exthdr.name=%d/PaxHeaders/%f,mtime:=0,atime:=0,ctime:=0'); + } + } + diff --git a/packaging/pristine-tar.changes b/packaging/pristine-tar.changes index 66bfbb5..1b6ad75 100644 --- a/packaging/pristine-tar.changes +++ b/packaging/pristine-tar.changes @@ -1,3 +1,6 @@ +* Fri Aug 23 2013 Markus Lehtonen 1.28 +- Remove all timestamps from extended PAX headers of posix tarballs + * Mon Jun 03 2013 Markus Lehtonen 1.28 - Fixes Bug #998 * Mangle PAX headers when using posix tar format diff --git a/packaging/pristine-tar.spec b/packaging/pristine-tar.spec index 0f72e66..f3e83d9 100644 --- a/packaging/pristine-tar.spec +++ b/packaging/pristine-tar.spec @@ -16,6 +16,7 @@ Patch5: 0006-Add-.gbp.conf.patch Patch6: 0007-implement-tar-format-guessing.patch Patch7: 0008-Use-posix-tar-format-by-default.patch Patch8: 0009-Mangle-PAX-headers-when-using-posix-tar-format.patch +Patch9: 0010-Remove-all-timestamps-from-extended-PAX-headers.patch Requires: gzip Requires: bzip2 %if 0%{?suse_version} >= 1210 @@ -89,6 +90,8 @@ control. %patch7 -p1 # 0009-Mangle-PAX-headers-when-using-posix-tar-format.patch %patch8 -p1 +# 0010-Remove-all-timestamps-from-extended-PAX-headers.patch +%patch9 -p1 %build %if 0%{?fedora} -- 2.7.4