Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 53a78ccf

Von Sven Schöling vor fast 11 Jahren hinzugefügt

Installcheck nochmal verbessert.

- ohne flags kommt jetzt eine zusammenfassung für Blinde.
- neues flag i|--install-command das einem aggregierte apt-get etc Befehle baut
das neue flag wird automatisch angemacht wenn Module fehlen und keine Flags übergeben wurden.
- paar Rechtschreibfehler behoben
- Als Seiteneffekt zeigen die --verbose Links jetzt auch yum und zypper
(respektive suse und fedora Daten aus SL/InstallationCheck.pm) an

Unterschiede anzeigen:

scripts/installation_check.pl
49 49
  "r|required!" => \ $check{r},
50 50
  "h|help"      => sub { pod2usage(-verbose => 2) },
51 51
  "c|color!"    => \ ( my $c = 1 ),
52
  "i|install!"  => \ my $apt,
52
  "i|install-command!"  => \ my $apt,
53 53
);
54 54

  
55 55
my %install_methods = (
......
87 87
if ($check{r}) {
88 88
  print_header('Checking Required Modules');
89 89
  check_module($_, required => 1) for @SL::InstallationCheck::required_modules;
90
  print_header('Standard check for required modules done. See additional parameters for more checks (--help)') if $default_run;
91 90
}
92 91
if ($check{o}) {
93 92
  print_header('Checking Optional Modules');
......
101 100
  check_latex();
102 101
}
103 102

  
103
my $fail = @missing_modules;
104
print_header('Result');
105
print_line('All', $fail ? 'NOT ok' : 'OK', $fail ? 'red' : 'green');
106

  
107
if ($default_run) {
108
  if (@missing_modules) {
109
    $apt = 1;
110
  print <<"EOL";
111

  
112
HEY! It seems there are modules MISSING! Look for the red lines with "NOT ok"
113
above. You'll want to fix those, I've enabled --install-command for you...
114
EOL
115
  } else {
116
  print <<"EOL";
117

  
118
Standard check done, everything is OK and up to date. Have a look at the --help
119
section of this script to see some more advanced checks for developer and
120
optional dependancies, as well as LaTeX packages you might need.
121
EOL
122
  }
123
}
124

  
104 125
if (@missing_modules && $apt) {
105
  print "\nHere are some sample installation lines, choose one apporpriate for your system:\n\n";
126
  print "\nHere are some sample installation lines, choose one appropriate for your system:\n\n";
106 127
  local $Text::Wrap::separator = " \\\n";
107 128

  
108 129
  for (keys %install_methods) {
......
218 239
sub module_source_texts {
219 240
  my ($module) = @_;
220 241
  my @texts;
221
  push @texts, <<EOL;
222
  - You can get it from CPAN:
223
      perl -MCPAN -e "install $module->{name}"
242
  for my $key (keys %install_methods) {
243
    my $method = $install_methods{$key};
244
    push @texts, <<"EOL" if $module->{$method->{key}};
245
  - Using $method->{system} you can install it with $key:
246
      $method->{install} $module->{$method->{key}}
224 247
EOL
248
  }
225 249
  push @texts, <<EOL if $module->{url};
226 250
  - You can download it from this URL and install it manually:
227 251
      $module->{url}
228 252
EOL
229
  push @texts, <<EOL if $module->{debian};
230
  - On Debian, Ubuntu and other distros you can install it with apt-get:
231
      sudo apt-get install $module->{debian}
232
    Note: These may be out of date as well if your system is old.
233
EOL
234
 # TODO: SuSE and Fedora packaging. Windows packaging.
235 253

  
236 254
  return @texts;
237 255
}
......
338 356

  
339 357
Print additional info for missing dependancies
340 358

  
341
=item C<-i, --install>
359
=item C<-i, --install-command>
342 360

  
343 361
Tries to generate installation commands for the most common package managers.
344 362
Note that these lists can be slightly off, but it should still save you a lot

Auch abrufbar als: Unified diff