summaryrefslogtreecommitdiff
path: root/lib/mysql-functions
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2021-06-05 20:26:21 +0200
committerErich Eckner <git@eckner.net>2021-06-05 20:26:21 +0200
commit6f59df0faa06e9e5b2127d8376b12bb1cf2db5fd (patch)
treeb380377a92c28beb05b8b249905b684fe4a7cd9e /lib/mysql-functions
parent8e9130a9d21a2d73f8c354e2a3f1d9ccc6f7ea73 (diff)
downloadbuilder-6f59df0faa06e9e5b2127d8376b12bb1cf2db5fd.tar.xz
make shellcheck happy again
Diffstat (limited to 'lib/mysql-functions')
-rwxr-xr-xlib/mysql-functions13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/mysql-functions b/lib/mysql-functions
index 6a6a1e7..af2c3ba 100755
--- a/lib/mysql-functions
+++ b/lib/mysql-functions
@@ -2,7 +2,7 @@
# contains functions used to access mysql db
-# shellcheck disable=SC2016,SC2039,SC2119,SC2120
+# shellcheck disable=SC2016,SC2039,SC2119,SC2120,SC3043
if [ -z "${base_dir}" ]; then
# just to make shellcheck happy
@@ -35,7 +35,7 @@ mysql_run_query() {
local number
file_name_extra=''
- if [ "x$1" = 'xunimportant' ]; then
+ if [ "$1" = 'unimportant' ]; then
shift
file_name_extra='unimportant_'
elif [ -s "${work_dir}/build-master-sanity" ]; then
@@ -47,7 +47,7 @@ mysql_run_query() {
query_stdout="${query_stdin%.stdin}.stdout"
query_stderr="${query_stdin%.stdin}.stderr"
cat > "${query_stdin}"
- for _ in {1..10}; do
+ for _ in $(seq 10); do
if [ -f "${query_stdout}" ]; then
wait_some_time 10 10
fi
@@ -221,7 +221,8 @@ mysql_generate_package_metadata() {
mod_git_revision="$4"
repository="$5"
- if [[ "${current_repository_id}" = *[!0-9]* ]]; then
+ if printf '%s\n' "${current_repository_id}" \
+ | grep -q '[^0-9]'; then
>&2 printf 'mysql_generate_package_metadata(): invalid current_repository_id="%s".\n' \
"${current_repository_id}"
exit 2
@@ -898,7 +899,7 @@ mysql_cleanup() {
local operator
if [ "$#" = '0' ]; then
operator='DELETE'
- elif [ "$#" = '1' ] && [ "x$1" = 'xdry' ]; then
+ elif [ "$#" = '1' ] && [ "$1" = 'dry' ]; then
operator='SELECT COUNT(1)'
else
>&2 echo 'Unknown parameter'
@@ -1558,7 +1559,7 @@ mysql_sort_versions() {
( # new shell is intentional
tmp_file=$(mktemp 'tmp.mysql_sort_versions.XXXXXXXXXX' --tmpdir)
trap 'rm "${tmp_file}"' EXIT
- if [ "x$1" != 'x-f' ] && \
+ if [ "$1" != '-f' ] && \
{
printf 'SELECT'
printf ' COUNT(1)'