summaryrefslogtreecommitdiff
path: root/checkpatch.pl (plain)
blob: a5b6cf646a6de1eee0805885fdf6a97cba573d97
1#!/usr/bin/perl -w
2
3use File::Spec;
4my $path_curf = File::Spec->rel2abs(__FILE__);
5my ($vol, $dirs, $file) = File::Spec->splitpath($path_curf);
6print "C Dir = ", $dirs,"\n";
7
8my $name;
9my $dpath;
10$name = `whoami`;
11chomp $name;
12
13use POSIX;
14my $time=strftime("%Y%m%d_%H%M%S",localtime());
15$ddir = "/tmp/".$name;
16$output = `mkdir $ddir`;
17$dpath = "$ddir"."/".$time.".diff";
18print "dpath:", $dpath, "\n";
19
20my $FILE;
21my $FILE_O;
22open($FILE, '<&STDIN');
23open ($FILE_O,">",$dpath);
24while (<$FILE>) {
25 chomp;
26 my $line = $_;
27 print $FILE_O "$line";
28 print $FILE_O "\n";
29}
30close $FILE;
31close $FILE_O;
32
33system("python $dirs/check_patch.py $dpath");
34$exitcode = $?;
35system("rm $dpath");
36if($exitcode == 0)
37{
38 exit 0;
39}
40else
41{
42 exit 1;
43}
44
45
46