Changeset 293
- Timestamp:
- 01/11/11 23:09:20 (13 years ago)
- Location:
- server/trunk/web/lib/Sophie/Controller
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
server/trunk/web/lib/Sophie/Controller/Analysis.pm
r287 r293 103 103 } 104 104 105 sub parentdir : XMLRPC { 106 my ($self, $c, $distspec, $id, $pool) = @_; 107 $pool ||= $id; 108 109 my @dir = $c->model('Base::UsersFiles')->search( 110 { 111 pid => [ $id ], 112 }, 113 { 114 select => [ qw(dirname) ], 115 group_by => [ qw(dirname) ], 116 order_by => [ qw(dirname) ], 117 } 118 )->get_column('dirname')->all; 119 120 $c->forward('/analysis/solver/parentdir', [ $distspec, \@dir, $pool ]); 121 } 122 105 123 =head1 AUTHOR 106 124 -
server/trunk/web/lib/Sophie/Controller/Analysis/Solver.pm
r284 r293 122 122 } 123 123 124 sub parentdir : XMLRPC { 125 my ($self, $c, $searchspec, $folder, $pool) = @_; 126 127 my %need_pool; 128 my %need_pkgid; 129 my %bydir; 130 my @notfound; 131 foreach my $dir (@{ $folder }) { 132 $dir =~ s:/$::; 133 my $found = 0; 134 my $res = $c->forward('/search/rpm/byfile', [ $searchspec, $dir, ]); 135 if (@{$res}) { 136 $found = 1; 137 foreach (@{$res}) { 138 $need_pkgid{$_} = 1; 139 $bydir{$dir}{pkg}{$_} = 1; 140 } 141 } 142 if ($pool) { 143 $res = $c->forward('/user/folder/byfile', [ $pool, $dir, ]); 144 if (@{$res}) { 145 $found = 1; 146 foreach (@{$res}) { 147 $need_pool{$_} = 1; 148 $bydir{$dir}{pool}{$_} = 1; 149 150 } 151 } 152 } 153 push(@notfound, $dir) unless($found); 154 } 155 return $c->stash->{xmlrpc} = { 156 notfound => \@notfound, 157 pkg => [ keys %need_pkgid ], 158 pool => [ keys %need_pool ], 159 bydir => \%bydir, 160 }; 161 } 124 162 125 163 =head1 AUTHOR … … 138 176 1; 139 177 140 141 =head1 AUTHOR142 143 Olivier Thauvin144 145 =head1 LICENSE146 147 This library is free software. You can redistribute it and/or modify148 it under the same terms as Perl itself.149 150 =cut151 152 __PACKAGE__->meta->make_immutable;153 154 1;
Note: See TracChangeset
for help on using the changeset viewer.