summaryrefslogtreecommitdiff
path: root/util/lint
diff options
context:
space:
mode:
Diffstat (limited to 'util/lint')
-rwxr-xr-xutil/lint/lint-000-license-headers20
1 files changed, 18 insertions, 2 deletions
diff --git a/util/lint/lint-000-license-headers b/util/lint/lint-000-license-headers
index ad764b8e9b..884875ec29 100755
--- a/util/lint/lint-000-license-headers
+++ b/util/lint/lint-000-license-headers
@@ -58,11 +58,27 @@ headerlist=$(git ls-files $HEADER_DIRS | egrep -v "($HEADER_EXCLUDED)")
#update headerlist by removing files that match the license string
check_for_license() {
- headerlist=$(grep -iL "$1" $headerlist 2>/dev/null)
+ if [ -z "$2" ]; then
+ headerlist="$(grep -iL "$1" $headerlist 2>/dev/null)"
+ else
+ local p1list="$(grep -il "$1" $headerlist 2>/dev/null)"
+ local p2list="$(grep -il "$2" $headerlist 2>/dev/null)"
+
+ # Make list of files that were in both previous lists
+ local pbothlist="$(echo $p1list $p2list | tr ' ' "\n" | \
+ sort | uniq -d)"
+
+ # Remove all files that were in both of the previous lists
+ # Note that this is unstable if we ever get any filenames
+ # with spaces.
+ headerlist="$(echo $headerlist $pbothlist | tr ' ' "\n" | \
+ sort | uniq -u)"
+ fi
}
#search the files for license headers
-check_for_license "GNU General Public License"
+check_for_license "under the terms of the GNU General Public License" \
+ "WITHOUT ANY WARRANTY"
check_for_license 'IS PROVIDED .*"AS IS"'
check_for_license "IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE"
check_for_license '"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES'