From 21065b1ef16b2d361dfc16985560ec0c1866ceb7 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 13 Nov 2017 17:42:03 +0100 Subject: fix erratic FTBFS from Koschei, add fix for big endian from https://github.com/horde/Mapi/pull/1 --- 0001-fix-for-BigEndian.patch | 63 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 0001-fix-for-BigEndian.patch (limited to '0001-fix-for-BigEndian.patch') diff --git a/0001-fix-for-BigEndian.patch b/0001-fix-for-BigEndian.patch new file mode 100644 index 0000000..edce6b1 --- /dev/null +++ b/0001-fix-for-BigEndian.patch @@ -0,0 +1,63 @@ +From c562b654bef2bae0ac5b06fa7f1234e35d03e42c Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Mon, 13 Nov 2017 17:11:21 +0100 +Subject: [PATCH] fix for BigEndian + +--- + lib/Horde/Mapi/Timezone.php | 5 ++--- + test/Horde/Mapi/TimezoneTest.php | 6 +++--- + 2 files changed, 5 insertions(+), 6 deletions(-) + +diff --git a/lib/Horde/Mapi/Timezone.php b/lib/Horde/Mapi/Timezone.php +index f63cbd1..6ab8a42 100644 +--- a/lib/Horde/Mapi/Timezone.php ++++ b/lib/Horde/Mapi/Timezone.php +@@ -80,14 +80,13 @@ class Horde_Mapi_Timezone + . 'ldstbias'; + } + $tz = unpack($format, base64_decode($data)); +- $tz['timezone'] = $tz['bias']; +- $tz['timezonedst'] = $tz['dstbias']; +- + if (!Horde_Mapi::isLittleEndian()) { + $tz['bias'] = Horde_Mapi::chbo($tz['bias']); + $tz['stdbias'] = Horde_Mapi::chbo($tz['stdbias']); + $tz['dstbias'] = Horde_Mapi::chbo($tz['dstbias']); + } ++ $tz['timezone'] = $tz['bias']; ++ $tz['timezonedst'] = $tz['dstbias']; + + return $tz; + } +diff --git a/test/Horde/Mapi/TimezoneTest.php b/test/Horde/Mapi/TimezoneTest.php +index 76794fe..52ef5a8 100644 +--- a/test/Horde/Mapi/TimezoneTest.php ++++ b/test/Horde/Mapi/TimezoneTest.php +@@ -126,7 +126,7 @@ class Horde_Mapi_TimezoneTest extends Horde_Test_Case + foreach ($this->_packed as $tz => $blob) { + $offsets = Horde_Mapi_Timezone::getOffsetsFromSyncTZ($blob); + foreach ($this->_offsets[$tz] as $key => $value) { +- $this->assertEquals($value, $offsets[$key]); ++ $this->assertEquals($value, $offsets[$key], "Comparing '$key' for '$tz'"); + } + } + } +@@ -142,7 +142,7 @@ class Horde_Mapi_TimezoneTest extends Horde_Test_Case + $date = new Horde_Date('2011-07-01', $tz); + $offsets = Horde_Mapi_Timezone::getOffsetsFromDate($date); + foreach ($offsets as $key => $value) { +- $this->assertEquals($expected[$key], $value); ++ $this->assertEquals($expected[$key], $value, "Comparing '$key' for '$tz'"); + } + } + } +@@ -180,4 +180,4 @@ class Horde_Mapi_TimezoneTest extends Horde_Test_Case + $this->assertEquals('Europe/Berlin', $guessed); + } + +-} +\ No newline at end of file ++} +-- +2.9.5 + -- cgit