cvs: pear-core / package-PEAR.xml package2.xml /PEAR/Installer/Role Cfg.php /tests/PEAR_Installer setup.php.inc test_install_cfgrole.phpt
| From: | Greg Beaver | Date: | Tue, 13 May 2008 23:53:11 +0000 |
| Subject: | cvs: pear-core / package-PEAR.xml package2.xml /PEAR/Installer/Role Cfg.php /tests/PEAR_Installer setup.php.inc test_install_cfgrole.phpt | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-core+get-7552@lists.php.net to get a copy of this message | ||
cellog Tue May 13 23:53:11 2008 UTC
Modified files:
/pear-core package-PEAR.xml package2.xml
/pear-core/PEAR/Installer/Role Cfg.php
/pear-core/tests/PEAR_Installer setup.php.inc
test_install_cfgrole.phpt
Log:
* Fix Bug #12959 PEAR should give warning when doing "special" handling with
cfg role [cellog]
http://cvs.php.net/viewvc.cgi/pear-core/package-PEAR.xml?r1=1.533&r2=1.534&diff_format=u
Index: pear-core/package-PEAR.xml
diff -u pear-core/package-PEAR.xml:1.533 pear-core/package-PEAR.xml:1.534
--- pear-core/package-PEAR.xml:1.533 Tue May 13 22:46:07 2008
+++ pear-core/package-PEAR.xml Tue May 13 23:53:10 2008
@@ -93,6 +93,7 @@
<state>stable</state>
<notes>
* Implement Request #13375: install-pear.php should have option to set cfg_dir [timj]
+ * Fix Bug #12959 PEAR should give warning when doing "special" handling with
cfg role [cellog]
* Fix Bug #12960 role=cfg should automatically replace file if it has not been modified [cellog]
* Fix Bug #13031 PEAR fails to authenticate when doing upgrade-all on non-default channel [timj]
* Fix Bug #13033 Signature to PEAR_REST_XX::listAll() changes between REST1.0 and 1.1 [timj]
http://cvs.php.net/viewvc.cgi/pear-core/package2.xml?r1=1.433&r2=1.434&diff_format=u
Index: pear-core/package2.xml
diff -u pear-core/package2.xml:1.433 pear-core/package2.xml:1.434
--- pear-core/package2.xml:1.433 Tue May 13 22:46:07 2008
+++ pear-core/package2.xml Tue May 13 23:53:10 2008
@@ -98,6 +98,7 @@
<license uri="http://www.php.net/license">PHP
License</license>
<notes>
* Implement Request #13375: install-pear.php should have option to set cfg_dir [timj]
+ * Fix Bug #12959 PEAR should give warning when doing "special" handling with
cfg role [cellog]
* Fix Bug #12960 role=cfg should automatically replace file if it has not been modified [cellog]
* Fix Bug #13031 PEAR fails to authenticate when doing upgrade-all on non-default channel [timj]
* Fix Bug #13033 Signature to PEAR_REST_XX::listAll() changes between REST1.0 and 1.1 [timj]
http://cvs.php.net/viewvc.cgi/pear-core/PEAR/Installer/Role/Cfg.php?r1=1.6&r2=1.7&diff_format=u
Index: pear-core/PEAR/Installer/Role/Cfg.php
diff -u pear-core/PEAR/Installer/Role/Cfg.php:1.6 pear-core/PEAR/Installer/Role/Cfg.php:1.7
--- pear-core/PEAR/Installer/Role/Cfg.php:1.6 Tue May 13 22:46:07 2008
+++ pear-core/PEAR/Installer/Role/Cfg.php Tue May 13 23:53:11 2008
@@ -15,7 +15,7 @@
* @author Greg Beaver <cellog@php.net>
* @copyright 2007-2008 The PHP Group
* @license http://www.php.net/license/3_0.txt
PHP License 3.0
- * @version CVS: $Id: Cfg.php,v 1.6 2008/05/13 22:46:07 cellog Exp $
+ * @version CVS: $Id: Cfg.php,v 1.7 2008/05/13 23:53:11 cellog Exp $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.7.0
*/
@@ -97,6 +97,7 @@
'configuration variable to a writeable location and try again');
}
PEAR::popErrorHandling();
+ $this->installer->log(0, "WARNING: configuration file $old is being
installed as $test[2], you should manually merge in changes to the existing configuration
file");
$this->installer->addFileOperation('rename', array($temp_file,
$old, false));
$this->installer->addFileOperation('delete', array($temp_file));
}
http://cvs.php.net/viewvc.cgi/pear-core/tests/PEAR_Installer/setup.php.inc?r1=1.16&r2=1.17&diff_format=u
Index: pear-core/tests/PEAR_Installer/setup.php.inc
diff -u pear-core/tests/PEAR_Installer/setup.php.inc:1.16
pear-core/tests/PEAR_Installer/setup.php.inc:1.17
--- pear-core/tests/PEAR_Installer/setup.php.inc:1.16 Tue May 13 21:28:20 2008
+++ pear-core/tests/PEAR_Installer/setup.php.inc Tue May 13 23:53:11 2008
@@ -18,7 +18,7 @@
if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'data')) {
mkdir($temp_path . DIRECTORY_SEPARATOR . 'data');
}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'cfg')) {
+if (!is_dir($cfg_dir = $temp_path . DIRECTORY_SEPARATOR . 'cfg')) {
mkdir($temp_path . DIRECTORY_SEPARATOR . 'cfg');
}
if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'doc')) {
@@ -34,7 +34,7 @@
if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'script')) {
mkdir($temp_path . DIRECTORY_SEPARATOR . 'script');
}
-if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'tmp')) {
+if (!is_dir($tmp_dir = $temp_path . DIRECTORY_SEPARATOR . 'tmp')) {
mkdir($temp_path . DIRECTORY_SEPARATOR . 'tmp');
}
if (!is_dir($temp_path . DIRECTORY_SEPARATOR . 'bin')) {
@@ -55,6 +55,7 @@
'doc_dir' => $temp_path . DIRECTORY_SEPARATOR . 'doc',
'test_dir' => $temp_path . DIRECTORY_SEPARATOR . 'test',
'download_dir' => $temp_path . DIRECTORY_SEPARATOR . 'tmp',
+ 'temp_dir' => $temp_path . DIRECTORY_SEPARATOR . 'tmp',
'bin_dir' => $temp_path . DIRECTORY_SEPARATOR . 'bin',));
touch($temp_path . DIRECTORY_SEPARATOR . 'pear.conf');
$fp = fopen($temp_path . DIRECTORY_SEPARATOR . 'pear.conf', 'w');
http://cvs.php.net/viewvc.cgi/pear-core/tests/PEAR_Installer/test_install_cfgrole.phpt?r1=1.2&r2=1.3&diff_format=u
Index: pear-core/tests/PEAR_Installer/test_install_cfgrole.phpt
diff -u pear-core/tests/PEAR_Installer/test_install_cfgrole.phpt:1.2
pear-core/tests/PEAR_Installer/test_install_cfgrole.phpt:1.3
--- pear-core/tests/PEAR_Installer/test_install_cfgrole.phpt:1.2 Tue Oct 30 19:27:25 2007
+++ pear-core/tests/PEAR_Installer/test_install_cfgrole.phpt Tue May 13 23:53:11 2008
@@ -113,6 +113,7 @@
array (
'name' => 'foo.php',
'role' => 'cfg',
+ 'md5sum' => '718d8596a14d123d83afb0d5d6d6fd96',
'installed_as' => $temp_path . DIRECTORY_SEPARATOR . 'cfg' .
DIRECTORY_SEPARATOR . 'PEAR' .
DIRECTORY_SEPARATOR . 'foo.php',
),
@@ -210,7 +211,8 @@
$phpunit->assertFileExists($temp_path . DIRECTORY_SEPARATOR . 'cfg' .
DIRECTORY_SEPARATOR . 'PEAR' . DIRECTORY_SEPARATOR . 'foo.php.new-1.4.2',
'installed file');
$phpunit->assertEquals(md5_file(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'packages' .
- DIRECTORY_SEPARATOR . 'foo.php'), md5_file($temp_path . DIRECTORY_SEPARATOR .
'cfg' . DIRECTORY_SEPARATOR . 'PEAR' . DIRECTORY_SEPARATOR .
'foo.php.new-1.4.2'), 'md52');$fakelog->getLog();
+ DIRECTORY_SEPARATOR . 'foo.php'), md5_file($temp_path . DIRECTORY_SEPARATOR .
'cfg' . DIRECTORY_SEPARATOR . 'PEAR' . DIRECTORY_SEPARATOR .
'foo.php.new-1.4.2'), 'md52');
+$fakelog->getLog();
$dp = &new test_PEAR_Downloader($fakelog, array('upgrade' => true), $config);
$result = $dp->download(array($c4));
@@ -226,6 +228,11 @@
$phpunit->assertNoErrors('set of downloaded packages');
$ret = &$installer->install($result[0], $dp->getOptions());
$phpunit->assertNoErrors('after install');
+$arr = $fakelog->getLog();
+$phpunit->assertEquals(array (
+ 0 => 0,
+ 1 => 'WARNING: configuration file ' . $cfg_dir . DIRECTORY_SEPARATOR .
'PEAR' . DIRECTORY_SEPARATOR . 'foo.php is being installed as ' . $cfg_dir .
DIRECTORY_SEPARATOR . 'PEAR' . DIRECTORY_SEPARATOR . 'foo.php.new-1.4.3, you should
manually merge in changes to the existing configuration file',
+ ), $arr[2], 'after install log');
$phpunit->assertFileExists($temp_path . DIRECTORY_SEPARATOR . 'cfg' .
DIRECTORY_SEPARATOR . 'PEAR' . DIRECTORY_SEPARATOR . 'foo.php',
'installed file');
$phpunit->assertEquals(md5('fix it up - woo'), md5_file($temp_path .
DIRECTORY_SEPARATOR . 'cfg' . DIRECTORY_SEPARATOR . 'PEAR' .
DIRECTORY_SEPARATOR . 'foo.php'), 'md51');