Show
Ignore:
Timestamp:
09/20/06 16:23:22 (2 years ago)
Author:
khali
Message:

mkpatch: Turn warnings on (-w), and fix them.
Print a usage message on missing command line parameters.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lm-sensors/trunk/mkpatch/mkpatch.pl

    r4160 r4162  
    1 #!/usr/bin/perl 
     1#!/usr/bin/perl -w 
    22 
    33#    mkpatch - Create patches against the Linux kernel 
     
    12511251 
    12521252 
     1253sub usage 
     1254{ 
     1255  print "Usage: $0 package_root kernel_root\n"; 
     1256  exit 1; 
     1257} 
     1258 
    12531259# Main function 
    12541260sub main 
     
    12571263  my ($diff_command,$dummy,$data0,$data1,$sedscript,$version_string); 
    12581264 
    1259   # --> Read the command-lineo 
     1265  # --> Read the command-line 
    12601266  $package_root = $ARGV[0]; 
     1267  usage() unless defined $package_root; 
    12611268  die "Package root `$package_root' is not found\n" 
    12621269        unless -d "$package_root/mkpatch"; 
    12631270  $kernel_root = $ARGV[1]; 
     1271  usage() unless defined $kernel_root; 
    12641272  die "Kernel root `$kernel_root' is not found\n" 
    12651273        unless -f "$kernel_root/Rules.make"; 
     
    12801288    ($data0,$data1) = /(\S+)\s+(\S+)/; 
    12811289    $includes{$data0} = $data1; 
    1282     $sedscript .= 's,(#\s*include\s*)'.$data0.'(\s*),\1'."$data1".'\2, ; '; 
     1290    $sedscript .= 's,(#\s*include\s*)'.$data0.'(\s*),$1'."$data1".'$2, ; '; 
    12831291  } 
    12841292  close INPUT;