From a22a90dff1f78e4c48d126e0ef041653c025fcd5 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 3 May 2017 13:49:48 +0200 Subject: v2.2.0 --- .gitignore | 7 +++ php-horde-Horde-Compress-pr219.patch | 103 +++++++++++++++++++++++++++++++++++ php-horde-Horde-Compress.spec | 37 +++++++------ 3 files changed, 130 insertions(+), 17 deletions(-) create mode 100644 .gitignore create mode 100644 php-horde-Horde-Compress-pr219.patch diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1ab5c4f --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +package-*.xml +*.tgz +*.tar.gz +*.tar.xz +*.tar.xz.asc +*.src.rpm +*/*rpm diff --git a/php-horde-Horde-Compress-pr219.patch b/php-horde-Horde-Compress-pr219.patch new file mode 100644 index 0000000..1fd0c76 --- /dev/null +++ b/php-horde-Horde-Compress-pr219.patch @@ -0,0 +1,103 @@ +From ea2a862f0a0b3bc8cedb9adf160f18892d152984 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Wed, 3 May 2017 13:29:53 +0200 +Subject: [PATCH] don't rely on directory entries order + +--- + framework/Compress/test/Horde/Compress/TarTest.php | 24 ++++++++++++++-------- + framework/Compress/test/Horde/Compress/ZipTest.php | 24 ++++++++++++++-------- + 2 files changed, 30 insertions(+), 18 deletions(-) + +diff --git a/framework/Compress/test/Horde/Compress/TarTest.php b/framework/Compress/test/Horde/Compress/TarTest.php +index 1875f8b..82ba8a1 100644 +--- a/framework/Compress/test/Horde/Compress/TarTest.php ++++ b/framework/Compress/test/Horde/Compress/TarTest.php +@@ -112,14 +112,20 @@ public function testTarDirectory() + + $list = $compress->decompress($tar_data); + $this->assertCount(3, $list); +- $this->assertEquals('one.txt', $list[0]['name']); +- $this->assertEquals(4, $list[0]['size']); +- $this->assertEquals("One\n", $list[0]['data']); +- $this->assertEquals('sub/three.txt', $list[1]['name']); +- $this->assertEquals(6, $list[1]['size']); +- $this->assertEquals("Three\n", $list[1]['data']); +- $this->assertEquals('two.bin', $list[2]['name']); +- $this->assertEquals(2, $list[2]['size']); +- $this->assertEquals("\x02\x0a", $list[2]['data']); ++ for ($i=0 ; $i<3 ; $i++) { ++ $list[$list[$i]['name']] = $list[$i]; ++ unset($list[$i]); ++ } ++ $this->assertArrayHasKey($k='one.txt', $list); ++ $this->assertEquals(4, $list[$k]['size']); ++ $this->assertEquals("One\n", $list[$k]['data']); ++ ++ $this->assertArrayHasKey($k='sub/three.txt', $list); ++ $this->assertEquals(6, $list[$k]['size']); ++ $this->assertEquals("Three\n", $list[$k]['data']); ++ ++ $this->assertArrayHasKey($k='two.bin', $list); ++ $this->assertEquals(2, $list[$k]['size']); ++ $this->assertEquals("\x02\x0a", $list[$k]['data']); + } + } +diff --git a/framework/Compress/test/Horde/Compress/ZipTest.php b/framework/Compress/test/Horde/Compress/ZipTest.php +index 7e215b2..25729b6 100644 +--- a/framework/Compress/test/Horde/Compress/ZipTest.php ++++ b/framework/Compress/test/Horde/Compress/ZipTest.php +@@ -143,39 +143,45 @@ public function testZipDirectory() + $zip_data, array('action' => Horde_Compress_Zip::ZIP_LIST) + ); + $this->assertCount(3, $list); +- $this->assertEquals('one.txt', $list[0]['name']); +- $this->assertEquals(4, $list[0]['size']); +- $this->assertEquals('sub/three.txt', $list[1]['name']); +- $this->assertEquals(6, $list[1]['size']); +- $this->assertEquals('two.bin', $list[2]['name']); +- $this->assertEquals(2, $list[2]['size']); ++ for ($i=0 ; $i<3 ; $i++) { ++ $index[$list[$i]['name']] = $i; ++ } + ++ $this->assertArrayHasKey($k='one.txt', $index); ++ $this->assertEquals($k, $list[$index[$k]]['name']); ++ $this->assertEquals(4, $list[$index[$k]]['size']); + $data = $compress->decompress( + $zip_data, + array( + 'action' => Horde_Compress_Zip::ZIP_DATA, + 'info' => $list, +- 'key' => 0 ++ 'key' => $index[$k] + ) + ); + $this->assertEquals("One\n", $data); + ++ $this->assertArrayHasKey($k='sub/three.txt', $index); ++ $this->assertEquals($k, $list[$index[$k]]['name']); ++ $this->assertEquals(6, $list[$index[$k]]['size']); + $data = $compress->decompress( + $zip_data, + array( + 'action' => Horde_Compress_Zip::ZIP_DATA, + 'info' => $list, +- 'key' => 1 ++ 'key' => $index[$k] + ) + ); + $this->assertEquals("Three\n", $data); + ++ $this->assertArrayHasKey($k='two.bin', $index); ++ $this->assertEquals('two.bin', $list[$index[$k]]['name']); ++ $this->assertEquals(2, $list[$index[$k]]['size']); + $data = $compress->decompress( + $zip_data, + array( + 'action' => Horde_Compress_Zip::ZIP_DATA, + 'info' => $list, +- 'key' => 2 ++ 'key' => $index[$k] + ) + ); + $this->assertEquals("\x02\x0a", $data); diff --git a/php-horde-Horde-Compress.spec b/php-horde-Horde-Compress.spec index 7781b40..8d299f3 100644 --- a/php-horde-Horde-Compress.spec +++ b/php-horde-Horde-Compress.spec @@ -12,7 +12,7 @@ %global pear_channel pear.horde.org Name: php-horde-Horde-Compress -Version: 2.1.6 +Version: 2.2.0 Release: 1%{?dist} Summary: Horde Compression API @@ -21,7 +21,9 @@ License: LGPLv2 URL: http://pear.horde.org Source0: http://%{pear_channel}/get/%{pear_name}-%{version}.tgz -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root +# https://github.com/horde/horde/pull/219 +Patch0: %{name}-pr219.patch + BuildArch: noarch BuildRequires: php-pear(PEAR) >= 1.7.0 BuildRequires: php-channel(%{pear_channel}) @@ -29,6 +31,11 @@ BuildRequires: gettext # To run unit tests BuildRequires: php-pear(%{pear_channel}/Horde_Test) >= 2.1.0 BuildRequires: php-pear(%{pear_channel}/Horde_Stream_Filter) >= 2.0.0 +BuildRequires: php-pear(%{pear_channel}/Horde_Mime) >= 2.5.0 +BuildRequires: php-pear(%{pear_channel}/Horde_Icalendar) >= 2.0.0 +BuildRequires: php-pear(%{pear_channel}/Horde_Mapi) >= 1.0.0 +# avoid Math_Biginteger native implementation +BuildRequires: php-gmp Requires(post): %{__pear} Requires(postun): %{__pear} @@ -66,11 +73,13 @@ An API for various compression techniques. %prep %setup -q -c cd %{pear_name}-%{version} +%patch0 -p3 -b .pr219 # Don't install .po and .pot files # Remove checksum for .mo, as we regenerate them sed -e '/%{pear_name}.po/d' \ -e '/%{pear_name}.mo/s/md5sum=.*name=/name=/' \ + -e '/role="test"/s/md5sum=.*name=/name=/' \ ../package.xml >%{name}.xml touch -r ../package.xml %{name}.xml @@ -106,21 +115,12 @@ done | tee ../%{pear_name}.lang %check cd %{pear_name}-%{version}/test/$(echo %{pear_name} | sed -e s:_:/:g) -# remirepo:11 -run=0 ret=0 -if which php56; then - php56 %{_bindir}/phpunit . || ret=1 - run=1 -fi -if which php71; then - php71 %{_bindir}/phpunit . || ret=1 - run=1 -fi -if [ $run -eq 0 ]; then -%{_bindir}/phpunit --verbose . -# remirepo:2 -fi +for cmd in php php56 php70 php71 php72; do + if which $cmd; then + $cmd %{_bindir}/phpunit . --verbose || ret=1 + fi +done exit $ret @@ -135,7 +135,6 @@ if [ $1 -eq 0 ] ; then fi %files -f %{pear_name}.lang -%defattr(-,root,root,-) %doc %{pear_docdir}/%{pear_name} %{pear_xmldir}/%{name}.xml %{pear_phpdir}/Horde/Compress @@ -146,6 +145,10 @@ fi %changelog +* Wed May 3 2017 Remi Collet - 2.2.0-1 +- Update to 2.2.0 +- open https://github.com/horde/horde/pull/219 - fix tests + * Tue Dec 20 2016 Remi Collet - 2.1.6-1 - Update to 2.1.6 -- cgit