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, 6 insertions, 2 deletions
diff --git a/xlint b/xlint
index a3eef1a..5cacbc9 100755
--- a/xlint
+++ b/xlint
@@ -1,6 +1,8 @@
 #!/bin/sh
 # xlint TEMPLATE - scan XBPS template for common mistakes
 
+export LC_ALL=C
+
 scan() {
 	local rx="$1" msg="$2"
 	grep -P -Hn -e "$rx" "$template" |
@@ -90,7 +92,7 @@ xml_entries" | tr '\n' '|')
 
 ret=0
 for template; do
-	{
+	if [ -f "$template" ]; then
 	scan 'short_desc=.*\."' "unwanted trailing dot in short_desc"
 	scan 'short_desc=["'\''][a-z]' "short_desc should start uppercase"
 	scan 'short_desc=["'\''].{72}' "short_desc should be less than 72 chars"
@@ -121,6 +123,8 @@ for template; do
 	scan 'distfiles=.*ftp\.mozilla\.org' 'use $MOZILLA_SITE'
 	scan 'distfiles=.*ftp\.gnu\.org/(pub/)?gnu' 'use $GNU_SITE'
 	scan 'distfiles=.*freedesktop\.org/software' 'use $FREEDESKTOP_SITE'
-	} | sort -t: -n -k2 | grep . && ret=1
+	else
+	echo no such template "$template" 1>&2
+	fi | sort -t: -n -k2 | grep . && ret=1
 done
 exit $ret