Changeset 447
- Timestamp:
- 06/29/12 18:11:53 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
server/trunk/web/lib/Sophie/Controller/Chat/Cmd.pm
r446 r447 392 392 my ($self, $c, $reqspec, @args) = @_; 393 393 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 ])) { 397 401 return $c->stash->{xmlrpc} = { 398 402 message => [ "I don't have any distribution matching: " … … 401 405 } 402 406 407 my @list = @{ $c->forward('/distrib/list', [ $distrib ]) }; 403 408 return $c->stash->{xmlrpc} = { 404 409 message => [ … … 407 412 : '') . 408 413 join(', ', @list) ], 409 }410 }411 412 #=head2 _listlc [distribution [release [arch]]]413 #414 #List available distribution, release, architecture matching given arguments, in415 #lower case.416 #417 #=cut418 419 sub _listlc : private {420 my ($self, $c, $reqspec, @args) = @_;421 422 # call for the common list query423 my $list = $c->forward('_listQuery' , [ @args ]);424 425 # lowercase of the list and return426 return [ map( lc, @{ $list || [] } ) ];427 }428 429 =head2 _listQuery [distribution [release [arch]]]430 431 #List available distribution, release, architecture matching given arguments.432 433 =cut434 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 ]) };449 414 } 450 415 }
Note: See TracChangeset
for help on using the changeset viewer.