Changeset 349
- Timestamp:
- 01/25/11 23:46:51 (13 years ago)
- Location:
- server/trunk/web
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
server/trunk/web/lib/Sophie/Base/Result/Deps.pm
r6 r349 10 10 __PACKAGE__->belongs_to(Rpms => 'Sophie::Base::Result::Rpms', 'pkgid'); 11 11 12 12 __PACKAGE__->add_relationship( RpmFile => 'Sophie::Base::Result::RpmFile', 13 { pkgid => 'pkgid' }); 13 14 1; -
server/trunk/web/lib/Sophie/Base/Result/MediasPaths.pm
r12 r349 10 10 __PACKAGE__->belongs_to(Medias => 'Sophie::Base::Result::Medias', 'd_media'); 11 11 __PACKAGE__->belongs_to(Paths => 'Sophie::Base::Result::Paths', 'd_path'); 12 __PACKAGE__->add_relationship( RpmFiles => 'Sophie::Base::Result::RpmFile', 13 { 'foreign.d_path' => 'self.d_path' }); 12 14 13 15 -
server/trunk/web/lib/Sophie/Base/Result/RpmFile.pm
r2 r349 10 10 __PACKAGE__->belongs_to(Path => 'Sophie::Base::Result::Paths', 'd_path'); 11 11 __PACKAGE__->belongs_to(Rpms => 'Sophie::Base::Result::Rpms', 'pkgid'); 12 #__PACKAGE__->has_many(mediaspaths => 'Sophie::Base::Result::MediasPaths', 'path');13 12 13 __PACKAGE__->add_relationship( MediasPaths => 'Sophie::Base::Result::MediasPaths', 14 { 'foreign.d_path' => 'self.d_path' }); 15 16 __PACKAGE__->add_relationship( Deps => 'Sophie::Base::Result::Deps', 17 { 'foreign.pkgid' => 'self.pkgid' }); 18 __PACKAGE__->add_relationship( Files => 'Sophie::Base::Result::Files', 19 { 'foreign.pkgid' => 'self.pkgid' }); 20 __PACKAGE__->add_relationship( BinFiles => 'Sophie::Base::Result::BinFiles', 21 { 'foreign.pkgid' => 'self.pkgid' }); 22 __PACKAGE__->add_relationship( SrcFiles => 'Sophie::Base::Result::SrcFiles', 23 { 'foreign.pkgid' => 'self.pkgid' }); 24 __PACKAGE__->add_relationship( Tags => 'Sophie::Base::Result::Tags', 25 { 'foreign.pkgid' => 'self.pkgid' }); 14 26 15 27 1; -
server/trunk/web/lib/Sophie/Base/Result/Rpms.pm
r333 r349 11 11 __PACKAGE__->has_many(Deps => 'Sophie::Base::Result::Deps', 'pkgid'); 12 12 __PACKAGE__->has_many(Files => 'Sophie::Base::Result::Files', 'pkgid'); 13 __PACKAGE__->has_many(BinFiles => 'Sophie::Base::Result::BinFiles', 'pkgid'); 13 14 __PACKAGE__->has_many(SrcFiles => 'Sophie::Base::Result::SrcFiles', 'pkgid'); 14 15 __PACKAGE__->has_many(Tags => 'Sophie::Base::Result::Tags', 'pkgid'); -
server/trunk/web/lib/Sophie/Controller/Distrib.pm
r275 r349 104 104 $distrib->{distribution} 105 105 ? (-or => [ 106 { name=> $distrib->{distribution} },106 { 'me.name' => $distrib->{distribution} }, 107 107 { shortname => $distrib->{distribution} }, 108 108 ], … … 125 125 { 126 126 $distrib->{arch} 127 ? ( arch=> $distrib->{arch})127 ? ('Arch.arch' => $distrib->{arch}) 128 128 : () 129 129 }, -
server/trunk/web/lib/Sophie/Controller/Search.pm
r330 r349 191 191 my ($self, $c, $searchspec, $deptype, $depname, $depsense, $depevr ) = @_; 192 192 193 my $distrs = $c->forward('distrib_search', [ $searchspec, 1 ]); 194 195 return $c->model('Base::Deps')->search( 193 $c->model('BaseSearch')->best_rpm_filter($searchspec) 194 ->search({}, { join => [ 'Deps' ]})->search( 196 195 { 197 196 -and => [ … … 200 199 ($depsense 201 200 ? ({-nest => \[ 202 'rpmdepmatch( flags,evr, rpmsenseflag(?), ?)',201 'rpmdepmatch(Deps.flags, Deps.evr, rpmsenseflag(?), ?)', 203 202 [ plain_text => $depsense], 204 203 [ plain_text => $depevr ] 205 204 ]}) 206 205 : ()), 207 ($distrs208 ? ({ pkgid => { IN => $distrs->get_column('pkgid')->as_query,209 },})210 : ()),211 (exists($searchspec->{src})212 ? { pkgid => { IN => $c->model('Base::Rpms')->search(213 { issrc => $searchspec->{src} ? 1 : 0 }214 )->get_column('pkgid')->as_query, }, }215 : ()),216 206 ($searchspec->{pkgid} 217 ? { pkgid=> $searchspec->{pkgid} }207 ? { 'Deps.pkgid' => $searchspec->{pkgid} } 218 208 : ()), 219 209 ] 220 210 }, 221 211 { 222 '+select' => [ { rpmsenseflag => ' flags' }, 'depname', ],212 '+select' => [ { rpmsenseflag => 'Deps.flags' }, 'Deps.depname', ], 223 213 '+as' => [ qw(sense name) ], 224 214 -
server/trunk/web/lib/Sophie/Controller/Search/Rpm.pm
r330 r349 97 97 $searchspec ||= {}; 98 98 99 my $distrs = $c->forward('/search/distrib_search', [ $searchspec, 1 ]);99 #my $distrs = $c->forward('/search/distrib_search', [ $searchspec, 1 ]); 100 100 101 101 my $deprs = $c->forward( … … 113 113 order_by => [ 'name', 'evr using >>', 'issrc', 'arch' ], 114 114 rows => $searchspec->{rows}, 115 select => [ 'pkgid' ], 116 as => [ 'pkgid' ], 115 117 } 116 118 );
Note: See TracChangeset
for help on using the changeset viewer.