Changeset 304
- Timestamp:
- 01/14/11 03:16:26 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/trunk/bin/sophie-rpm
r301 r304 36 36 like C<http://proxy:8080/> 37 37 38 =item -v 39 40 Being verbose, show each required packages 41 38 42 =back 39 43 … … 91 95 'l=s' => \my $login, 92 96 'p=s' => \my $pass, 97 'v' => \my $verbose, 93 98 'proxy' => \my $proxy, 94 95 99 ) or pod2usage; 96 97 my %options;98 foreach (@options) {99 m/([^=]+)\s*=\s*(.*)/ or next;100 $options{$1} = $2;101 }102 100 103 101 $configfile ||= "$ENV{HOME}/.sophie.conf"; … … 116 114 login => $login, 117 115 password => $pass, 118 type => $type,119 116 proxy => $proxy, 120 117 ); … … 143 140 144 141 my @unresolved; 142 my @dirnotfound; 145 143 foreach my $rpmid (keys %rpmid) { 146 144 warn "Analysing $rpmid{$rpmid}\n"; … … 152 150 if (ref $analyse && !$analyse->is_fault) { 153 151 my $result = $analyse->value; 154 print "\nPackage requirements\n"; 155 foreach my $dep (keys %{ $result->{bydep} }) { 156 print $dep . ":\n"; 157 foreach (@{ $result->{bydep}{$dep}{pkg} || []}) { 158 print " " . $sc->send_request('rpms.basicinfo', $_)->value->{filename}; 159 print "\n"; 160 } 161 foreach (@{ $result->{bydep}{$dep}{pool} || [] }) { 162 print " * " . $pool{$_} . "\n"; 152 if ($verbose) { 153 print "\nPackage requirements\n"; 154 foreach my $dep (keys %{ $result->{bydep} }) { 155 print $dep . ":\n"; 156 foreach (@{ $result->{bydep}{$dep}{pkg} || []}) { 157 print " " . $sc->send_request('rpms.basicinfo', $_)->value->{filename}; 158 print "\n"; 159 } 160 foreach (@{ $result->{bydep}{$dep}{pool} || [] }) { 161 print " * " . $pool{$_} . "\n"; 162 } 163 163 } 164 164 } … … 176 176 if (ref $diranalyse && !$diranalyse->is_fault) { 177 177 my $result = $diranalyse->value; 178 print "\nParent directories:\n"; 179 foreach my $dir (sort keys %{ $result->{bydir} }) { 180 print $dir . ":\n"; 181 if (@{ $result->{bydir}{$dir}{pkg} || []} > 3) { 182 print " " . scalar(@{ $result->{bydir}{$dir}{pkg} || []}) . 183 " results in the distribution...\n"; 184 } else { 185 foreach (@{ $result->{bydir}{$dir}{pkg} || []}) { 186 print " " . $sc->send_request('rpms.basicinfo', $_)->value->{filename}; 187 print "\n"; 178 if ($verbose) { 179 print "\nParent directories:\n"; 180 foreach my $dir (sort keys %{ $result->{bydir} }) { 181 print $dir . ":\n"; 182 if (@{ $result->{bydir}{$dir}{pkg} || []} > 3) { 183 print " " . scalar(@{ $result->{bydir}{$dir}{pkg} || []}) . 184 " results in the distribution...\n"; 185 } else { 186 foreach (@{ $result->{bydir}{$dir}{pkg} || []}) { 187 print " " . $sc->send_request('rpms.basicinfo', $_)->value->{filename}; 188 print "\n"; 189 } 190 } 191 foreach (@{ $result->{bydir}{$dir}{pool} || [] }) { 192 print " * " . $pool{$_} . "\n"; 188 193 } 189 194 } 190 foreach (@{ $result->{bydir}{$dir}{pool} || [] }) {191 print " * " . $pool{$_} . "\n";192 }193 195 } 194 196 if (@{ $result->{notfound} || []}) { 197 push(@dirnotfound, @{ $result->{notfound} }); 195 198 print "\nUnowned directories:\n"; 196 199 print map { " $_\n" } @{ $result->{notfound} }; … … 202 205 $sc->send_request('user.folder.clear'); 203 206 207 if (@dirnotfound) { 208 print "Warning, this directory are not owned by any package:\n"; 209 print map { " $_\n" } @dirnotfound; 210 print "\n"; 211 } 204 212 if (@unresolved) { 205 213 print "Error, unresolved:\n"; 206 214 print map { " $_\n" } @unresolved; 215 print "\n"; 207 216 exit(1); 208 217 } else { 218 print "No Error found\n"; 209 219 exit(0); 210 220 }
Note: See TracChangeset
for help on using the changeset viewer.