Fix xdelta upgrade to xdelta3 but left pristine-gz
authorJiankang Fan <jiankang.fan@samsung.com>
Tue, 27 Sep 2016 03:31:20 +0000 (11:31 +0800)
committerJiankang Fan <jiankang.fan@samsung.com>
Tue, 27 Sep 2016 03:31:20 +0000 (11:31 +0800)
Change-Id: I6fe34718e339dd42826fac5971d36abf291850e3

debian/patches/0005-Fix-xdelta-upgrade-to-xdelta3-for-pristine-gz.patch [new file with mode: 0644]
debian/patches/series
packaging/00010-Fix-xdelta-upgrade-to-xdelta3-for-pristine-gz.patch [new file with mode: 0644]
packaging/pristine-tar.spec

diff --git a/debian/patches/0005-Fix-xdelta-upgrade-to-xdelta3-for-pristine-gz.patch b/debian/patches/0005-Fix-xdelta-upgrade-to-xdelta3-for-pristine-gz.patch
new file mode 100644 (file)
index 0000000..06ddd54
--- /dev/null
@@ -0,0 +1,39 @@
+From 77a7c2e9ad4c0a1f51451d0c11e507c513fba652 Mon Sep 17 00:00:00 2001
+From: yang.zhang <y0169.zhang@samsung.com>
+Date: Wed, 27 Jul 2016 13:55:14 +0800
+Subject: [PATCH] Fix xdelta upgrade to xdelta3 for pristine-gz
+
+Change-Id: I4fcb088918dafe1d2c2946f04f8308271df9b74c
+---
+
+diff --git a/pristine-gz b/pristine-gz
+index 5ca9f65..d0ebb48 100755
+--- a/pristine-gz
++++ b/pristine-gz
+@@ -96,6 +96,8 @@
+ delete $ENV{GZIP};
++my $xdelta_program = "xdelta3";
++
+ dispatch(
+       commands => {
+               usage => [\&usage],
+@@ -234,7 +236,7 @@
+               else {
+                       # generate a binary delta and see if this is the
+                       # best variant so far
+-                      my $ret=system("xdelta delta -0 --pristine $tempout $orig $tempdir/tmpdelta 2>/dev/null") >> 8;
++                      my $ret=system("$xdelta_program -0 -e -s $tempout $orig $tempdir/tmpdelta 2>/dev/null") >> 8;
+                       # xdelta exits 1 on success
+                       if ($ret == 1) {
+                               my $size=(stat("$tempdir/tmpdelta"))[7];
+@@ -297,7 +299,7 @@
+               my $tempdir=tempdir();
+               my $tfile="$tempdir/".basename($file).".gz";
+               doit_redir($file, $tfile, @zgz);
+-              doit("xdelta", "patch", "--pristine", $delta->{delta}, $tfile, "$file.gz");
++              my $ret=system("$xdelta_program -d -s $tfile $delta->{delta} $file.gz");
+       }
+       else {
+               doit_redir("$file", "$file.gz", @zgz);
index 3696249..b4c29c1 100644 (file)
@@ -1,3 +1,4 @@
 0002-Use-posix-tar-format-by-default.patch
 0003-Mangle-PAX-headers-when-using-posix-tar-format.patch
 0004-HACK-workaround-for-some-broken-pristine-tar-branche.patch
+0005-Fix-xdelta-upgrade-to-xdelta3-for-pristine-gz.patch
diff --git a/packaging/00010-Fix-xdelta-upgrade-to-xdelta3-for-pristine-gz.patch b/packaging/00010-Fix-xdelta-upgrade-to-xdelta3-for-pristine-gz.patch
new file mode 100644 (file)
index 0000000..06ddd54
--- /dev/null
@@ -0,0 +1,39 @@
+From 77a7c2e9ad4c0a1f51451d0c11e507c513fba652 Mon Sep 17 00:00:00 2001
+From: yang.zhang <y0169.zhang@samsung.com>
+Date: Wed, 27 Jul 2016 13:55:14 +0800
+Subject: [PATCH] Fix xdelta upgrade to xdelta3 for pristine-gz
+
+Change-Id: I4fcb088918dafe1d2c2946f04f8308271df9b74c
+---
+
+diff --git a/pristine-gz b/pristine-gz
+index 5ca9f65..d0ebb48 100755
+--- a/pristine-gz
++++ b/pristine-gz
+@@ -96,6 +96,8 @@
+ delete $ENV{GZIP};
++my $xdelta_program = "xdelta3";
++
+ dispatch(
+       commands => {
+               usage => [\&usage],
+@@ -234,7 +236,7 @@
+               else {
+                       # generate a binary delta and see if this is the
+                       # best variant so far
+-                      my $ret=system("xdelta delta -0 --pristine $tempout $orig $tempdir/tmpdelta 2>/dev/null") >> 8;
++                      my $ret=system("$xdelta_program -0 -e -s $tempout $orig $tempdir/tmpdelta 2>/dev/null") >> 8;
+                       # xdelta exits 1 on success
+                       if ($ret == 1) {
+                               my $size=(stat("$tempdir/tmpdelta"))[7];
+@@ -297,7 +299,7 @@
+               my $tempdir=tempdir();
+               my $tfile="$tempdir/".basename($file).".gz";
+               doit_redir($file, $tfile, @zgz);
+-              doit("xdelta", "patch", "--pristine", $delta->{delta}, $tfile, "$file.gz");
++              my $ret=system("$xdelta_program -d -s $tfile $delta->{delta} $file.gz");
+       }
+       else {
+               doit_redir("$file", "$file.gz", @zgz);
index 84da4d5..a1d190b 100644 (file)
@@ -16,6 +16,7 @@ Patch4:     0005-pristine-gz-obey-the-XDELTA_PROGRAM-build-parameter.patch
 Patch6:     0007-Use-posix-tar-format-by-default.patch
 Patch7:     0008-Mangle-PAX-headers-when-using-posix-tar-format.patch
 Patch8:     0009-HACK-workaround-for-some-broken-pristine-tar-branche.patch
+Patch9:     00010-Fix-xdelta-upgrade-to-xdelta3-for-pristine-gz.patch
 Requires:   tar
 Requires:   gzip
 Requires:   bzip2
@@ -87,7 +88,7 @@ control.
 %patch3 -p1
 %endif
 # 0005-pristine-gz-obey-the-XDELTA_PROGRAM-build-parameter.patch
-%patch4 -p1
+#%patch4 -p1
 # 0006-Add-.gbp.conf.patch
 #%patch5 -p1
 # 0007-Use-posix-tar-format-by-default.patch
@@ -96,6 +97,8 @@ control.
 %patch7 -p1
 # 0009-HACK-workaround-for-some-broken-pristine-tar-branche.patch
 %patch8 -p1
+# 00010-Fix-xdelta-upgrade-to-xdelta3-for-pristine-gz.patch
+%patch9 -p1
 
 %build
 %if 0%{?fedora} || 0%{?centos_ver} >= 7