]> granicus.if.org Git - php/commitdiff
- Added "nodeps" option to install/upgrade/uninstall
authorTomas V.V.Cox <cox@php.net>
Mon, 1 Apr 2002 17:25:42 +0000 (17:25 +0000)
committerTomas V.V.Cox <cox@php.net>
Mon, 1 Apr 2002 17:25:42 +0000 (17:25 +0000)
  (pear install -n package.tgz)
- Finish to document the install commands

pear/PEAR/Command/Install.php

index 1960bc55c372ce28a3adb3e1ee55e7d5caa05eea..a458f69a79bb92efa1c6f97176e3d070d7f0f660 100644 (file)
@@ -61,15 +61,24 @@ class PEAR_Command_Install extends PEAR_Command_Common
     {
         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 @@ class PEAR_Command_Install extends PEAR_Command_Common
 
         $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 @@ class PEAR_Command_Install extends PEAR_Command_Common
 
     function getOptions()
     {
-        return array('f');
+        return array('f', 'n');
     }
 }