#!/usr/bin/perl -w # checkdiff.pl -- 2.5-dj kernel patch checker. # # I'm stupid. # This script sanity checks diffs before I put them out, so # that hch doesn't have to remind me I goofed. use strict; foreach (@ARGV) { process ($_) or warn "Couldn't check file $_: $!"; } sub process { my $filename=shift; open INPUT, $filename or return undef; my @lines=; close INPUT; chomp @lines; my $linenr=0; foreach my $line (@lines) { $linenr++; if ($line=~/davej/ and $line=~/\$Id:/) { print "Found davej CVS damage at line $linenr\n$line\n\n"; } # We are adding a line, check its not obsolete. if ($line=~/^\+/) { if ($line=~/iorequest_lock/) { print "Adding code to frob iorequest_lock at line $linenr\n$line\n\n"; } if ($line=~/[ ]MAJOR[ (]/) { print "Adding code to frob MAJOR at line $linenr\n$line\n\n"; } if ($line=~/[ ]MINOR[ (]/) { print "Adding code to frob MINOR at line $linenr\n$line\n\n"; } if ($line=~/[ ]MKDEV[ (]/) { print "Adding code to frob MKDEV at line $linenr\n$line\n\n"; } if ($line=~/get_fast_time/) { print "Adding get_fast_time at line $linenr\n$line\n\n"; } if ($line=~/BLKRAGET/) { print "Adding BLKRAGET at line $linenr\n$line\n\n"; } if ($line=~/BLKRASET/) { print "Adding BLKRASET at line $linenr\n$line\n\n"; } } } return 1; }