2 # Kernel.pl: Frontend to linux.kernel.org.
4 # Version: v0.3 (19990919).
13 ### TODO: change this to http instead of finger?
14 my $server = "ftp.kernel.org";
16 my $proto = getprotobyname('tcp');
18 ###local $SIG{ALRM} = sub { die "alarm\n" };
21 ### return unless &::loadPerlModule("IO::Socket");
23 my $socket = new IO::Socket;
25 socket($socket, PF_INET, SOCK_STREAM, $proto) or return "error: socket: $!";
28 connect($socket, sockaddr_in($port, inet_aton($server))) or return "error: connect: $!";
34 if ($@ && $@ ne "alarm\n") { # failed.
38 $socket->autoflush(1); # required.
58 my @now = &kernelGetInfo();
60 &::msg($::who, "failed.");
70 my $file = "$::param{tempDir}/kernel.txt";
71 my @now = &kernelGetInfo();
75 &::DEBUG("kA: failure to retrieve.");
97 for(my $i=0; $i<scalar(@old); $i++) {
98 next if ($old[$i] eq $now[$i]);
102 if (scalar @now != scalar @old) {
103 &::DEBUG("kA: scalar mismatch; removing and exiting.");
109 &::DEBUG("kA: no new kernels.");