Changeset 462
- Timestamp:
- 08/01/12 13:46:00 (12 years ago)
- Files:
-
- 4 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/trunk/MANIFEST
r427 r462 4 4 README 5 5 bin/sophie-notify 6 bin/sophie 6 7 bin/sophie-rpm 7 8 bin/sophie-rpm2 … … 12 13 lib/Sophie/Client/Transaction.pm 13 14 lib/Sophie/Client.pm 15 lib/Sophie/Client/Functions/Help.pm 14 16 sophie-tools.spec.in 15 17 sysinit/sophie-notify -
tools/trunk/lib/Sophie/Client.pm
r424 r462 6 6 use RPC::XML; 7 7 use base qw(RPC::XML::Client); 8 use Sophie::Client::Transaction;9 8 $RPC::XML::FORCE_STRING_ENCODING = 1; 10 9 … … 71 70 } 72 71 73 sub ts {74 my ($self, $distrib) = @_;75 return Sophie::Client::Transaction->new($self, $distrib);76 }77 78 72 1; 79 73 -
web/lib/Sophie/Controller/Search.pm
r460 r462 266 266 } 267 267 268 sub file_md5_rs : Private { 269 my ( $self, $c, $searchspec, $md5) = @_; 270 $searchspec ||= {}; 271 272 $md5 or return; 273 274 my $rs = $c->model('Base::Files')->search( 275 { 276 -and => [ 277 md5 => $md5, 278 ($searchspec->{content} ? { has_content => 1 } : ()), 279 ($searchspec->{pkgid} 280 ? { 'pkgid' => { IN => $searchspec->{pkgid} } } 281 : ()), 282 ], 283 }, 284 { 285 '+select' => [ 286 'contents is NOT NULL as has_content', 287 { rpmfilesmode => 'mode' }, 288 ], 289 '+as' => [ qw(has_content perm), ] 290 } 291 ); 292 if (exists($searchspec->{src})) { 293 $rs = $rs->search_related('Rpms', 294 { issrc => $searchspec->{src} ? 1 : 0 } 295 ) 296 } 297 return $c->model('BaseSearch')->apply_rpm_filter($rs, $searchspec); 298 } 299 268 300 sub end : Private { 269 301 my ($self, $c, $searchspec) = @_; -
web/lib/Sophie/Controller/Search/File.pm
r147 r462 18 18 19 19 20 =head2 index21 22 =cut23 24 20 sub index :Path :Args(0) { 25 21 my ( $self, $c ) = @_; … … 27 23 $c->response->body('Matched Sophie::Controller::Search::File in Search::File.'); 28 24 } 25 26 27 =head2 byname [ searchspec, Filename ] 28 29 Return the list of file named C<Filename> where filename can be: 30 31 =over 4 32 33 =item the complete path F</usr/bin/perl> 34 35 =item the basename F<perl> 36 37 =item the basename with the end of the path (bin/perl). 38 39 =back 40 41 =cut 29 42 30 43 sub byname : Private { … … 52 65 } 53 66 67 =head2 byname [ searchspec, Md5sum ] 68 69 Return the list of file having content checksum equal to C<Md5sum> 70 71 =cut 72 73 sub bymd5 : Private { 74 my ( $self, $c, $searchspec, $md5) = @_; 75 $searchspec ||= {}; 76 77 my @col = qw(dirname basename md5 size pkgid count); 78 $c->stash->{column} = [ @col, qw(has_content perm user group) ]; 79 80 $c->stash->{xmlrpc} = [ 81 map { { $_->get_columns } } 82 $c->forward('/search/file_md5_rs', [ $searchspec, $md5 ])->all 83 ]; 84 } 85 86 sub bymd5_rpc : XMLRPCPath('bymd5') { 87 my ( $self, $c, $searchspec, $md5) = @_; 88 $searchspec ||= {}; 89 90 $c->stash->{rs} = $c->forward('/search/file_md5_rs', [ $searchspec, $md5 ]); 91 92 my @col = qw(dirname basename md5 size pkgid count); 93 $c->stash->{column} = [ @col, qw(has_content perm user group) ]; 94 95 } 54 96 55 97 =head1 AUTHOR -
web/lib/Sophie/Controller/Sources.pm
r460 r462 87 87 } 88 88 89 $c->model('Base::Rpms') 90 ->search( 91 { 92 name => $name, 93 issrc => 1, 94 $rpmrs 95 ? (pkgid => { IN => $rpmrs->get_column('pkgid')->as_query },) 96 : (), 97 }, 98 { 99 select => [ 'evr' ], 100 } 101 )->search_related('SrcFiles')->search( 89 $c->model('Base::SrcFiles')->search( 102 90 { 103 91 has_content => 1, 104 92 basename => $filename, 93 ($rpmrs 94 ? ('me.pkgid' => { IN => $rpmrs->get_column('pkgid')->as_query },) 95 : ()), 96 ($name 97 ? ('me.pkgid' => { IN => $c->model('Base::Rpms')->search( 98 { name => $name }, { select => ['Rpms.pkgid'] }) 99 ->get_column('pkgid')->as_query }) 100 : ()), 105 101 }, 106 102 { 107 '+columns' => [ qw( me.evr) ],103 '+columns' => [ qw(Rpms.evr) ], 108 104 order_by => [ 'evr using >>' ], 105 join => [ 'Rpms' ], 109 106 } 110 107 )->all ];
Note: See TracChangeset
for help on using the changeset viewer.