--- Remote.php	2007-05-28 22:32:35.000000000 +0200
+++ Remote_listall.php	2007-05-28 22:40:04.000000000 +0200
@@ -108,7 +108,11 @@
                     'shortopt' => 'c',
                     'doc' => 'specify a channel other than the default channel',
                     'arg' => 'CHAN',
-                    )
+                    ),
+                'channelinfo' => array(
+                    'shortopt' => 'i',
+                    'doc' => 'output fully channel-aware data, even on failure',
+                    ),
                 ),
             'doc' => '
 Lists the packages available on the configured server along with the
@@ -342,6 +346,11 @@
             'headline' => array('Package', 'Latest', 'Local'),
             'channel' => $channel,
             );
+        if (isset($options['channelinfo']) && $options['channelinfo'] == true) {
+            // add full channelinfo (should become default in PEAR2)
+            $data['caption'] = 'Channel ' . $channel . ' All packages:';
+            $data['headline'] = array('Channel', 'Package', 'Latest', 'Local', 'Description', 'Dependencies');
+        }
         $local_pkgs = $reg->listPackages($channel);
 
         foreach ($available as $name => $info) {
@@ -375,13 +384,34 @@
             if (isset($info['stable']) && !$info['stable']) {
                 $info['stable'] = null;
             }
-            $data['data'][$info['category']][] = array(
+            $data_array = array(
                 $reg->channelAlias($channel) . '/' . $name,
                 isset($info['stable']) ? $info['stable'] : null,
                 isset($installed['version']) ? $installed['version'] : null,
                 isset($desc) ? $desc : null,
                 isset($info['deps']) ? $info['deps'] : null,
                 );
+
+            if (isset($options['channelinfo']) && $options['channelinfo'] == true) {
+                // add full channelinfo (should become default in PEAR2)
+                if ($info['stable'] === $info['unstable']) {
+                    $state = $info['state'];
+                } else {
+                    $state = 'stable';
+                }
+                $latest = $info['stable'].' ('.$state.')';
+                $local = '';
+                if (isset($installed['version'])) {
+                    $inst_state = $reg->packageInfo($name, 'release_state', $channel);
+                    $local = $installed['version'].' ('.$inst_state.')';
+                }
+                
+                array_unshift($data_array, $channel); // add channel
+                $data_array[1] = $name; // change 'package'
+                $data_array[2] = $latest; // change 'latest'
+                $data_array[3] = $local; // change 'local'
+            }
+            $data['data'][$info['category']][] = $data_array;
         }
 
         if (isset($options['mode']) && in_array($options['mode'], array('notinstalled', 'upgrades'))) {
