- Timestamp:
- 12/22/10 01:02:39 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
server/trunk/web/lib/Sophie/Controller/Chat/Cmd.pm
r165 r170 563 563 } 564 564 565 =head2 maint RPMNAME 566 567 Show the maintainers for the rpm named C<RPMNAME>. 568 569 =cut 570 571 sub maint : XMLRPC { 572 my ($self, $c, $reqspec, @args) = @_; 573 $reqspec->{src} = 0; 574 my @message; 575 @args = @{ $c->forward('_getopt', [ 576 { 577 'd=s' => \$reqspec->{distribution}, 578 'v=s' => \$reqspec->{release}, 579 'a=s' => \$reqspec->{arch}, 580 }, @args ]) }; 581 if (!$c->forward('/distrib/exists', [ $reqspec ])) { 582 return $c->stash->{xmlrpc} = { 583 message => [ "I don't have such distribution" ] 584 }; 585 } 586 my $rpmlist = $c->forward('/search/rpm/byname', [ $reqspec, $args[0] ]); 587 if (!@{ $rpmlist }) { 588 my $else = $c->forward('_find_rpm_elsewhere', [ $reqspec, $args[0] ]); 589 if ($else) { 590 return $c->stash->{xmlrpc} = { 591 message => [ 592 "The rpm named `$args[0]' has not been found but found in " . $else 593 ], 594 } 595 } else { 596 return $c->stash->{xmlrpc} = { 597 message => [ "The rpm named `$args[0]' has not been found" ], 598 } 599 } 600 } 601 my %maint; 602 foreach (@{ $rpmlist }) { 603 my $res = $c->forward('/rpms/maintainers', [ $_ ]); 604 foreach (@$res) { 605 my $m = 'For ' . $_->{vendor} . ': ' . $_->{owner}; 606 $maint{$m} = 1; 607 } 608 } 609 return $c->stash->{xmlrpc} = { 610 message => [ sort keys %maint ], 611 } 612 } 613 565 614 =head1 AUTHOR 566 615
Note: See TracChangeset
for help on using the changeset viewer.