From: Tomas V.V.Cox Date: Thu, 11 Sep 2003 13:36:59 +0000 (+0000) Subject: Fix bug of download tries when a local file is given X-Git-Tag: RELEASE_0_7~139 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dfcd61cef7bf24829dd37971d9c3c1bb62473309;p=php Fix bug of download tries when a local file is given to install --- diff --git a/pear/PEAR/Installer.php b/pear/PEAR/Installer.php index 930dbd12a6..dfeb0f3db3 100644 --- a/pear/PEAR/Installer.php +++ b/pear/PEAR/Installer.php @@ -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