Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision f207efd1

Von Sven Schöling vor mehr als 10 Jahren hinzugefügt

  • ID f207efd1ad8835c046c2945c3d0d693626622521
  • Vorgänger a75bd966
  • Nachfolger b989d7cf

Installationcheck: --silent switch um es in shell scripte einzubinden

Unterschiede anzeigen:

SL/InstallationCheck.pm
17 17
#   dist_name: name of the package in cpan if it differs from name (ex.: LWP != libwww-perl)
18 18
@required_modules = (
19 19
  { name => "parent",                              url => "http://search.cpan.org/~corion/",    debian => 'libparent-perl' },
20
  { name => "Archive::Zip",    version => '1.16',  url => "http://search.cpan.org/~phred/",     debian => 'libarchive-zip-perl' },
20
  { name => "Archive::Zip",    version => '12.16',  url => "http://search.cpan.org/~phred/",     debian => 'libarchive-zip-perl' },
21 21
  { name => "Clone",                               url => "http://search.cpan.org/~rdf/",       debian => 'libclone-perl' },
22 22
  { name => "Config::Std",                         url => "http://search.cpan.org/~dconway/",   debian => 'libconfig-std-perl' },
23 23
  { name => "DateTime",                            url => "http://search.cpan.org/~drolsky/",   debian => 'libdatetime-perl' },
scripts/installation_check.pl
50 50
  "h|help"      => sub { pod2usage(-verbose => 2) },
51 51
  "c|color!"    => \ ( my $c = 1 ),
52 52
  "i|install-command!"  => \ my $apt,
53
  "s|silent"    => \ $check{s},
53 54
);
54 55

  
55 56
my %install_methods = (
......
104 105
print_header('Result');
105 106
print_line('All', $fail ? 'NOT ok' : 'OK', $fail ? 'red' : 'green');
106 107

  
107
if ($default_run) {
108
if ($default_run && !$check{s}) {
108 109
  if (@missing_modules) {
109 110
    $apt = 1;
110 111
  print <<"EOL";
......
122 123
  }
123 124
}
124 125

  
125
if (@missing_modules && $apt) {
126
if (@missing_modules && $apt && !$check{s}) {
126 127
  print "\nHere are some sample installation lines, choose one appropriate for your system:\n\n";
127 128
  local $Text::Wrap::separator = " \\\n";
128 129

  
......
136 137
  }
137 138
}
138 139

  
140
exit !!@missing_modules;
141

  
139 142
sub check_latex {
140 143
  my ($res) = check_kpsewhich();
141 144
  print_result("Looking for LaTeX kpsewhich", $res);
......
158 161
sub check_kpsewhich {
159 162
  return 1 if SL::InstallationCheck::check_kpsewhich();
160 163

  
161
  print STDERR <<EOL if $v;
164
  print STDERR <<EOL if $v && !$check{s};
162 165
+------------------------------------------------------------------------------+
163 166
  Can't find kpsewhich, is there a proper installed LaTeX?
164 167
  On Debian you may run "aptitude install texlive-base-bin"
......
182 185

  
183 186
  print_result("Looking for LaTeX $type_desc $package", $res);
184 187
  if (!$res) {
185
    print STDERR <<EOL if $v;
188
    print STDERR <<EOL if $v && !$check{s};
186 189
+------------------------------------------------------------------------------+
187 190
  LaTeX $type_desc $package could not be loaded.
188 191

  
......
222 225

  
223 226
  my @source_texts = module_source_texts($module);
224 227
  local $" = $/;
225
  print STDERR <<EOL if $v;
228
  print STDERR <<EOL if $v && !$check{s};
226 229
+------------------------------------------------------------------------------+
227 230
  $module->{fullname} could not be loaded.
228 231

  
......
270 273

  
271 274
sub print_line {
272 275
  my ($text, $res, $color) = @_;
276
  return if $check{s};
273 277
  print $text, " ", ('.' x (78 - length($text) - length($res))), " ", mycolor($res, $color), $/;
274 278
}
275 279

  
276 280
sub print_header {
281
  return if $check{s};
277 282
  print $/;
278 283
  print "$_[0]:", $/;
279 284
}

Auch abrufbar als: Unified diff