Workaround for broken pristine-tar branches in Tizen
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Fri, 29 Nov 2013 10:54:27 +0000 (12:54 +0200)
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Mon, 2 Dec 2013 10:46:27 +0000 (12:46 +0200)
Makes it possible to checkout tarballs from certain broken pristine-tar
branches created with buggy versions of Tizen pristine-tar on openSUSE.

Also limit the suse bzip2 hack to older openSUSE distros.

Change-Id: Ifc5b173f8a5f5db5266a79c9cfd2b27c4293f7c7
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
13 files changed:
debian/changelog
debian/patches/0004-Mangle-PAX-headers-when-using-posix-tar-format.patch
debian/patches/0005-HACK-workaround-for-some-broken-pristine-tar-branche.patch [new file with mode: 0644]
debian/patches/0005-Remove-all-timestamps-from-extended-PAX-headers.patch [deleted file]
debian/patches/series
packaging/0002-openSUSE-HACK-add-upstream-bzip2-v1.0.6-sources.patch
packaging/0003-openSUSE-HACK-modify-Makefile-in-upstream-bzip2.patch
packaging/0004-openSUSE-HACK-enable-special-upstream-bzip2.patch
packaging/0009-Mangle-PAX-headers-when-using-posix-tar-format.patch
packaging/0010-HACK-workaround-for-some-broken-pristine-tar-branche.patch [new file with mode: 0644]
packaging/0010-Remove-all-timestamps-from-extended-PAX-headers.patch [deleted file]
packaging/pristine-tar.changes
packaging/pristine-tar.spec

index 13c2c7f2320e42f1abd19fce648e3633ef1f6b6f..06ff826a6d0b99164def7d3393e483db9c19e3bf 100644 (file)
@@ -1,3 +1,11 @@
+pristine-tar (1.28-3) unstable; urgency=low
+
+  * Workaround for broken pristine-tar branches in Tizen
+    Makes it possible to checkout tarballs from certain broken pristine-tar
+    branches created with buggy versions of Tizen pristine-tar on openSUSE.
+
+ -- Markus Lehtonen <markus.lehtonen@linux.intel.com>  Fri, 29 Nov 2013 15:07:41 +0200
+
 pristine-tar (1.28-2) unstable; urgency=low
 
   * Remove all timestamps from extended PAX headers of posix tarballs
index bb2b4187af30207a5aff14f3810edd494d8fb25d..8385147686fa73b05ec813d656321cd485f51628 100644 (file)
@@ -2,8 +2,14 @@ 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
 
-Mangle tar PAX headers in order to guarantee that created tarballs are
-always identical so that the delta can be applied cleanly.
+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>
 ---
@@ -11,7 +17,7 @@ Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
  1 file changed, 5 insertions(+)
 
 diff --git a/pristine-tar b/pristine-tar
-index f1fae98..3e92a74 100755
+index f1fae98..19af965 100755
 --- a/pristine-tar
 +++ b/pristine-tar
 @@ -357,6 +357,11 @@ sub recreatetarball_helper {
@@ -21,7 +27,7 @@ index f1fae98..3e92a74 100755
 +              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/0005-HACK-workaround-for-some-broken-pristine-tar-branche.patch b/debian/patches/0005-HACK-workaround-for-some-broken-pristine-tar-branche.patch
new file mode 100644 (file)
index 0000000..c264fb5
--- /dev/null
@@ -0,0 +1,28 @@
+From: Markus Lehtonen <markus.lehtonen@linux.intel.com>
+Date: Fri, 29 Nov 2013 12:44:56 +0200
+Subject: HACK: workaround for some broken pristine-tar branches
+
+Created by previous buggy versions of the pristine-tar tool distributed
+for openSUSE in Tizen.
+
+Change-Id: I31b1b5527fa399dd0c4baff87b0775a0ff8da773
+Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
+---
+ pristine-bz2 | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/pristine-bz2 b/pristine-bz2
+index dbbe319..112d49e 100755
+--- a/pristine-bz2
++++ b/pristine-bz2
+@@ -263,6 +263,10 @@ sub genbz2 {
+       @params=split(' ', $delta->{params});
+       my $program=$delta->{program};
++      # Work around for some broken pristine-tar data in Tizen repos
++      if ($program =~ /.*upstream-bzip2\/bzip2$/) {
++              $program="bzip2"
++      }
+       if (! grep { $program eq $_ } @supported_bzip2_programs) {
+               die "paranoia check failed on program from delta ($program)";
+       }
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
deleted file mode 100644 (file)
index 4d5cbe2..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-From: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-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 <markus.lehtonen@linux.intel.com>
----
- 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');
-               }
-       }
index 7e32c850a46851b290d90af0421edcd3b7636c34..a4aec7886cb5b2983e4496650b81c2e02d9ef15a 100644 (file)
@@ -2,4 +2,4 @@
 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
+0005-HACK-workaround-for-some-broken-pristine-tar-branche.patch
index cddcb9fbd1a30c1acca14ce2f6b2e2a508dc3363..2d8214a4ddfc498203de0f015193106887444f3a 100644 (file)
@@ -5,7 +5,7 @@ Subject: openSUSE HACK: add upstream bzip2 (v1.0.6) sources
 Only take the selected files that are needed. Needed for being able to
 correctly re-create bz2 archives on openSUSE.
 
-Gbp-Rpm: If 0%{?suse_version}
+Gbp-Rpm: If 0%{?suse_version} && 0%{?suse_version} < 1220
 Gbp: Ignore
 
 Change-Id: I0b7848774f5a0b7bd69de853de3d04bbbbc7f3fd
index 45e30a1ff3c441018eb9ffa523552bf79558d95e..b1e343c4af9ac7a99f777c09ea526f1306de17ff 100644 (file)
@@ -4,7 +4,7 @@ Subject: openSUSE HACK: modify Makefile in upstream-bzip2
 
 To make the (only partially imported) upstream-bzip2 compile.
 
-Gbp-Rpm: If 0%{?suse_version}
+Gbp-Rpm: If 0%{?suse_version} && 0%{?suse_version} < 1220
 Gbp: Ignore
 
 Change-Id: Id74e43aa3d913d0cb52f3866d5434d5ff92f2aaf
index ab47a57e482c04901866cf48ccec480460b5b1b8..3c05114a2f40a738a92ed7e334841cf43bb00e87 100644 (file)
@@ -7,15 +7,15 @@ This is a hack for openSUSE that makes pristine-bz2 use a special
 is unable to re-create/gendelta bz2 archives created by other
 distributions.
 
-Gbp-Rpm: If 0%{?suse_version}
+Gbp-Rpm: If 0%{?suse_version} && 0%{?suse_version} < 1220
 Gbp: Ignore
 
 Change-Id: Icfcbee5207e65820248172152623a4dbf4440131
 Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
 ---
- Makefile.PL  | 5 +++++
- pristine-bz2 | +++-
- 2 files changed, 8 insertions(+), 1 deletion(-)
+ Makefile.PL  |  5 +++++
+ pristine-bz2 | 12 +++++++++++-
+ 2 files changed, 16 insertions(+), 1 deletion(-)
 
 diff --git a/Makefile.PL b/Makefile.PL
 index 60a5103..8a2fe1c 100755
@@ -41,17 +41,39 @@ index 60a5103..8a2fe1c 100755
  extra_clean:
        $(MAKE) clean -C pit/suse-bzip2 PREFIX=$(PREFIX)
 diff --git a/pristine-bz2 b/pristine-bz2
-index 53c42bc..7da6607 100755
+index 53c42bc..dbbe319 100755
 --- a/pristine-bz2
 +++ b/pristine-bz2
-@@ -91,7 +91,9 @@ use IO::Handle;
+@@ -91,6 +91,8 @@ use IO::Handle;
  delete $ENV{BZIP};
  delete $ENV{BZIP2};
  
--my @supported_bzip2_programs = qw(bzip2 pbzip2 zgz);
 +my $__upstream_bzip2_prefix = "";
 +
-+my @supported_bzip2_programs = ("${__upstream_bzip2_prefix}bzip2",  "pbzip2", "zgz");
+ my @supported_bzip2_programs = qw(bzip2 pbzip2 zgz);
  
  my $try=0;
+@@ -169,7 +171,12 @@ sub testvariant {
  
+       # try bzip2'ing with the arguments passed
+       if ($bzip2_program ne 'zgz') {
+-              doit($bzip2_program, @args, $tmpin);
++              if ($bzip2_program eq 'bzip2') {
++                      doit("$__upstream_bzip2_prefix/bzip2", @args, $tmpin);
++              }
++              else {
++                      doit($bzip2_program, @args, $tmpin);
++              }
+       }
+       else {
+               doit_redir($tmpin, $new, $bzip2_program, @args);
+@@ -264,6 +271,9 @@ sub genbz2 {
+               # unlike bzip2, zgz only uses stdio
+               doit_redir($file, "$file.bz2", $program, @params);
+       }
++      elsif ($program eq 'bzip2') {
++              doit("$__upstream_bzip2_prefix/bzip2", @params, $file);
++      }
+       else {
+               doit($program, @params, $file);
+       }
index bb2b4187af30207a5aff14f3810edd494d8fb25d..8385147686fa73b05ec813d656321cd485f51628 100644 (file)
@@ -2,8 +2,14 @@ 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
 
-Mangle tar PAX headers in order to guarantee that created tarballs are
-always identical so that the delta can be applied cleanly.
+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>
 ---
@@ -11,7 +17,7 @@ Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
  1 file changed, 5 insertions(+)
 
 diff --git a/pristine-tar b/pristine-tar
-index f1fae98..3e92a74 100755
+index f1fae98..19af965 100755
 --- a/pristine-tar
 +++ b/pristine-tar
 @@ -357,6 +357,11 @@ sub recreatetarball_helper {
@@ -21,7 +27,7 @@ index f1fae98..3e92a74 100755
 +              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/0010-HACK-workaround-for-some-broken-pristine-tar-branche.patch b/packaging/0010-HACK-workaround-for-some-broken-pristine-tar-branche.patch
new file mode 100644 (file)
index 0000000..c264fb5
--- /dev/null
@@ -0,0 +1,28 @@
+From: Markus Lehtonen <markus.lehtonen@linux.intel.com>
+Date: Fri, 29 Nov 2013 12:44:56 +0200
+Subject: HACK: workaround for some broken pristine-tar branches
+
+Created by previous buggy versions of the pristine-tar tool distributed
+for openSUSE in Tizen.
+
+Change-Id: I31b1b5527fa399dd0c4baff87b0775a0ff8da773
+Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
+---
+ pristine-bz2 | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/pristine-bz2 b/pristine-bz2
+index dbbe319..112d49e 100755
+--- a/pristine-bz2
++++ b/pristine-bz2
+@@ -263,6 +263,10 @@ sub genbz2 {
+       @params=split(' ', $delta->{params});
+       my $program=$delta->{program};
++      # Work around for some broken pristine-tar data in Tizen repos
++      if ($program =~ /.*upstream-bzip2\/bzip2$/) {
++              $program="bzip2"
++      }
+       if (! grep { $program eq $_ } @supported_bzip2_programs) {
+               die "paranoia check failed on program from delta ($program)";
+       }
diff --git a/packaging/0010-Remove-all-timestamps-from-extended-PAX-headers.patch b/packaging/0010-Remove-all-timestamps-from-extended-PAX-headers.patch
deleted file mode 100644 (file)
index 4d5cbe2..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-From: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-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 <markus.lehtonen@linux.intel.com>
----
- 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');
-               }
-       }
index 1b6ad75c76cb9b9303db836cd16e155d0665a79f..6411e1e318b8a6359cbd45d9d7f3537de1af4d9b 100644 (file)
@@ -1,3 +1,8 @@
+* Fri Nov 29 2013 Markus Lehtonen <markus.lehtonen@linux.intel.com> 1.28
+- Workaround for broken pristine-tar branches in Tizen
+  Makes it possible to checkout tarballs from certain broken pristine-tar
+  branches created with buggy versions of Tizen pristine-tar on openSUSE.
+
 * Fri Aug 23 2013 Markus Lehtonen <markus.lehtonen@linux.intel.com> 1.28
 - Remove all timestamps from extended PAX headers of posix tarballs
 
index f3e83d93172c19c7b2e6e6ae59e44d4aff02a797..f97d1f41c55844ac76a767c46f2d822016cc0301 100644 (file)
@@ -16,7 +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
+Patch9:     0010-HACK-workaround-for-some-broken-pristine-tar-branche.patch
 Requires:   gzip
 Requires:   bzip2
 %if 0%{?suse_version} >= 1210
@@ -69,15 +69,15 @@ control.
 # 0001-Fix-libbz2.so-version-numbers.patch
 %patch0 -p1
 # 0002-openSUSE-HACK-add-upstream-bzip2-v1.0.6-sources.patch
-%if 0%{?suse_version}
+%if 0%{?suse_version} && 0%{?suse_version} < 1220
 %patch1 -p1
 %endif
 # 0003-openSUSE-HACK-modify-Makefile-in-upstream-bzip2.patch
-%if 0%{?suse_version}
+%if 0%{?suse_version} && 0%{?suse_version} < 1220
 %patch2 -p1
 %endif
 # 0004-openSUSE-HACK-enable-special-upstream-bzip2.patch
-%if 0%{?suse_version}
+%if 0%{?suse_version} && 0%{?suse_version} < 1220
 %patch3 -p1
 %endif
 # 0005-pristine-gz-obey-the-XDELTA_PROGRAM-build-parameter.patch
@@ -90,7 +90,7 @@ control.
 %patch7 -p1
 # 0009-Mangle-PAX-headers-when-using-posix-tar-format.patch
 %patch8 -p1
-# 0010-Remove-all-timestamps-from-extended-PAX-headers.patch
+# 0010-HACK-workaround-for-some-broken-pristine-tar-branche.patch
 %patch9 -p1
 
 %build