Changeset 138


Ignore:
Timestamp:
12/18/10 18:24:48 (13 years ago)
Author:
nanardon
Message:
  • add 'more' command
File:
1 edited

Legend:

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

    r137 r138  
    324324    foreach (@{ $rpmlist->{results} }) { 
    325325        my $info = $c->forward('/rpms/queryformat', [ $_, $args[1] ]); 
    326         push @message, $info; 
     326        push @message, $info . ' // ' . 
     327            $c->forward('_fmt_location', [ $_ ]); 
    327328    } 
    328329    return $c->stash->{xmlrpc} = { 
     
    331332} 
    332333 
     334=head2 more NAME 
     335 
     336Show url where details about package named C<NAME> can be found 
     337 
     338=cut 
     339 
     340sub more : XMLRPC { 
     341    my ($self, $c, $reqspec, @args) = @_; 
     342    my @message; 
     343    $reqspec->{src} = 0; 
     344 
     345    @args = @{ $c->forward('_getopt', [ 
     346        { 
     347            'd=s' => \$reqspec->{distribution}, 
     348            'v=s' => \$reqspec->{release}, 
     349            'a=s' => \$reqspec->{arch}, 
     350            's'   => sub { $reqspec->{src} = 1 }, 
     351        }, @args ]) }; 
     352 
     353    my $rpmlist = $c->forward('/search/byname', [ $reqspec, $args[0] ]); 
     354    foreach (@{ $rpmlist->{results} }) { 
     355        push @message, $c->uri_for('/rpms', $_) . ' // ' . 
     356            $c->forward('_fmt_location', [ $_ ]); 
     357    } 
     358    return $c->stash->{xmlrpc} = { 
     359        message => \@message, 
     360    } 
     361} 
     362 
    333363=head1 AUTHOR 
    334364 
Note: See TracChangeset for help on using the changeset viewer.