]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1602] better comments
authorAndrei Pavel <andrei@isc.org>
Wed, 30 Dec 2020 10:31:08 +0000 (12:31 +0200)
committerAndrei Pavel <andrei@isc.org>
Wed, 30 Dec 2020 13:55:05 +0000 (15:55 +0200)
tools/add-config-h.sh
tools/check-for-duplicate-includes.sh

index c6109a6d97bbac3736cc2820146f8eaaa6144d17..cb522c8777e022c9f3d418cceb7840d863c28911 100755 (executable)
@@ -70,7 +70,7 @@ root_path=$(cd "$(dirname "${0}")/.." && pwd)
 
 # Get source files that are missing an '#include <config.h>' line.
 get_source_files() {
-  mandatory_commands cut find grep sed sort uniq
+  mandatory_commands cut find grep sed sort
 
   # Get the files that are missing the include.
   source_files=$(cd "${root_path}" && find . -type f | grep -Fv '.git' | \
index 67a2c595420e80a36ac744445246e685540be73b..05e6c7cc7b599d8bb9f91ebee1c69fab0fb69bf4 100755 (executable)
@@ -50,16 +50,17 @@ while test ${#} -gt 0; do
   esac; shift
 done
 
-# Get source files that have duplicate '#include' lines.
+# Get the source files that have at least one '#include' line minus the
+# generated files.
 get_source_files() {
-  mandatory_commands cut find grep sed sort uniq
+  mandatory_commands cut find grep sed sort
 
-  # Get the files that have duplicate includes.
+  # Get the files that have at least one include line.
   source_files=$(cd "${root_path}" && find . -type f | grep -Fv '.git' | \
     grep -E '\.cc$|\.h$' | xargs grep -El '#include' | \
     cut -d ':' -f 1 | sort -uV)
 
-  # Filter out generated files.
+  # Filter out the generated files.
   for file in ${filtered_out}; do
     source_files=$(printf '%s\n' "${source_files}" | grep -Fv "${file}" | sed '/^$/d')
   done
@@ -102,8 +103,9 @@ root_path=$(cd "$(dirname "${0}")/.." && pwd)
 
 # Generated files will be filtered out. Hardcoded list
 filtered_out=$(cat "${root_path}/tools/.generated-files.txt")
+# Exceptions:
 # src/lib/asiolink/asio_wrapper.h includes <boost/asio.hpp> in both
-# conditionals of an #ifdef. Make an exception for it.
+# conditionals of an #ifdef.
 filtered_out="${filtered_out}
 src/lib/asiolink/asio_wrapper.h
 "