Ignore:
Timestamp:
01/01/11 20:20:40 (13 years ago)
Author:
nanardon
Message:
  • complete /distrib doc and feature
File:
1 edited

Legend:

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

    r259 r262  
    533533C<DISTRIBUTION>, C<RELEASE>, C<ARCH>. 
    534534 
    535 This is likelly the same thing than C</rpm/<PKGID>> but website will return 404 
    536 errur if the rpm is not in this distrib 
     535This is likelly the same thing than C</rpm/PKGID> but website will return 404 
     536error if the rpm is not in this distrib 
    537537 
    538538=cut 
     
    557557} 
    558558 
     559=head2 Url: /distrib/<DISTRIB>/<RELEASE>/<ARCH>/media/<MEDIA> 
     560 
     561Return the list of rpms in media C<MEDIA> for distribution C<DISTRIB>, 
     562C<RELEASE>, C<ARCH>. 
     563 
     564The return list is an array of struct: 
     565 
     566    [ 
     567        { 
     568            filename => 'zvbi-0.2.33-5.fc14.x86_64.rpm', 
     569            pkgid => 'bb9cc5113f0de3e4c7140a1ee8694900' 
     570        }, 
     571        { 
     572            filename => 'zvbi-devel-0.2.33-5.fc14.i686.rpm', 
     573            pkgid => '2c3b41c5e1c475dfa31492998eb4de9f' 
     574        } 
     575    ] 
     576 
     577=cut 
     578 
    559579sub media_list_rpms :Chained('_media_list_rpms') PathPart('') :Args(0) { 
    560580    my ( $self, $c ) = @_; 
     
    562582} 
    563583 
     584=head2 Url: /distrib/<DISTRIB>/<RELEASE>/<ARCH>/media/<MEDIA>/rpms/<NAME> 
     585 
     586Show binary rpm named C<NAME> in this distribution/media. 
     587 
     588Return C<404> error if such rpm does not exists 
     589 
     590=cut 
     591 
    564592sub media_rpm_byname :Chained('_media_list_rpms') PathPart('rpms') { 
    565     my ( $self, $c, $name ) = @_; 
    566 } 
     593    my ( $self, $c, $name, @subpart ) = @_; 
     594    $c->stash->{dist}{src} = 0; 
     595    ($c->stash->{pkgid}) = @{ $c->forward('/search/rpm/byname', 
     596        [ $c->stash->{dist}, $name ]) }; 
     597    $c->go('/404/index') unless ($c->stash->{pkgid}); 
     598    $c->go('/rpms/rpms', [ $c->stash->{pkgid}, @subpart ]); 
     599} 
     600 
     601=head2 Url: /distrib/<DISTRIB>/<RELEASE>/<ARCH>/media/<MEDIA>/srpms/<NAME> 
     602 
     603Show source rpm named C<NAME> in this distribution/media. 
     604 
     605Return C<404> error if such rpm does not exists 
     606 
     607=cut 
     608 
    567609sub media_srpm_byname :Chained('_media_list_rpms') PathPart('srpms') { 
    568     my ( $self, $c, $name ) = @_; 
    569 } 
     610    my ( $self, $c, $name, @subpart ) = @_; 
     611    $c->stash->{dist}{src} = 0; 
     612    ($c->stash->{pkgid}) = @{ $c->forward('/search/rpm/byname', 
     613        [ $c->stash->{dist}, $name ]) }; 
     614    $c->go('/404/index') unless ($c->stash->{pkgid}); 
     615    $c->go('/rpms/rpms', [ $c->stash->{pkgid}, @subpart ]); 
     616} 
     617 
     618=head2 Url: /distrib/<DISTRIB>/<RELEASE>/<ARCH>/media/<MEDIA>/by-pkgid/<PKGID> 
     619 
     620Show rpm having C<PKGID> in this distribution/media. 
     621 
     622Return C<404> error if such rpm does not exists 
     623 
     624=cut 
    570625 
    571626sub media_rpm_bypkgid :Chained('_media_list_rpms') PathPart('by-pkgid') { 
Note: See TracChangeset for help on using the changeset viewer.