From fb71eec28c092e3c0be866fe52cb89d2c06d9ba8 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Thu, 14 Apr 2022 15:22:22 -0400 Subject: make it easier to run sbopkglint without installing it --- sbopkglint | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'sbopkglint') diff --git a/sbopkglint b/sbopkglint index 970816c..6409fc4 100755 --- a/sbopkglint +++ b/sbopkglint @@ -409,8 +409,20 @@ while true; do esac done -# where the test scripts live, space-separated list. -SBOPKGLINT_PATH=${SBOPKGLINT_PATH:-"./sbopkglint.d /usr/share/sbo-maintainer-tools/sbopkglint.d /usr/local/share/sbo-maintainer-tools/sbopkglint.d"} +# where the test scripts live, space-separated list. to allow for +# running sbopkglint from within its own directory, without installing it, +# check for a sbopkglint.d in the script's dir. +script_dir="$( dirname $( realpath $0 ) )" + +# this line gets modified by 'make install'. +prefix_dir="@PREFIX@" + +case "$prefix_dir" in + @*) ;; # unset, don't use. + *) prefix_script_dir+=" $prefix_dir/share/sbo-maintainer-tools/sbopkglint.d" +esac + +SBOPKGLINT_PATH=${SBOPKGLINT_PATH:-"$script_dir/sbopkglint.d $prefix_script_dir"} if [ "$(id -u)" != "0" ]; then exec sudo \ -- cgit v1.2.3