File: sysreport

package info (click to toggle)
spamassassin 3.1.7-2
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 5,376 kB
  • ctags: 2,123
  • sloc: perl: 39,706; ansic: 3,133; sh: 1,344; sql: 170; makefile: 168
file content (107 lines) | stat: -rwxr-xr-x 2,148 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#!/usr/bin/perl -w

use strict;
no strict 'refs';


my %vars = ();

foreach (@ARGV) {
  my ($n, $v) = split('=', $_);
  $vars{$n} = $v;
}

my @checks = qw(
  PERL CC AUTOMAKE AUTOCONF LIBTOOL
);

foreach my $check (@checks) {
  my @check = &{"check_$check"};
  $check  = sprintf("% 10s %s %s", $check, shift(@check), shift(@check));
  $check .= sprintf(" (%s)", join('; ', @check)) if @check;
  $check .= "\n";
  print $check;
}


sub check_PERL {
  my @meta;

  my $pl = $vars{'PERL_BIN'} || '';
  $pl = '' if $pl eq 'this';
  $pl ||= $vars{'PERL'} || "perl";
  $pl = (split(/\s+/, $pl))[0];

  my @plver = split(/\s+/, `$pl --version 2>&1` || '');
  my $plver;
  if($plver[4] ne 'version') {
    $plver = $plver[4];
    $plver =~ s/^v//;
  } else {
    $plver = sprintf("%i.%i.%i", split(/[._]/, $plver[5]), 0);
  }

  push(@meta, 'override') if $vars{'PERL'} and $pl ne $vars{'PERL'};
  return($pl, $plver, @meta);
}

sub check_CC {
  my @meta;
  my $cc = $vars{'CC'} || "cc";

  my $ccver = (`$cc --version 2>&1`)[0] || 0;
  chomp($ccver);
  my $gnucc = grep("gnu", `$cc --help 2>&1` || '');

  push(@meta, 'gnu') if $gnucc;
  return($cc, $ccver, @meta);
}

sub check_LIBC {
  my @meta;
  my $lc = grep(/libc/, (`ldd /bin/sh 2>&1`));
  $lc = (split(/\s+/, $lc))[3];

  return($lc, 0, @meta);
}

sub check_LDD {
  my @meta;
  
}

sub check_AUTOMAKE {
  my @meta;
  my $am = $vars{'AUTOMAKE'} || "automake";

  my @amver = split(/\s+/, `$am --version 2>&1` || '');
  my $gnuam = $amver[1] =~ /GNU/i;
  my $amver = $gnuam ? $amver[3] : 0;

  push(@meta, 'gnu') if $gnuam;
  return($am, $amver, @meta);
}

sub check_AUTOCONF {
  my @meta;
  my $ac = $vars{'AUTOCONF'} || "autoconf";

  my @acver = split(/\s+/, `$ac --version 2>&1` || '');
  my $gnuac = $acver[1] =~ /GNU/i;
  my $acver = $gnuac ? $acver[3] : 0;

  push(@meta, 'gnu') if $gnuac;
  return($ac, $acver, @meta);
}

sub check_LIBTOOL {
  my @meta;
  my $lt = $vars{'LIBTOOL'} || "libtool";

  my @ltver = split(/\s+/, `$lt --version 2>&1` || '');
  my $gnult = $ltver[1] =~ /GNU/i;
  my $ltver = $gnult ? $ltver[3] : 0;

  push(@meta, 'gnu') if $gnult;
  return($lt, $ltver, @meta);
}