]> granicus.if.org Git - php/commitdiff
download package if force is set
authorTomas V.V.Cox <cox@php.net>
Fri, 26 Jul 2002 11:48:55 +0000 (11:48 +0000)
committerTomas V.V.Cox <cox@php.net>
Fri, 26 Jul 2002 11:48:55 +0000 (11:48 +0000)
pear/PEAR/Installer.php

index c37eddf40c06e6575ae6a484813460d687965387..590c11f122e70937f9cfc9f37d9a996267e8e06f 100644 (file)
@@ -304,6 +304,7 @@ class PEAR_Installer extends PEAR_Common
     function install($pkgfile, $options = array())
     {
         // recognized options:
+        // - force         : force installation
         // - register-only : update registry but don't install files
         // - upgrade       : upgrade existing install
         // - soft          : fail silently
@@ -315,7 +316,9 @@ class PEAR_Installer extends PEAR_Common
             $need_download = true;
         } elseif (!@is_file($pkgfile)) {
             if ($this->validPackageName($pkgfile)) {
-                if ($this->registry->packageExists($pkgfile) && empty($options['upgrade'])) {
+                if ($this->registry->packageExists($pkgfile) &&
+                    empty($options['upgrade']) && empty($options['force']))
+                {
                     return $this->raiseError("$pkgfile already installed");
                 }
                 $pkgfile = $this->getPackageDownloadUrl($pkgfile);