From c89f33e882582d098ae9778468aeb7f7327fa442 Mon Sep 17 00:00:00 2001 From: "Peter D. Barnes, Jr" Date: Mon, 29 Apr 2024 13:55:21 -0700 Subject: [PATCH] docs: Restore doxygen.conf when a warnings build has been interrupted. --- doc/doxygen.warnings.report.sh | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/doc/doxygen.warnings.report.sh b/doc/doxygen.warnings.report.sh index c24b837be..45a6c7e13 100755 --- a/doc/doxygen.warnings.report.sh +++ b/doc/doxygen.warnings.report.sh @@ -22,7 +22,7 @@ VERBLOG="$DIR/doxygen.verbose.log" # Options ------------------------------ # -# One line sysnopsis, continue +# One line synopsis, continue function synopsis_short { echo "Usage: $me [-beithv] [-s | -l | -w] [-m ] [-f ] [-F ]" @@ -305,6 +305,12 @@ if [ $skip_doxy -eq 1 ]; then else + # We're going to modify doxygen.conf + # In case the user ^C's out of this we need to restore + # doxygen.conf, otherwise weird things happen. + # function restore_doxygen_conf defined below + trap restore_doxygen_conf INT + # Modify doxygen.conf to generate all the warnings # We keep dot active to generate graphs in the documentation # (see for example PacketTagList) and warn about ill-formed @@ -333,6 +339,14 @@ else DIRECTORY_GRAPH = no EOF + # Swap back to original config + function restore_doxygen_conf() + { + if [ -e $conf.bak ]; then + rm -f $conf + mv -f $conf.bak $conf + fi + } intro_h="introspected-doxygen.h" if [ $skip_intro -eq 1 ]; then @@ -350,17 +364,11 @@ EOF status_report $? "./ns3 run print-introspected-doxygen" fi - # Waf insists on writing cruft to stdout - sed -i.bak -E '/^Waf:/d' doc/$intro_h - rm doc/$intro_h.bak - verbose -n "Rebuilding doxygen docs with full errors" (cd "$ROOT" && ./ns3 docs doxygen-no-build >&6 2>&6 ) status_report $? "./ns3 docs doxygen-no-build" - # Swap back to original config - rm -f $conf - mv -f $conf.bak $conf + restore_doxygen_conf fi # Filter log file