diff options
author | B. Watson <yalhcru@gmail.com> | 2022-04-14 15:22:22 -0400 |
---|---|---|
committer | B. Watson <yalhcru@gmail.com> | 2022-04-14 15:22:22 -0400 |
commit | fb71eec28c092e3c0be866fe52cb89d2c06d9ba8 (patch) | |
tree | 9be920a884197a3bafd05776ae2b3ef7759eb12b /sbopkglint | |
parent | a800d01375d989cefd56011467d26d51815ba2dc (diff) | |
download | sbo-maintainer-tools-fb71eec28c092e3c0be866fe52cb89d2c06d9ba8.tar.gz |
make it easier to run sbopkglint without installing it
Diffstat (limited to 'sbopkglint')
-rwxr-xr-x | sbopkglint | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -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 \ |