]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
dropped_commits.sh: fix awk compatibility
authorSasha Levin <sashal@kernel.org>
Fri, 20 Dec 2024 14:37:25 +0000 (09:37 -0500)
committerSasha Levin <sashal@kernel.org>
Fri, 20 Dec 2024 14:37:25 +0000 (09:37 -0500)
Signed-off-by: Sasha Levin <sashal@kernel.org>
scripts/dropped_commits.sh

index 9b9e7f8a23fc0b28bc0c5e2e07db2950fe683e16..777c5e05649ad8bcaa8b07f0fd73254202b99642 100755 (executable)
@@ -8,16 +8,16 @@ extract_sha1() {
     local content="$1"
     # Skip everything until the first blank line (end of commit metadata)
     # Then look for first 40-character hex string
-    awk '
+    echo "$content" | awk '
         BEGIN { found_blank = 0 }
         /^$/ { found_blank = 1; next }
         found_blank == 1 {
-            if (match($0, /[0-9a-f]{40}/, m)) {
-                print m[0]
+            if (match($0, /[0-9a-f]{40}/)) {
+                print substr($0, RSTART, RLENGTH)
                 exit
             }
         }
-    ' <<< "$content" || echo "NO_SHA"
+    ' || echo "NO_SHA"
 }
 
 # Function to check if a file was moved rather than deleted