--- Remote_orig.php	2007-05-25 15:42:57.000000000 +0200
+++ Remote.php	2007-05-25 16:08:47.000000000 +0200
@@ -90,7 +90,11 @@
                     'shortopt' => 'c',
                     'doc' => 'specify a channel other than the default channel',
                     'arg' => 'CHAN',
-                    )
+                    ),
+                'allchannels' => array(
+                    'shortopt' => 'a',
+                    'doc' => 'list installed packages from all channels',
+                    ),
                 ),
             'doc' => '[packagename] [packageinfo]
 Lists all packages which match the search parameters.  The first
@@ -416,8 +420,30 @@
             return $this->raiseError('no valid search string supplied');
         };
 
-        $savechannel = $channel = $this->config->get('default_channel');
         $reg = &$this->config->getRegistry();
+        if (isset($options['allchannels']) && $options['allchannels'] == true) {
+            // search all channels
+            unset($options['allchannels']);
+            $channels = $reg->getChannels();
+            $errors = array();
+            foreach ($channels as $channel) {
+                if ($channel->getName() != '__uri') {
+                    $options['channel'] = $channel->getName();
+                    $ret = $this->doSearch($command, $options, $params);
+                    if ($ret !== true) {
+                        $errors[] = $ret;
+                    }
+                }
+            }
+            if (count($errors) !== 0) {
+                // for now, only give first error
+                return $errors[0];
+            }
+
+            return true;
+        }
+
+        $savechannel = $channel = $this->config->get('default_channel');
         $package = $params[0];
         $summary = isset($params[1]) ? $params[1] : false;
         if (isset($options['channel'])) {
@@ -447,8 +473,13 @@
             return $this->raiseError($available);
         }
         if (!$available) {
-            return $this->raiseError('no packages found that match pattern "' . $package . '"');
+            // clean exit when not found, no error !
+            $data = 'no packages found that match pattern "' . $package . '", for channel '.$channel.'.';
+            $this->ui->outputData($data);
+            $this->config->set('default_channel', $channel);
+            return true;
         }
+
         $data = array(
             'caption' => 'Matched packages, channel ' . $channel . ':',
             'border' => true,
