File: rebuild

package info (click to toggle)
perl-tk 1:800.025-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 18,444 kB
  • ctags: 19,081
  • sloc: ansic: 206,740; perl: 40,187; makefile: 4,371; sh: 2,373; yacc: 762
file content (33 lines) | stat: -rwxr-xr-x 677 bytes parent folder | download | duplicates (3)
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
#!/usr/local/bin/new/perl -w
open(STDERR,">&STDOUT") || die "Cannot redirect STDERR";
$| = 1;
use Cwd;
my $host = `uname -n`;
chomp($host);
my $cwd = getcwd();
print "$host in $cwd executing $0\n";
print $ENV{'PATH'},"\n";
#System("make",'-f','Makefile.old',"clean") if -f "Makefile.old";
#System("make","clean") if -f "Makefile";
System("cleanup"); 
System("$^X","Makefile.PL");
System("time","make","parallel"); 

sub System
{
 print join(' ',@_),"\n";
 my $pid = fork;
 if ($pid)
  {
   local %SIG;
   $SIG{INT} = sub { warn "\nInterrupt"; kill 9,$pid; exit 1 };
   wait;
   die "Error $?" if ($?);
  }
 else
  {
   exec(@_) || die "Cannot exec".join(' ',@_).":$!";
  }
}