summaryrefslogtreecommitdiffstats
path: root/third_party/heimdal/tools/fixgcov-source-paths.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 17:47:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 17:47:29 +0000
commit4f5791ebd03eaec1c7da0865a383175b05102712 (patch)
tree8ce7b00f7a76baa386372422adebbe64510812d4 /third_party/heimdal/tools/fixgcov-source-paths.sh
parentInitial commit. (diff)
downloadsamba-4f5791ebd03eaec1c7da0865a383175b05102712.tar.xz
samba-4f5791ebd03eaec1c7da0865a383175b05102712.zip
Adding upstream version 2:4.17.12+dfsg.upstream/2%4.17.12+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/heimdal/tools/fixgcov-source-paths.sh')
-rwxr-xr-xthird_party/heimdal/tools/fixgcov-source-paths.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/third_party/heimdal/tools/fixgcov-source-paths.sh b/third_party/heimdal/tools/fixgcov-source-paths.sh
new file mode 100755
index 0000000..eaa9c9c
--- /dev/null
+++ b/third_party/heimdal/tools/fixgcov-source-paths.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+find ${1:-.} -name '*.gcov' -print | while read f; do
+ case "$f" in
+ */.libs/*) continue;;
+ *) true;;
+ esac
+ echo FIX $f
+ f_basename=${f%%.gcno\#\#*}.c
+ f_basename=${f_basename##*/}
+ head -1 "$f" | grep 'Source:/' > /dev/null && continue
+ #bname=$(head -1 "$f" | grep 'Source:/' | cut -d: -f4)
+ dname=$(echo "$f"|cut -d'#' -f1|sed -e 's,/[^/]*$,/,')
+ ex "$f" <<EOF
+1,1 s,:Source:.*$,:Source:${dname}${f_basename},
+wq!
+EOF
+done