Issue end-of-hunk and end-of-file marks at the end of patches.
authorlxoliva <lxoliva@559672b5-ba27-0410-b829-e8f1faed8b1b>
Tue, 23 Feb 2010 22:43:46 +0000 (22:43 +0000)
committerlxoliva <lxoliva@559672b5-ba27-0410-b829-e8f1faed8b1b>
Tue, 23 Feb 2010 22:43:46 +0000 (22:43 +0000)
git-svn-id: http://www.fsfla.org/svn/fsfla/software/linux-libre/scripts@6582 559672b5-ba27-0410-b829-e8f1faed8b1b

deblob-check

index 066d2794cbcb55f3bc84ac198c7322690e430206..2ad24eb185ece2c95cff07429c8e975a0b0bd596 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# deblob-check version 2010-02-23
+# deblob-check version 2010-02-23a
 # Inspired in gNewSense's find-firmware script.
 # Written by Alexandre Oliva <lxoliva@fsfla.org>
 
@@ -4400,7 +4400,7 @@ BAD regular expression:
       s=+ r=-
     fi
     sedpatch="
-      /^[$r]/d;
+      /^[$r]/b testlastline;
       # /^[*!]/ {
       #        s,^,context diffs are not properly supported\\n,;
       #        W /dev/stderr
@@ -4453,7 +4453,31 @@ BAD regular expression:
        p;
        d;
       }
-      s,^[ !$s],,;"
+      s,^[ !$s],,
+      p;
+      :testlastline
+      $ {
+       x;
+       /^@@ /{
+         s,^,;/*end ,;
+         s,\\([\\n]\\|$\\),*/;&,;
+         i\\
+;/**/;
+
+         P;
+         s,^[^\\n]*\\([\\n]\\|$\\),,;
+       }
+       /^$s$s$s /{
+         s,^$s$s$s,;/*end,;
+         s,\\([\\n]\\|$\\),*/;&,;
+         i\\
+
+         P;
+         s,^[^\\n]*\\([\\n]\\|$\\),,;
+       }
+       x;
+      }
+      d;"
     cmd='${SED-sed} "$sedpatch"'
     ;;
   *)