From ea5b147b305165bf0eb792d4fed99b27aaf9e05c Mon Sep 17 00:00:00 2001 From: Gavin Chou Date: Wed, 26 Jun 2019 00:37:11 +0800 Subject: [PATCH] Remove GNU sed prerequisite --- README.md | 1 - build_call_graph.sh | 10 +++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index dee4f8d..0bfda2d 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,6 @@ will be faded away. 0. dot - graphviz version 2.41.20190308.1641 (20190308.1641) * new versions should work, if not I will fix it * lower versions may work, but not tested yet, I am lazy... -1. GNU sed, if you don't have one, modify the build script to fit the purpose ### usage diff --git a/build_call_graph.sh b/build_call_graph.sh index a5ff824..4ca77a7 100755 --- a/build_call_graph.sh +++ b/build_call_graph.sh @@ -44,8 +44,16 @@ else fi # echo ${out} +which dot > /dev/null +if [ $? -ne 0 ]; then + echo "no graphviz dot found" + exit -1 +fi dot -Tsvg -o ${out} ${src} > /dev/null -sed -ri 's###' ${out} + +sed -i.bak 's###' ${out} +rm -f ${out}.bak + cat "${attach}" >> ${out} echo "" >> ${out}