Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/nit-picker32
1 files changed, 22 insertions, 10 deletions
diff --git a/bin/nit-picker b/bin/nit-picker
index 15d1204..452fcee 100755
--- a/bin/nit-picker
+++ b/bin/nit-picker
@@ -81,12 +81,24 @@ if ${irc}; then
while [ ! -f "${irc_dir}/#archlinux32/out" ]; do
sleep 1
done
-else
- irc_say() {
- sed 's/^/irc: /'
- }
+
fi
+# shellcheck disable=SC2120
+local_irc_say() {
+ if ${irc}; then
+ if printf 'SHOW STATUS LIKE "Slave_running"' | mysql_run_query | cut -f2 | grep -qxF 'ON'; then
+ irc_say "$@"
+ else
+ printf 'The replication slave is not running.\n' \
+ | irc_say 'deep42thought'
+ irc_say 'deep42thought'
+ fi
+ else
+ sed 's/^/irc: /'
+ fi
+}
+
mysql_load_min_and_max_versions
build_duration_check=0
@@ -186,7 +198,7 @@ while pgrep -x ii >/dev/null \
printf 'commit %s is missing from repository %s\n' \
"${git_rev}" \
"${git_repo}" \
- | irc_say
+ | local_irc_say
fi
fi
# shellcheck disable=SC2154
@@ -198,7 +210,7 @@ while pgrep -x ii >/dev/null \
printf 'commit %s is missing from repository %s\n' \
"${git_head}" \
"${git_repo}" \
- | irc_say
+ | local_irc_say
fi
fi
# shellcheck disable=SC2154
@@ -224,7 +236,7 @@ while pgrep -x ii >/dev/null \
"${git_rev}" \
"${current_git_head}" \
"${git_repo}" \
- | irc_say
+ | local_irc_say
fi
fi
fi
@@ -295,7 +307,7 @@ while pgrep -x ii >/dev/null \
printf 'dependencies of %s (built on %s) differ between the package and our database\n' \
"${parameters}" \
"${build_date}" \
- | irc_say
+ | local_irc_say
if ! ${irc}; then
diff -u --color "${tmp_dir}/db-deps" "${tmp_dir}/pkg-deps" || true
fi
@@ -374,7 +386,7 @@ while pgrep -x ii >/dev/null \
fi
if [ -n "${error_message}" ]; then
printf '%s\n' "${error_message}" \
- | irc_say
+ | local_irc_say
if [ $# -eq 0 ]; then
sleep 60
fi
@@ -432,7 +444,7 @@ while pgrep -x ii >/dev/null \
date -d"@${infos##* }" +'%-j %H:%M:%S'
)" \
| awk '{print $1 ": your slave " $2 " builds " $3 "/" $4 " for more than a day, now (" ($5-1) " day(s) " $6 ")"}' \
- | irc_say
+ | local_irc_say
if [ $# -eq 0 ]; then
sleep 60
fi