cvs: php4 /pear/PEAR/Command Install.php
| From: | Tomas V.V.Cox | Date: | Mon, 01 Apr 2002 17:25:42 +0000 |
| Subject: | cvs: php4 /pear/PEAR/Command Install.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-2953@lists.php.net to get a copy of this message | ||
cox Mon Apr 1 12:25:42 2002 EDT
Modified files:
/php4/pear/PEAR/Command Install.php
Log:
- Added "nodeps" option to install/upgrade/uninstall
(pear install -n package.tgz)
- Finish to document the install commands
Index: php4/pear/PEAR/Command/Install.php
diff -u php4/pear/PEAR/Command/Install.php:1.11 php4/pear/PEAR/Command/Install.php:1.12
--- php4/pear/PEAR/Command/Install.php:1.11 Mon Apr 1 09:32:40 2002
+++ php4/pear/PEAR/Command/Install.php Mon Apr 1 12:25:42 2002
@@ -16,7 +16,7 @@
// | Author: Stig Bakken <ssb@fast.no> |
// +----------------------------------------------------------------------+
//
-// $Id: Install.php,v 1.11 2002/04/01 14:32:40 cox Exp $
+// $Id: Install.php,v 1.12 2002/04/01 17:25:42 cox Exp $
require_once "PEAR/Command/Common.php";
require_once "PEAR/Installer.php";
@@ -61,15 +61,24 @@
{
switch ($command) {
case 'install':
- return array('<pear package>',
+ $ret = array('<pear package>',
'Installs a PEAR package created by the "package"
command');
+ break;
case 'uninstall':
- return array('<package>',
+ $ret = array('<package>',
'Uninstalls a previously installed PEAR package');
+ break;
case 'upgrade':
- return array('<pear package>',
+ $ret = array('<pear package>',
'Upgrades a PEAR package installed in the system');
+ break;
}
+ $ret[0] = "[-n] [-f] {$ret[0]}";
+ $ret[1] = "{$ret[1]}\n" .
+ " -f forces the installation of the package\n".
+ " when it is already installed\n".
+ " -n do not take care package dependencies";
+ return $ret;
}
// }}}
@@ -84,15 +93,17 @@
$failmsg = '';
$opts = array();
+ if (isset($options['f'])) {
+ $opts['force'] = true;
+ }
+ if (isset($options['n'])) {
+ $opts['nodeps'] = true;
+ }
switch ($command) {
case 'upgrade':
$opts['upgrade'] = true;
// fall through
case 'install': {
- if (isset($options['f'])) {
- $opts['force'] = true;
- }
- // XXX The ['nodeps'] option is still missing
if ($installer->install(@$params[0], $opts, $this->config)) {
$this->ui->displayLine("install ok");
} else {
@@ -122,7 +133,7 @@
function getOptions()
{
- return array('f');
+ return array('f', 'n');
}
}