cvs: pear-core / package-PEAR.xml package2.xml /PEAR Installer.php /PEAR/Task Common.php Postinstallscript.php Replace.php Unixeol.php
Windowseol.php /tests/PEAR_Installer setup.php.inc test_bug13691.phpt /tests/PEAR_Installer/bug13691 admin1.xml admin2.xml
/tests/PEAR_Installer/bug13691/admin1 1.php /tests/PEAR_Installer/bug13691/admin2 2.php

From: Date: Tue, 13 May 2008 21:28:20 +0000
Subject: cvs: pear-core / package-PEAR.xml package2.xml /PEAR Installer.php /PEAR/Task Common.php Postinstallscript.php Replace.php Unixeol.php
Windowseol.php /tests/PEAR_Installer setup.php.inc test_bug13691.phpt /tests/PEAR_Installer/bug13691 admin1.xml admin2.xml
/tests/PEAR_Installer/bug13691/admin1 1.php /tests/PEAR_Installer/bug13691/admin2 2.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-core+get-7550@lists.php.net to get a copy of this message
cellog Tue May 13 21:28:20 2008 UTC Added files: /pear-core/tests/PEAR_Installer test_bug13691.phpt /pear-core/tests/PEAR_Installer/bug13691 admin1.xml admin2.xml /pear-core/tests/PEAR_Installer/bug13691/admin1 1.php /pear-core/tests/PEAR_Installer/bug13691/admin2 2.php Modified files: /pear-core package-PEAR.xml package2.xml /pear-core/PEAR Installer.php /pear-core/PEAR/Task Common.php Postinstallscript.php Replace.php Unixeol.php Windowseol.php /pear-core/tests/PEAR_Installer setup.php.inc Log: * Fix Bug #13691 Pear doesn't remove old directories on upgrade [cellog] also fix some notices triggered in PHP 5.3

http://cvs.php.net/viewvc.cgi/pear-core/package-PEAR.xml?r1=1.531&r2=1.532&diff_format=u Index: pear-core/package-PEAR.xml diff -u pear-core/package-PEAR.xml:1.531 pear-core/package-PEAR.xml:1.532 --- pear-core/package-PEAR.xml:1.531 Tue May 13 18:32:29 2008 +++ pear-core/package-PEAR.xml Tue May 13 21:28:19 2008 @@ -105,6 +105,7 @@ * Fix Bug #13508 undefined index errors when installing a remote bundle [cellog/tswicegood] * Fix Bug #13525 pear package-validate is not showing warnings even if there are [dufuz] * Fix Bug #13559 installing package fails via proxy to virtual-hosted server. [hirose] + * Fix Bug #13691 Pear doesn't remove old directories on upgrade [cellog] * Fix Bug #13870 Notice uninstalling or using bundles [cellog] * Fix Bug #13883 file permissions not preserved on packaging [cellog] </notes> http://cvs.php.net/viewvc.cgi/pear-core/package2.xml?r1=1.431&r2=1.432&diff_format=u Index: pear-core/package2.xml diff -u pear-core/package2.xml:1.431 pear-core/package2.xml:1.432 --- pear-core/package2.xml:1.431 Tue May 13 18:32:29 2008 +++ pear-core/package2.xml Tue May 13 21:28:19 2008 @@ -110,6 +110,7 @@ * Fix Bug #13508 undefined index errors when installing a remote bundle [cellog/tswicegood] * Fix Bug #13525 pear package-validate is not showing warnings even if there are [dufuz] * Fix Bug #13559 installing package fails via proxy to virtual-hosted server. [hirose] + * Fix Bug #13691 Pear doesn't remove old directories on upgrade [cellog] * Fix Bug #13870 Notice uninstalling or using bundles [cellog] * Fix Bug #13883 file permissions not preserved on packaging [cellog] </notes> http://cvs.php.net/viewvc.cgi/pear-core/PEAR/Installer.php?r1=1.251&r2=1.252&diff_format=u Index: pear-core/PEAR/Installer.php diff -u pear-core/PEAR/Installer.php:1.251 pear-core/PEAR/Installer.php:1.252 --- pear-core/PEAR/Installer.php:1.251 Thu Jan 17 05:48:37 2008 +++ pear-core/PEAR/Installer.php Tue May 13 21:28:19 2008 @@ -18,7 +18,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2008 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Installer.php,v 1.251 2008/01/17 05:48:37 cellog Exp $ + * @version CVS: $Id: Installer.php,v 1.252 2008/05/13 21:28:19 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -1290,6 +1290,12 @@ if (PEAR::isError($filelist)) { return $filelist; } + $p = &$installregistry->getPackage($pkgname, $channel); + if (empty($options['register-only']) && $p) { + $dirtree = $p->getDirTree(); + } else { + $dirtree = false; + } $pkg->resetFilelist(); $pkg->setLastInstalledVersion($installregistry->packageInfo($pkg->getPackage(), 'version', $pkg->getChannel())); @@ -1365,6 +1371,15 @@ } $ret = $installregistry->addPackage2($pkg); } else { + if ($dirtree) { + $this->startFileTransaction(); + // attempt to delete empty directories + uksort($dirtree, array($this, '_sortDirs')); + foreach($dirtree as $dir => $notused) { + $this->addFileOperation('rmdir', array($dir)); + } + $this->commitFileTransaction(); + } $usechannel = $channel; if ($channel == 'pecl.php.net') { $test = $installregistry->packageExists($pkgname, $channel); http://cvs.php.net/viewvc.cgi/pear-core/PEAR/Task/Common.php?r1=1.17&r2=1.18&diff_format=u Index: pear-core/PEAR/Task/Common.php diff -u pear-core/PEAR/Task/Common.php:1.17 pear-core/PEAR/Task/Common.php:1.18 --- pear-core/PEAR/Task/Common.php:1.17 Thu Jan 3 20:26:37 2008 +++ pear-core/PEAR/Task/Common.php Tue May 13 21:28:20 2008 @@ -15,7 +15,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2008 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Common.php,v 1.17 2008/01/03 20:26:37 cellog Exp $ + * @version CVS: $Id: Common.php,v 1.18 2008/05/13 21:28:20 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -121,7 +121,7 @@ * @static * @abstract */ - function validateXml($pkg, $xml, &$config, $fileXml) + function validateXml($pkg, $xml, $config, $fileXml) { } http://cvs.php.net/viewvc.cgi/pear-core/PEAR/Task/Postinstallscript.php?r1=1.19&r2=1.20&diff_format=u Index: pear-core/PEAR/Task/Postinstallscript.php diff -u pear-core/PEAR/Task/Postinstallscript.php:1.19 pear-core/PEAR/Task/Postinstallscript.php:1.20 --- pear-core/PEAR/Task/Postinstallscript.php:1.19 Thu Jan 3 20:26:37 2008 +++ pear-core/PEAR/Task/Postinstallscript.php Tue May 13 21:28:20 2008 @@ -15,7 +15,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2008 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Postinstallscript.php,v 1.19 2008/01/03 20:26:37 cellog Exp $ + * @version CVS: $Id: Postinstallscript.php,v 1.20 2008/05/13 21:28:20 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -62,7 +62,7 @@ * @param array the entire parsed <file> tag * @static */ - function validateXml($pkg, $xml, &$config, $fileXml) + function validateXml($pkg, $xml, $config, $fileXml) { if ($fileXml['role'] != 'php') { return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' . http://cvs.php.net/viewvc.cgi/pear-core/PEAR/Task/Replace.php?r1=1.16&r2=1.17&diff_format=u Index: pear-core/PEAR/Task/Replace.php diff -u pear-core/PEAR/Task/Replace.php:1.16 pear-core/PEAR/Task/Replace.php:1.17 --- pear-core/PEAR/Task/Replace.php:1.16 Thu Jan 3 20:26:37 2008 +++ pear-core/PEAR/Task/Replace.php Tue May 13 21:28:20 2008 @@ -15,7 +15,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2008 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Replace.php,v 1.16 2008/01/03 20:26:37 cellog Exp $ + * @version CVS: $Id: Replace.php,v 1.17 2008/05/13 21:28:20 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -47,7 +47,7 @@ * @param PEAR_Config * @static */ - function validateXml($pkg, $xml, &$config, $fileXml) + function validateXml($pkg, $xml, $config, $fileXml) { if (!isset($xml['attribs'])) { return array(PEAR_TASK_ERROR_NOATTRIBS); http://cvs.php.net/viewvc.cgi/pear-core/PEAR/Task/Unixeol.php?r1=1.9&r2=1.10&diff_format=u Index: pear-core/PEAR/Task/Unixeol.php diff -u pear-core/PEAR/Task/Unixeol.php:1.9 pear-core/PEAR/Task/Unixeol.php:1.10 --- pear-core/PEAR/Task/Unixeol.php:1.9 Thu Jan 3 20:26:37 2008 +++ pear-core/PEAR/Task/Unixeol.php Tue May 13 21:28:20 2008 @@ -15,7 +15,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2008 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Unixeol.php,v 1.9 2008/01/03 20:26:37 cellog Exp $ + * @version CVS: $Id: Unixeol.php,v 1.10 2008/05/13 21:28:20 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -47,7 +47,7 @@ * @param PEAR_Config * @static */ - function validateXml($pkg, $xml, &$config, $fileXml) + function validateXml($pkg, $xml, $config, $fileXml) { if ($xml != '') { return array(PEAR_TASK_ERROR_INVALID, 'no attributes allowed'); http://cvs.php.net/viewvc.cgi/pear-core/PEAR/Task/Windowseol.php?r1=1.8&r2=1.9&diff_format=u Index: pear-core/PEAR/Task/Windowseol.php diff -u pear-core/PEAR/Task/Windowseol.php:1.8 pear-core/PEAR/Task/Windowseol.php:1.9 --- pear-core/PEAR/Task/Windowseol.php:1.8 Thu Jan 3 20:26:37 2008 +++ pear-core/PEAR/Task/Windowseol.php Tue May 13 21:28:20 2008 @@ -15,7 +15,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2008 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Windowseol.php,v 1.8 2008/01/03 20:26:37 cellog Exp $ + * @version CVS: $Id: Windowseol.php,v 1.9 2008/05/13 21:28:20 cellog Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -47,7 +47,7 @@ * @param PEAR_Config * @static */ - function validateXml($pkg, $xml, &$config, $fileXml) + function validateXml($pkg, $xml, $config, $fileXml) { if ($xml != '') { return array(PEAR_TASK_ERROR_INVALID, 'no attributes allowed'); http://cvs.php.net/viewvc.cgi/pear-core/tests/PEAR_Installer/setup.php.inc?r1=1.15&r2=1.16&diff_format=u Index: pear-core/tests/PEAR_Installer/setup.php.inc diff -u pear-core/tests/PEAR_Installer/setup.php.inc:1.15 pear-core/tests/PEAR_Installer/setup.php.inc:1.16 --- pear-core/tests/PEAR_Installer/setup.php.inc:1.15 Tue May 13 05:21:13 2008 +++ pear-core/tests/PEAR_Installer/setup.php.inc Tue May 13 21:28:20 2008 @@ -1,5 +1,4 @@ <?php -error_reporting(E_ERROR|E_NOTICE|E_WARNING|E_USER_ERROR|E_USER_NOTICE|E_USER_WARNING); set_include_path(get_include_path().PATH_SEPARATOR.getcwd()); // allows chdir $server = 'pear.Chiara'; http://cvs.php.net/viewvc.cgi/pear-core/tests/PEAR_Installer/test_bug13691.phpt?view=markup&rev=1.1 Index: pear-core/tests/PEAR_Installer/test_bug13691.phpt +++ pear-core/tests/PEAR_Installer/test_bug13691.phpt --TEST-- PEAR_Installer - Bug #13691: directories not removed on upgrade --SKIPIF-- <?php if (!getenv('PHP_PEAR_RUNTESTS')) { echo 'skip'; } ?> --FILE-- <?php require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'setup.php.inc'; $p1 = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'bug13691' . DIRECTORY_SEPARATOR . 'admin1.xml'; $p2 = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'bug13691' . DIRECTORY_SEPARATOR . 'admin2.xml'; $_test_dep->setPHPVersion('4.3.10'); $_test_dep->setPEARVersion('1.7.1'); $_test_dep->setExtensions(array('pcre' => '1.0')); $dp = &new test_PEAR_Downloader($fakelog, array(), $config); $phpunit->assertNoErrors('after create'); $result = $dp->download(array($p1)); $dlpackages = $dp->getDownloadedPackages(); $installer->setOptions($dp->getOptions()); $installer->sortPackagesForInstall($result); $installer->setDownloadedPackages($result); $phpunit->assertNoErrors('set of downloaded packages'); $ret = &$installer->install($result[0], $dp->getOptions()); $phpunit->assertNoErrors('after install'); $fakelog->getLog(); $phpunit->assertFileExists($php_dir . DIRECTORY_SEPARATOR . 'admin1', 'admin1'); $_test_dep->setPHPVersion('4.3.10'); $_test_dep->setPEARVersion('1.7.1'); $_test_dep->setExtensions(array('pcre' => '1.0')); $dp = &new test_PEAR_Downloader($fakelog, array('upgrade' => true), $config); $phpunit->assertNoErrors('after create 2'); $result = $dp->download(array($p2)); $dlpackages = $dp->getDownloadedPackages(); $installer->setOptions($dp->getOptions()); $installer->sortPackagesForInstall($result); $installer->setDownloadedPackages($result); $phpunit->assertNoErrors('set of downloaded packages 2'); $ret = &$installer->install($result[0], $dp->getOptions()); $phpunit->assertNoErrors('after install 2'); $phpunit->assertFileNotExists($php_dir . DIRECTORY_SEPARATOR . 'admin1', 'admin1 2'); $phpunit->assertFileExists($php_dir . DIRECTORY_SEPARATOR . 'admin2', 'admin2'); echo 'tests done'; ?> --CLEAN-- <?php require_once dirname(__FILE__) . '/teardown.php.inc'; ?> --EXPECT-- tests done http://cvs.php.net/viewvc.cgi/pear-core/tests/PEAR_Installer/bug13691/admin1.xml?view=markup&rev=1.1 Index: pear-core/tests/PEAR_Installer/bug13691/admin1.xml +++ pear-core/tests/PEAR_Installer/bug13691/admin1.xml <?xml version="1.0"?> <package version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd"> <name>Admin1</name> <channel>pear.php.net</channel> <summary>PEAR Base System</summary> <description>The PEAR package contains: </description> <lead> <name>Stig Bakken</name> <user>ssb</user> <email>stig@php.net</email> <active>yes</active> </lead> <date>2004-09-30</date> <version> <release>1.4.0</release> <api>1.4.0</api> </version> <stability> <release>stable</release> <api>stable</api> </stability> <license uri="http://www.php.net/license/3_0.txt">PHP License</license> <notes>Installer Roles/Tasks: </notes> <contents> <dir name="/"> <file name="admin1/1.php" role="php"/> </dir> <!-- / --> </contents> <dependencies> <required> <php> <min>4.2</min> </php> <pearinstaller> <min>1.7.0</min> </pearinstaller> </required> </dependencies> <phprelease/> </package> http://cvs.php.net/viewvc.cgi/pear-core/tests/PEAR_Installer/bug13691/admin2.xml?view=markup&rev=1.1 Index: pear-core/tests/PEAR_Installer/bug13691/admin2.xml +++ pear-core/tests/PEAR_Installer/bug13691/admin2.xml <?xml version="1.0"?> <package version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd"> <name>Admin1</name> <channel>pear.php.net</channel> <summary>PEAR Base System</summary> <description>The PEAR package contains: </description> <lead> <name>Stig Bakken</name> <user>ssb</user> <email>stig@php.net</email> <active>yes</active> </lead> <date>2004-10-01</date> <version> <release>1.4.1</release> <api>1.4.0</api> </version> <stability> <release>stable</release> <api>stable</api> </stability> <license uri="http://www.php.net/license/3_0.txt">PHP License</license> <notes>Installer Roles/Tasks: </notes> <contents> <dir name="/"> <file name="admin2/2.php" role="php"/> </dir> <!-- / --> </contents> <dependencies> <required> <php> <min>4.2</min> </php> <pearinstaller> <min>1.7.0</min> </pearinstaller> </required> </dependencies> <phprelease/> </package> http://cvs.php.net/viewvc.cgi/pear-core/tests/PEAR_Installer/bug13691/admin1/1.php?view=markup&rev=1.1 Index: pear-core/tests/PEAR_Installer/bug13691/admin1/1.php +++ pear-core/tests/PEAR_Installer/bug13691/admin1/1.php 1 http://cvs.php.net/viewvc.cgi/pear-core/tests/PEAR_Installer/bug13691/admin2/2.php?view=markup&rev=1.1 Index: pear-core/tests/PEAR_Installer/bug13691/admin2/2.php +++ pear-core/tests/PEAR_Installer/bug13691/admin2/2.php 1
« previous php.pear.core (#7550) next »