]> granicus.if.org Git - php/commitdiff
Fix bug of download tries when a local file is given
authorTomas V.V.Cox <cox@php.net>
Thu, 11 Sep 2003 13:36:59 +0000 (13:36 +0000)
committerTomas V.V.Cox <cox@php.net>
Thu, 11 Sep 2003 13:36:59 +0000 (13:36 +0000)
to install

pear/PEAR/Installer.php

index 930dbd12a6f6d2463476fe66ed3b8f22e6881d79..dfeb0f3db3bbfec159904cc078ce5f5e04bb4394 100644 (file)
@@ -648,10 +648,12 @@ class PEAR_Installer extends PEAR_Common
                     continue;
                 }
             }
-            $pkgfile = $this->_downloadFile($pkgfile, $config, $options, $errors,
-                $version, $origpkgfile, $state);
-            if (PEAR::isError($pkgfile)) {
-                return $pkgfile;
+            if (!@is_file($pkgfile)) {
+                $pkgfile = $this->_downloadFile($pkgfile, $config, $options, $errors,
+                                                $version, $origpkgfile, $state);
+                if (PEAR::isError($pkgfile)) {
+                    return $pkgfile;
+                }
             }
             $tempinfo = $this->infoFromAny($pkgfile);
             if (isset($options['alldeps']) || isset($options['onlyreqdeps'])) {
@@ -661,7 +663,7 @@ class PEAR_Installer extends PEAR_Common
                 }
             }
             $installpackages[] = array('pkg' => $tempinfo['package'],
-                'file' => $pkgfile, 'info' => $tempinfo);
+                                       'file' => $pkgfile, 'info' => $tempinfo);
         }
 
         // extract dependencies from downloaded files and then download them