Changeset 447


Ignore:
Timestamp:
06/29/12 18:11:53 (12 years ago)
Author:
grenoya
Message:
  • revert commit 446
File:
1 edited

Legend:

Unmodified
Added
Removed
  • server/trunk/web/lib/Sophie/Controller/Chat/Cmd.pm

    r446 r447  
    392392    my ($self, $c, $reqspec, @args) = @_; 
    393393 
    394     my $list = $c->forward('_listQuery' , [ @args ]); 
    395  
    396     if (!@$list) {  
     394    my $distrib = { 
     395        distribution => $args[0], 
     396        release      => $args[1], 
     397        arch         => $args[2], 
     398    }; 
     399 
     400    if (!$c->forward('/distrib/exists', [ $distrib ])) { 
    397401        return $c->stash->{xmlrpc} = { 
    398402            message => [ "I don't have any distribution matching: " 
     
    401405    } 
    402406 
     407    my @list = @{ $c->forward('/distrib/list', [ $distrib ]) }; 
    403408    return $c->stash->{xmlrpc} = { 
    404409        message => [  
     
    407412                : '') . 
    408413            join(', ', @list) ], 
    409     } 
    410 } 
    411  
    412 #=head2 _listlc [distribution [release [arch]]] 
    413 # 
    414 #List available distribution, release, architecture matching given arguments, in 
    415 #lower case. 
    416 # 
    417 #=cut 
    418  
    419 sub _listlc : private { 
    420     my ($self, $c, $reqspec, @args) = @_; 
    421  
    422     # call for the common list query 
    423     my $list = $c->forward('_listQuery' , [ @args ]); 
    424  
    425     # lowercase of the list and return 
    426     return [ map( lc, @{ $list || [] } ) ]; 
    427 } 
    428  
    429 =head2 _listQuery [distribution [release [arch]]] 
    430  
    431 #List available distribution, release, architecture matching given arguments. 
    432  
    433 =cut 
    434  
    435 sub _listQuery : Private { 
    436     my ($self, $c, $reqspec, @args) = @_; 
    437  
    438     my $distrib = { 
    439         distribution => $args[0], 
    440         release      => $args[1], 
    441         arch         => $args[2], 
    442     }; 
    443  
    444     if (!$c->forward('/distrib/exists', [ $distrib ])) { 
    445         return []; 
    446     } 
    447  
    448     return @{ $c->forward('/distrib/list', [ $distrib ]) }; 
    449414    } 
    450415} 
Note: See TracChangeset for help on using the changeset viewer.