on master help sign in
[fix] make test.sh: fix various shellcheck error messages

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>

commit3e4d022d0425e4f7647573c97f105aa5208e5537 authorMarkus Heiser <markus.heiser@darmarit.de> dateMon 30 Mar 2020, 11:03 (7 years ago) parent5e2b161
5 files changed+12−6
Makefile+1 utils/lib.sh+1 utils/lxc-searx.env+6−3 utils/lxc.sh+3−2 utils/morty.sh+1−1
Makefile+1
@@ -219,6 +219,7 @@ test.pylint: pyenvinstall
219219
220220# ubu1604: uses shellcheck v0.3.7 (from 04/2015), no longer supported!
221221test.sh:
222+ shellcheck -x -s bash utils/brand.env
222223 shellcheck -x utils/lib.sh
223224 shellcheck -x utils/filtron.sh
224225 shellcheck -x utils/searx.sh
utils/lib.sh+1
@@ -1079,6 +1079,7 @@ in_container() {
10791079
10801080LXC_ENV_FOLDER=
10811081if in_container; then
1082+ # shellcheck disable=SC2034
10821083 LXC_ENV_FOLDER="lxc/$(hostname)/"
10831084fi
10841085
utils/lxc-searx.env+6−3
@@ -32,11 +32,13 @@ lxc_set_suite_env() {
3232 export MORTY_LISTEN="0.0.0.0:3000"
3333}
3434
35−lxc_suite_install_info="suite includes searx, morty & filtron"
35+# shellcheck disable=SC2034
36+LXC_SUITE_INSTALL_INFO="suite includes searx, morty & filtron"
3637lxc_suite_install() {
3738 (
3839 lxc_set_suite_env
39− export FORCE_TIMEOUT=0
40+ FORCE_TIMEOUT=0
41+ export FORCE_TIMEOUT
4042 "${LXC_REPO_ROOT}/utils/searx.sh" install all
4143 "${LXC_REPO_ROOT}/utils/morty.sh" install all
4244 "${LXC_REPO_ROOT}/utils/filtron.sh" install all
@@ -50,7 +52,8 @@ lxc_suite_install() {
5052lxc_suite_prepare_buildhost() {
5153 (
5254 lxc_set_suite_env
53− export FORCE_TIMEOUT=0
55+ FORCE_TIMEOUT=0
56+ export FORCE_TIMEOUT
5457 # "${LXC_REPO_ROOT}/utils/searx.sh* install packages
5558 "${LXC_REPO_ROOT}/utils/searx.sh" install buildhost
5659 rst_title "buildhost installation finished ($(hostname))" part
utils/lxc.sh+3−2
@@ -104,7 +104,7 @@ cmd
104104 -- run command '...' in all containers of the LXC suite
105105 :<name>: run command '...' in container <name>
106106install
107− :suite: install LXC suite; ${lxc_suite_install_info}
107+ :suite: install LXC suite; ${LXC_SUITE_INSTALL_INFO}
108108 :base: prepare LXC; install basic packages
109109 :buildhost: prepare LXC; install buildhost packages
110110
@@ -241,13 +241,14 @@ main() {
241241 sudo_or_exit
242242 case $2 in
243243 suite|base|buildhost)
244− lxc_exec "${LXC_REPO_ROOT}/utils/lxc.sh" __install $2
244+ lxc_exec "${LXC_REPO_ROOT}/utils/lxc.sh" __install "$2"
245245 ;;
246246 *) usage "$_usage"; exit 42 ;;
247247 esac
248248 ;;
249249 __install)
250250 # wrapped install commands, called once in each container
251+ # shellcheck disable=SC2119
251252 case $2 in
252253 suite) lxc_suite_install ;;
253254 base) FORCE_TIMEOUT=0 lxc_install_base_packages ;;
utils/morty.sh+1−1
@@ -16,7 +16,7 @@ in_container && lxc_set_suite_env
1616
1717PUBLIC_URL="${PUBLIC_URL:-http://$(uname -n)/searx}"
1818PUBLIC_URL_PATH_MORTY="${PUBLIC_URL_PATH_MORTY:-/morty}"
19−PUBLIC_URL_MORTY="$(echo $PUBLIC_URL | sed -e's,^\(.*://[^/]*\).*,\1,g')${PUBLIC_URL_PATH_MORTY}"
19+PUBLIC_URL_MORTY="$(echo "$PUBLIC_URL" | sed -e's,^\(.*://[^/]*\).*,\1,g')${PUBLIC_URL_PATH_MORTY}"
2020
2121MORTY_LISTEN="${MORTY_LISTEN:-127.0.0.1:3000}"
2222# shellcheck disable=SC2034