]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#4483] fixed script
authorRazvan Becheriu <razvan@isc.org>
Fri, 22 May 2026 11:19:47 +0000 (14:19 +0300)
committerRazvan Becheriu <razvan@isc.org>
Fri, 22 May 2026 13:15:04 +0000 (13:15 +0000)
tools/valgrind_generate_suppression_file.sh

index 543ec9fccadfd71dcb4146397a580f8d0f8c0c1c..bc30f730fa2932251d457feeaeb8ebaec30fdad4 100755 (executable)
@@ -83,8 +83,12 @@ for i in $(find build -type f -name '*txt.supp-part.*'); do
     else
         # extract the binary path and name
         found_in_path=$(grep " # detected in " "$i" || true)
-        # update comment with binary path and name if hash not present
-        sed -i "s|valgrind_hash_$label|valgrind_hash_$label\n$found_in_path|g" build/valgrind_suppression.supp
+        # check if comment is present
+        match=$(grep -c "$found_in_path" build/valgrind_suppression.supp || true)
+        if [ "$match" -eq 0 ]; then
+            # update comment with binary path and name if hash is present
+            sed -i "s|valgrind_hash_$label|valgrind_hash_$label\n$found_in_path|g" build/valgrind_suppression.supp
+        fi
     fi
 done
 csplit -s -z -f build/valgrind_suppression.supp.part. build/valgrind_suppression.supp '/{/' '{*}'