3 # List all the files in some package
5 require './cluster-software-lib.pl';
7 &ui_print_header(undef, $text{'list_title'}, "");
9 @servers = &list_servers();
10 ($s) = grep { $_->{'id'} == $in{'server'} } @servers;
11 &remote_foreign_require($s->{'host'}, "software", "software-lib.pl");
13 print &ui_subheading(&text('list_files', "<tt>$in{'package'}</tt>",
14 $s->{'desc'} ? $s->{'desc'} : $s->{'host'}));
15 print "<table border width=100%>\n";
16 print "<tr $tb> <td><b>$text{'list_path'}</b></td> ",
17 "<td><b>$text{'list_owner'}</b></td> ",
18 "<td><b>$text{'list_group'}</b></td> ",
19 "<td><b>$text{'list_type'}</b></td> ",
20 "<td><b>$text{'list_size'}</b></td> ",
21 "<td><b>$text{'list_status'}</b></td> </tr>\n";
22 $n = &remote_foreign_call($s->{'host'}, "software",
23 "check_files", $in{'package'});
24 $files = &remote_eval($s->{'host'}, "software", "\\%files");
25 for($i=0; $i<$n; $i++) {
26 $sz = $files->{$i,'size'};
27 $ty = $files->{$i,'type'};
29 if ($ty == 3 || $ty == 4) {
30 print "<td valign=top>$files->{$i,'path'} -> ",
31 "$files->{$i,'link'}</td>\n";
32 print "<td><br></td> <td><br></td>\n";
35 print "<td valign=top><table width=100% cellpadding=0 ",
36 "cellspacing=0><tr><td>",
37 "$files->{$i,'path'}</td> <td align=right>\n";
38 if ($ty == 0 || $ty == 5) {
39 print "<a href='view.cgi",$files->{$i,'path'},
40 "'>$text{'list_view'}</a>";
42 print "</td></tr>","</table></td>\n";
43 print "<td valign=top>$files->{$i,'user'}</td>\n";
44 print "<td valign=top>$files->{$i,'group'}</td>\n";
46 print "<td valign=top>$software::type_map[$ty]</td>\n";
47 if ($ty != 0) { $sz = "<br>"; }
48 elsif ($sz > 1000000) { $sz = sprintf "%d MB", $sz/1000000; }
49 elsif ($sz > 1000) { $sz = sprintf "%d kB", $sz/1000; }
51 print "<td valign=top>$sz</td>\n";
52 $err = $files->{$i,'error'};
57 print "<td valign=top><font color=#ff0000>$err</font></td>\n";
59 else { print "<td valign=top>$text{'list_ok'}</td>\n"; }
62 print "</table><p>\n";
65 &ui_print_footer("edit_pack.cgi?package=".&urlize($in{'package'})."&search=".&urlize($in{'search'}), $text{'edit_return'});