Changeset 140


Ignore:
Timestamp:
12/18/10 19:15:09 (13 years ago)
Author:
nanardon
Message:
  • add buildfrom command to Chat
File:
1 edited

Legend:

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

    r139 r140  
    373373} 
    374374 
     375=head2 buildfrom NAME 
     376 
     377Return the list of package build from source package named C<NAME> 
     378 
     379=cut 
     380 
     381sub buildfrom : XMLRPC { 
     382    my ($self, $c, $reqspec, @args) = @_; 
     383    $reqspec->{src} = 1; 
     384    my @message; 
     385    @args = @{ $c->forward('_getopt', [ 
     386        { 
     387            'd=s' => \$reqspec->{distribution}, 
     388            'v=s' => \$reqspec->{release}, 
     389            'a=s' => \$reqspec->{arch}, 
     390        }, @args ]) }; 
     391    my $rpmlist = $c->forward('/search/byname', [ $reqspec, $args[0] ]); 
     392    foreach (@{ $rpmlist->{results} }) { 
     393        my $res = $c->forward('/rpms/binaries', [ $_ ]); 
     394        my @name; 
     395        foreach (@$res) { 
     396            push(@name, $c->forward('/rpms/basicinfo', [ $_ ])->{name}); 
     397        } 
     398        push(@message, join(', ', sort @name)); 
     399    } 
     400    return $c->stash->{xmlrpc} = { 
     401        message => \@message, 
     402    } 
     403 
     404} 
     405 
    375406=head1 AUTHOR 
    376407 
Note: See TracChangeset for help on using the changeset viewer.