From 9b1786142536567237a9af6f8cca2d47f7dddaf8 Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Tue, 17 May 2022 02:01:04 -0400 Subject: xlint: make output prefix consistent a few lints used the absolute path (`$template`) as prefix instead of `$argument` Closes: #246 [via git-merge-pr] --- xlint | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/xlint b/xlint index 9148fa5..f5e288a 100755 --- a/xlint +++ b/xlint @@ -41,8 +41,8 @@ exists_once() { } explain_make_check() { - awk "-vtemplate=$template" -vOFS=: ' - /make_check=[^#]*$/ && prev !~ /^[[:blank:]]*#/ {print(template, FNR, " explain why the tests fail")} + awk "-vargument=$argument" -vOFS=: ' + /make_check=[^#]*$/ && prev !~ /^[[:blank:]]*#/ {print(argument, FNR, " explain why the tests fail")} {prev=$0} ' $template } @@ -136,9 +136,9 @@ variables_order() { file_end() { if [ "$(tail -c 1 $template)" ]; then - echo "$template:$(( $(wc -l < $template) + 1 )): File does not end with newline character" + echo "$argument:$(( $(wc -l < $template) + 1 )): File does not end with newline character" elif [ -z "$(tail -c 2 $template)" ]; then - echo "$template:$(wc -l < $template): Last line is empty" + echo "$argument:$(wc -l < $template): Last line is empty" fi } @@ -377,9 +377,10 @@ for argument; do if [ -f "$argument" ]; then template="$argument" elif [ "${argument#:}" != "$argument" ]; then + argument="${argument#:}" trap "rm -- ${tmpfile:=$(mktemp)}" EXIT INT TERM # get template as staged in the git index - git -C "$void_packages" show ":srcpkgs/${argument#:}/template" \ + git -C "$void_packages" show ":srcpkgs/$argument/template" \ > ${template:=$tmpfile} || continue else _template="${void_packages}srcpkgs/$argument/template" -- cgit 1.4.1