]> granicus.if.org Git - php/commitdiff
Bug #25413 Add local installed packages to list-all
authorTomas V.V.Cox <cox@php.net>
Sat, 4 Oct 2003 12:57:34 +0000 (12:57 +0000)
committerTomas V.V.Cox <cox@php.net>
Sat, 4 Oct 2003 12:57:34 +0000 (12:57 +0000)
(thanks to Christian DickMann)

pear/PEAR/Command/Remote.php

index 7c44c3e1e9eaae7df7be169c1d3f0ec8270150e4..0235b4c85a9c30fa213ec332a14c953c71b1071e 100644 (file)
@@ -188,7 +188,8 @@ parameter.
             'border' => true,
             'headline' => array('Package', 'Latest', 'Local'),
             );
-
+        $local_pkgs = $reg->listPackages();
+        
         foreach ($available as $name => $info) {
             $installed = $reg->packageInfo($name);
             $desc = $info['summary'];
@@ -205,8 +206,12 @@ parameter.
                     && (!isset($installed['version']) || $installed['version'] == $info['stable']))
                 {
                     continue;
-                };
-            };
+                }
+            }
+            $pos = array_search(strtolower($name), $local_pkgs);
+            if ($pos !== false) {
+                unset($local_pkgs[$pos]);
+            }
 
             $data['data'][$info['category']][] = array(
                 $name,
@@ -216,6 +221,18 @@ parameter.
                 @$info['deps'],
                 );
         }
+        
+        foreach ($local_pkgs as $name) {
+            $info = $reg->packageInfo($name);
+            $data['data']['Local'][] = array(
+                $info['package'], 
+                '',
+                $info['version'],
+                $info['summary'],
+                @$info['release_deps']
+                );
+        }
+
         $this->ui->outputData($data, $command);
         return true;
     }