Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-05-04 09:44:32 +0200
committerErich Eckner <git@eckner.net>2018-05-04 09:44:32 +0200
commit567e716c8696754f4b3323f962a616e9be12115d (patch)
tree876eb22b3914ec4735d4ccf834bbf3f47c312401 /lib
parent0bc88d347f7d5f3b4fc51e277c3e0489d34dfe04 (diff)
lib/common-functions: irc_say: accept channel as parameter
Diffstat (limited to 'lib')
-rwxr-xr-xlib/common-functions16
-rwxr-xr-xlib/mysql-functions1
2 files changed, 13 insertions, 4 deletions
diff --git a/lib/common-functions b/lib/common-functions
index 038af38..86b8aaa 100755
--- a/lib/common-functions
+++ b/lib/common-functions
@@ -921,10 +921,18 @@ extract_pkgname_epoch_pkgver_pkgrel_sub_pkgrel_arch_from_package_name() {
fi
}
-# irc_say
-# say content of stdin in irc channel
+# irc_say $channel
+# say content of stdin in irc channel $channel (default: #archlinux32)
+
+# shellcheck disable=SC2120
irc_say() {
- if [ -p "${irc_dir}/#archlinux32/in" ]; then
- sponge "${irc_dir}/#archlinux32/in"
+ local channel
+ if [ -z "$1" ]; then
+ channel='#archlinux32'
+ else
+ channel="$1"
+ fi
+ if [ -p "${irc_dir}/${channel}/in" ]; then
+ sponge "${irc_dir}/${channel}/in"
fi
}
diff --git a/lib/mysql-functions b/lib/mysql-functions
index 83b9296..40c91be 100755
--- a/lib/mysql-functions
+++ b/lib/mysql-functions
@@ -64,6 +64,7 @@ mysql_run_query() {
>&2 printf 'I could not complete a mysql query!\n'
if [ ! -s "${work_dir}/build-master-sanity" ] && \
[ -z "${file_name_extra}" ]; then
+ # shellcheck disable=SC2119
printf '\001ACTION failed to execute a mysql query - can you have a look at "%s"?.\001\n' \
"${query_stdin##*/}" \
| irc_say