about summary refs log tree commit diff
path: root/xlint
diff options
context:
space:
mode:
authorÉrico Rolim <erico.erc@gmail.com>2020-07-23 20:46:41 -0300
committerLeah Neukirchen <leah@vuxu.org>2020-07-25 18:15:33 +0200
commit8f1f1fee5e85361f7400e535d83dfd2c2d229d4d (patch)
treea88b5f7fb13fcc6481881dceb7ce7cc34e9e9485 /xlint
parent14acc532dc288c1d63e2199dabbb23b40a5f81bc (diff)
downloadxtools-8f1f1fee5e85361f7400e535d83dfd2c2d229d4d.tar.gz
xtools-8f1f1fee5e85361f7400e535d83dfd2c2d229d4d.tar.xz
xtools-8f1f1fee5e85361f7400e535d83dfd2c2d229d4d.zip
xlint: accept pkgname as well as path to template. v0.60
Makes it possible to call xlint as: `xlint 0ad`.
Diffstat (limited to 'xlint')
-rwxr-xr-xxlint15
1 files changed, 12 insertions, 3 deletions
diff --git a/xlint b/xlint
index af910ba..788976e 100755
--- a/xlint
+++ b/xlint
@@ -247,9 +247,18 @@ wrksrc
 xml_catalogs
 xml_entries" | tr '\n' '|')
 
+void_packages="$(xdistdir)/"
 ret=0
-for template; do
-	if [ -f "$template" ]; then
+for argument; do
+	template=
+	if [ -f "$argument" ]; then
+		template="$argument"
+	else
+		_template="${void_packages}srcpkgs/$argument/template"
+		[ -f "$_template" ] && template="$_template"
+	fi
+
+	if [ "$template" ]; then
 	exists_once "$template"
 	scan 'short_desc=.*\."' "unwanted trailing dot in short_desc"
 	scan 'short_desc=["'\''][a-z]' "short_desc should start uppercase"
@@ -336,7 +345,7 @@ for template; do
 	header
 	file_end
 	else
-	echo no such template "$template" 1>&2
+	echo no such template "$argument" 1>&2
 	fi | sort -t: -n -k2 | grep . && ret=1
 done
 exit $ret