From 6f59df0faa06e9e5b2127d8376b12bb1cf2db5fd Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Sat, 5 Jun 2021 20:26:21 +0200 Subject: make shellcheck happy again --- bin/bootstrap-mysql | 2 +- bin/build-packages | 7 ++++--- bin/change-git-remotes | 2 +- bin/check-opcodes | 2 +- bin/clean-cache | 2 +- bin/clean-dependencies | 2 +- bin/db-update | 2 +- bin/delete-packages | 2 ++ bin/interpret-mail | 2 +- bin/slave-build-connect | 6 +++--- 10 files changed, 16 insertions(+), 13 deletions(-) (limited to 'bin') diff --git a/bin/bootstrap-mysql b/bin/bootstrap-mysql index 711f3d1..fbcbc47 100755 --- a/bin/bootstrap-mysql +++ b/bin/bootstrap-mysql @@ -695,7 +695,7 @@ fi printf 'DELIMITER ;\n' - if [ "x$1" != 'x-no-privileges' ]; then + if [ "$1" != '-no-privileges' ]; then printf 'GRANT %s ON %s TO '"'"'buildmaster'"'"'@'"'"'localhost'"'"';\n' \ 'CREATE ROUTINE' 'buildmaster.*' \ 'CREATE TEMPORARY TABLES' 'buildmaster.*' \ diff --git a/bin/build-packages b/bin/build-packages index d73a440..9c5ab03 100755 --- a/bin/build-packages +++ b/bin/build-packages @@ -309,9 +309,10 @@ while [ "${count}" -ne 0 ] && \ if [ "${git_revision##*-}" = 'HEAD' ]; then git_revision=$( repo_name="${git_revision%-*}" - eval repo_path='"${repo_paths__'"${repo_name}"'}"' - if [ -z "${repo_path}" ]; then - >&2 printf 'Unknown git repository "%s".\n' "${repo_name}" + eval l_repo_path='"${repo_paths__'"${repo_name}"'}"' + # shellcheck disable=SC2154 + if [ -z "${l_repo_path}" ]; then + >&2 printf 'Unknown git repository "%s".\n' "${l_repo_name}" exit 2 fi git -C "${repo_path}" rev-parse HEAD diff --git a/bin/change-git-remotes b/bin/change-git-remotes index bc8e3f2..b7f687c 100755 --- a/bin/change-git-remotes +++ b/bin/change-git-remotes @@ -3,7 +3,7 @@ # shellcheck source=../lib/load-configuration . "${0%/*}/../lib/load-configuration" -if [ $# -eq 1 ] && [ "x$1" = 'x-q' ]; then +if [ $# -eq 1 ] && [ "$1" = '-q' ]; then quiet=true elif [ $# -ne 0 ]; then printf 'change-git-remotes [-q]\n' diff --git a/bin/check-opcodes b/bin/check-opcodes index e9f69a2..e8bb807 100755 --- a/bin/check-opcodes +++ b/bin/check-opcodes @@ -90,7 +90,7 @@ shift $((OPTIND-1)) PACKAGE=$1 -if test "x$PACKAGE" = "x"; then +if test "$PACKAGE" = ""; then echo "ERROR: Filename of a package required as argument" >&2 usage exit 1 diff --git a/bin/clean-cache b/bin/clean-cache index 8e6fb3c..21f1370 100755 --- a/bin/clean-cache +++ b/bin/clean-cache @@ -9,7 +9,7 @@ if [ $# -eq 0 ]; then dummynator='sudo' -elif [ $# -eq 1 ] && [ "x$1" = 'x-n' ]; then +elif [ $# -eq 1 ] && [ "$1" = '-n' ]; then dummynator='echo' else >&2 echo 'usage: clean-cache [-n]' diff --git a/bin/clean-dependencies b/bin/clean-dependencies index 82d49b3..63e9a9a 100755 --- a/bin/clean-dependencies +++ b/bin/clean-dependencies @@ -67,7 +67,7 @@ trap 'rm "${deps_file}"' EXIT printf 'INSERT IGNORE INTO `bps`(`bp`)' printf ' SELECT `deps`.`bp`' printf ' FROM `deps`;\n' - if [ $# -eq 1 ] && [ "x$1" = 'x-f' ]; then + if [ $# -eq 1 ] && [ "$1" = '-f' ]; then printf 'DELETE `dependencies`' else printf 'SELECT *' diff --git a/bin/db-update b/bin/db-update index 98d3fb1..88c567d 100755 --- a/bin/db-update +++ b/bin/db-update @@ -181,7 +181,7 @@ if [ -n "${only}" ]; then printf 's@^!%s\\(/.\\+\\)\\?$@' \ "${arch}" for arch2 in i486 i686 pentium4; do - if [ "${arch}" == "${arch2}" ]; then + if [ "${arch}" = "${arch2}" ]; then continue fi printf '%s\\1\\n' \ diff --git a/bin/delete-packages b/bin/delete-packages index a2e932c..2bb3072 100755 --- a/bin/delete-packages +++ b/bin/delete-packages @@ -152,6 +152,7 @@ export TMPDIR="${tmp_dir}" { printf 'CREATE TEMPORARY TABLE `bpir_to_delete` (`id` BIGINT, UNIQUE KEY (`id`));\n' printf 'INSERT IGNORE INTO `bpir_to_delete`' + # shellcheck disable=SC2030 if [ -n "${force_packages}" ]; then printf ' SELECT' printf ' `binary_packages_in_repositories`.`id`' @@ -342,6 +343,7 @@ export TMPDIR="${tmp_dir}" } ' +# shellcheck disable=SC2031 if [ -n "${build_support}" ] && \ [ -w "${build_support}" ] && \ [ ! -p "${build_support}" ]; then diff --git a/bin/interpret-mail b/bin/interpret-mail index 1d6bf7f..2580c00 100755 --- a/bin/interpret-mail +++ b/bin/interpret-mail @@ -1,6 +1,6 @@ #!/bin/sh -# shellcheck disable=SC2119,SC2120 +# shellcheck disable=SC2119,SC2120,SC3043 # shellcheck source=../lib/load-configuration . "${0%/*}/../lib/load-configuration" diff --git a/bin/slave-build-connect b/bin/slave-build-connect index e40dc32..40a227c 100755 --- a/bin/slave-build-connect +++ b/bin/slave-build-connect @@ -5,9 +5,9 @@ # shellcheck source=../lib/load-configuration . "${0%/*}/../lib/load-configuration" -if [ "x${SSH_ORIGINAL_COMMAND%% *}" = 'xget-assignment' ] || \ - [ "x${SSH_ORIGINAL_COMMAND%% *}" = 'xreturn-assignment' ] || \ - [ "x${SSH_ORIGINAL_COMMAND%% *}" = 'xping-from-slave' ]; then +if [ "${SSH_ORIGINAL_COMMAND%% *}" = 'get-assignment' ] || \ + [ "${SSH_ORIGINAL_COMMAND%% *}" = 'return-assignment' ] || \ + [ "${SSH_ORIGINAL_COMMAND%% *}" = 'ping-from-slave' ]; then # small check to prevent some shell-injections if printf '%s\n' "${SSH_ORIGINAL_COMMAND}" | \ -- cgit v1.2.3-70-g09d2