about summary refs log tree commit diff
path: root/xlint
diff options
context:
space:
mode:
Diffstat (limited to 'xlint')
-rwxr-xr-xxlint8
1 files changed, 8 insertions, 0 deletions
diff --git a/xlint b/xlint
index ff40424..d083ff9 100755
--- a/xlint
+++ b/xlint
@@ -13,6 +13,12 @@ once() {
 	head -n 1
 }
 
+header() {
+	if [ "$(head -n1 "$template")" != "# Template file for '$pkgname'" ]; then
+		echo "$template:1: Header should be: # Template file for '$pkgname'"
+	fi
+}
+
 variables=$(echo -n "#.*
 _.*
 .*_descr
@@ -190,8 +196,10 @@ for template; do
 	scan '^\t*[^ ]*  *\(\)' 'do not use space before function parenthesis'
 	scan '^\t*[^ ]*\(\)(|   *){' 'use one space after function parenthesis'
 	scan '^\t*[^ ]*\(\)$' 'do not use a newline before function opening brace'
+	pkgname=$(grep -Po "^pkgname=\K.*" "$template")
 	version=$(grep -Po "^version=\K.*" "$template")
 	scan "distfiles=.*\Q$version\E" 'use ${version} in distfiles instead'
+	header
 	else
 	echo no such template "$template" 1>&2
 	fi | sort -t: -n -k2 | grep . && ret=1