From 8f1f1fee5e85361f7400e535d83dfd2c2d229d4d Mon Sep 17 00:00:00 2001 From: Érico Rolim Date: Thu, 23 Jul 2020 20:46:41 -0300 Subject: xlint: accept pkgname as well as path to template. Makes it possible to call xlint as: `xlint 0ad`. --- xlint | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'xlint') 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 -- cgit 1.4.1