Changeset 446
- Timestamp:
- 06/29/12 14:53:43 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
server/trunk/web/lib/Sophie/Controller/Chat/Cmd.pm
r432 r446 392 392 my ($self, $c, $reqspec, @args) = @_; 393 393 394 my $distrib = { 395 distribution => $args[0], 396 release => $args[1], 397 arch => $args[2], 398 }; 399 400 if (!$c->forward('/distrib/exists', [ $distrib ])) { 394 my $list = $c->forward('_listQuery' , [ @args ]); 395 396 if (!@$list) { 401 397 return $c->stash->{xmlrpc} = { 402 398 message => [ "I don't have any distribution matching: " … … 405 401 } 406 402 407 my @list = @{ $c->forward('/distrib/list', [ $distrib ]) };408 403 return $c->stash->{xmlrpc} = { 409 404 message => [ … … 412 407 : '') . 413 408 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 ]) }; 414 449 } 415 450 }
Note: See TracChangeset
for help on using the changeset viewer.