]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
check-format-commit.sh: make awk patterns more robust for MacOS and certain flavors...
authorDr. David von Oheimb <dev@ddvo.net>
Thu, 10 Oct 2024 20:13:42 +0000 (22:13 +0200)
committerDr. David von Oheimb <dev@ddvo.net>
Sat, 26 Oct 2024 16:52:57 +0000 (18:52 +0200)
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/25666)

util/check-format-commit.sh

index cf958923fa0d76aac181c2c3f12ead7506676567..d80fb19a0401d4ec4af022ddbb35ecd195c86090 100755 (executable)
@@ -72,14 +72,14 @@ fi
 touch $TEMPDIR/ranges.txt
 git diff -U0 $COMMIT_RANGE | awk '
     BEGIN {myfile=""} 
-    /+{3}/ {
-        gsub(/b\//,"",$2);
+    /^\+\+\+/ {
+        sub(/^b./,"",$2);
         myfile=$2
     }
-    /@@/ {
-        gsub(/+/,"",$3);
+    /^@@/ {
+        sub(/^\+/,"",$3);
         printf myfile " " $3 "\n"
-    }' >> $TEMPDIR/ranges.txt || true
+    }' > $TEMPDIR/ranges.txt || true
 
 # filter in anything that matches on a filter regex
 for i in ${FILE_ALLOWLIST[@]}