]> rtime.felk.cvut.cz Git - socketcan-devel.git/blobdiff - mkpatch
The two options "CAN bit-timing calculation" and
[socketcan-devel.git] / mkpatch
diff --git a/mkpatch b/mkpatch
index a6fbc70456d9035bbaa0449e4ca5924cb41893c5..c75cc85d3ebb4f146db6c27d929d9ebed1dd44f9 100755 (executable)
--- a/mkpatch
+++ b/mkpatch
@@ -5,10 +5,14 @@
 # Generate a kernel patch to add socketcan to a kernel src tree.
 # The list of files to be added is read from stdin.
 
+use POSIX qw(strftime);
+
 $version = shift;
 
 if (-r "patches/$version.diff") {
     copy_file("patches/$version.diff");
+} else {
+    die "Patch patches/$version.diff not found";
 }
 
 while (<>) {
@@ -26,8 +30,6 @@ while (<>) {
     add_file($file, $name);
 }
 
-close FILES;
-
 sub copy_file {
     my ($file) = @_;
 
@@ -40,13 +42,13 @@ sub copy_file {
 
 sub add_file {
     my ($file, $name) = @_;
-    my (@lines, $count, $ts, $mtime);
+    my (@lines, $count, $ts);
 
-    open file, "./kv $version $file |" || die "open $file\n";
+    open file, "./strip-src -i -m -v $version $file |" || die "open $file\n";
     @lines = <file>;
+    close file;
+
     $count = $#lines + 1;
-    use POSIX qw(strftime);
-    $mtime = (stat($file))[9];
     $ts = strftime "%F %T", gmtime((stat($file))[9]);
 
     print "--- a/$name 1970-01-01 00:00:00\n";
@@ -55,5 +57,4 @@ sub add_file {
     for (@lines) {
        print "+$_";
     }
-    close file;
 }