summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorRiku Voipio <riku.voipio@linaro.org>2017-10-19 13:30:49 +0300
committerYonghee Han <onstudy@samsung.com>2019-01-17 10:39:22 +0900
commit9f0147d8c97e4113e9a8edcb0721c87261212c18 (patch)
tree4a812b605db6228fb9c08fba8390c2773c10fc53 /Build
parent51be98c9409eb785f07aaa2a7ce626f47c45f3d3 (diff)
downloadbuild-9f0147d8c97e4113e9a8edcb0721c87261212c18.tar.gz
build-9f0147d8c97e4113e9a8edcb0721c87261212c18.tar.bz2
build-9f0147d8c97e4113e9a8edcb0721c87261212c18.zip
Deb.pm: support control.tar.xz
Add support for uncompressing and hdrmd5 for XZ compressed control.tar - default on dpkg >= 1.19. Fixes issue #395 Change-Id: I2f18307182591b3965c6c6e70f355ab617dc1533
Diffstat (limited to 'Build')
-rw-r--r--Build/Deb.pm22
1 files changed, 15 insertions, 7 deletions
diff --git a/Build/Deb.pm b/Build/Deb.pm
index 5713de8..904fca5 100644
--- a/Build/Deb.pm
+++ b/Build/Deb.pm
@@ -256,9 +256,14 @@ sub debq {
$data = substr($data, 8 + 60 + $len);
if (substr($data, 0, 16) ne 'control.tar.gz ' &&
substr($data, 0, 16) ne 'control.tar.gz/ ') {
- warn("$fn: control.tar.gz is not second ar entry\n");
- close DEBF unless ref $fn;
- return ();
+ if (substr($data, 0, 16) eq 'control.tar.xz ' ||
+ substr($data, 0, 16) eq 'control.tar.xz/ ') {
+ $decompressor = "unxz";
+ } else {
+ warn("$fn: control.tar is not second ar entry\n");
+ close DEBF unless ref $fn;
+ return ();
+ }
}
$len = substr($data, 48, 10);
if (length($data) < 60+$len) {
@@ -278,7 +283,7 @@ sub debq {
$data = uncompress($data, $decompressor);
}
if (!$data) {
- warn("$fn: corrupt control.tar.gz file\n");
+ warn("$fn: corrupt control.tar file\n");
return ();
}
my $control;
@@ -288,7 +293,7 @@ sub debq {
my $len = oct('00'.substr($data, 124,12));
my $blen = ($len + 1023) & ~511;
if (length($data) < $blen) {
- warn("$fn: corrupt control.tar.gz file\n");
+ warn("$fn: corrupt control.tar file\n");
return ();
}
if ($n eq './control' || $n eq "control") {
@@ -390,8 +395,11 @@ sub queryhdrmd5 {
}
$data = substr($data, 8 + 60 + $len);
if (substr($data, 0, 16) ne 'control.tar.gz ' &&
- substr($data, 0, 16) ne 'control.tar.gz/ ') {
- warn("$bin: control.tar.gz is not second ar entry\n");
+ substr($data, 0, 16) ne 'control.tar.gz/ ' &&
+ substr($data, 0, 16) ne 'control.tar.xz ' &&
+ substr($data, 0, 16) ne 'control.tar.xz/ ')
+ {
+ warn("$bin: control.tar is not second ar entry\n");
close F;
return undef;
}