aboutsummaryrefslogtreecommitdiff
path: root/sbopkglint
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2022-04-14 15:22:22 -0400
committerB. Watson <yalhcru@gmail.com>2022-04-14 15:22:22 -0400
commitfb71eec28c092e3c0be866fe52cb89d2c06d9ba8 (patch)
tree9be920a884197a3bafd05776ae2b3ef7759eb12b /sbopkglint
parenta800d01375d989cefd56011467d26d51815ba2dc (diff)
downloadsbo-maintainer-tools-fb71eec28c092e3c0be866fe52cb89d2c06d9ba8.tar.gz
make it easier to run sbopkglint without installing it
Diffstat (limited to 'sbopkglint')
-rwxr-xr-xsbopkglint16
1 files changed, 14 insertions, 2 deletions
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 \