]> granicus.if.org Git - php/commitdiff
tweak Tomas's patch for
authorGreg Beaver <cellog@php.net>
Tue, 16 Sep 2003 03:27:55 +0000 (03:27 +0000)
committerGreg Beaver <cellog@php.net>
Tue, 16 Sep 2003 03:27:55 +0000 (03:27 +0000)
$ pear install Package-v.tgz

which should work for local files first before checking to see if it can be downloaded

pear/PEAR/Installer.php

index 511a9c8a56d19fbb690a992fb8ee3707db3cb45c..25500141a6223afa9a41ea6b16634fb4290262d1 100644 (file)
@@ -657,20 +657,20 @@ class PEAR_Installer extends PEAR_Common
 
         // download files in this list if necessary
         foreach($packages as $pkgfile) {
-            $origpkgfile = $pkgfile;
-            $pkgfile = $this->extractDownloadFileName($pkgfile, $version);
-            if ($version === null) {
-                // use preferred state if no version number was specified
-                $version = $state;
-            }
-            if ($this->validPackageName($pkgfile) && !isset($options['upgrade'])) {
-                if ($this->registry->packageExists($pkgfile)) {
-                    $this->log(0, "Package '$pkgfile' already installed, skipping");
-                    // ignore dependencies that are installed unless we are upgrading
-                    continue;
+            if (!is_file($pkgfile)) {
+                $origpkgfile = $pkgfile;
+                $pkgfile = $this->extractDownloadFileName($pkgfile, $version);
+                if ($version === null) {
+                    // use preferred state if no version number was specified
+                    $version = $state;
+                }
+                if ($this->validPackageName($pkgfile) && !isset($options['upgrade'])) {
+                    if ($this->registry->packageExists($pkgfile)) {
+                        $this->log(0, "Package '$pkgfile' already installed, skipping");
+                        // ignore dependencies that are installed unless we are upgrading
+                        continue;
+                    }
                 }
-            }
-            if (!@is_file($pkgfile)) {
                 $pkgfile = $this->_downloadFile($pkgfile, $config, $options, $errors,
                                                 $version, $origpkgfile, $state);
                 if (PEAR::isError($pkgfile)) {