summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2022-01-24 06:00:18 -0500
committerbill-auger <mr.j.spam.me@gmail.com>2022-01-28 07:07:28 -0500
commit2aa3f6f497ffc30303a4b290d61b9938aaf459be (patch)
tree3afb90fce3d677347114109d59c66c38ff7be265
parent4c29b9d9e40f534fc9f013b3542193b05de721bc (diff)
pbot announce - ignore empty pushes (nothing staged)
-rwxr-xr-xsrc/abslibre-tools/librerelease19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/abslibre-tools/librerelease b/src/abslibre-tools/librerelease
index c6e98b0..796da81 100755
--- a/src/abslibre-tools/librerelease
+++ b/src/abslibre-tools/librerelease
@@ -298,12 +298,19 @@ release_packages() {
# notify pbot of the excellent work we have done
local login=${REPODEST_userinfo:-somebody} ; login=${login%%:*} ;
- local packages=$(grep -zE '\.pkg\.tar\.[^\.]+$' ${file_list} | \
- grep -zEv '\-debug\-' | \
- sed -z 's|\([^/]*\)/\([^/ ]*\)-[^-]*$|\2(\1) |' | \
- sort -zu | xargs -0 )
- local pbot_say_cmd="which pbot-say && pbot-say ${login} just published: ${packages}"
- ssh ${REPODEST_port:+-p "$REPODEST_port"} "${REPODEST_userhost}" "${pbot_say_cmd}"
+ local select_pkgs='\.pkg\.tar\.[^\.]+$'
+ local reject_pkgs='\-debug\-'
+ local pkgname_rx='s|\([^/]*\)/\([^/ ]*\)-[^-]*$|\2(\1) |'
+ local packages=$(grep -zE "${select_pkgs}" ${file_list} | \
+ grep -zEv "${reject_pkgs}" | \
+ sed -z "${pkgname_rx}" | \
+ sort -zu | xargs -0 )
+ local pbotsay_fmt="which pbot-say && pbot-say %s just published: %s"
+
+ if [[ -n "$(echo ${packages})" ]]; then
+ local pbotsay_cmd="$(printf "${pbotsay_fmt}" "${login}" "${packages}")"
+ ssh ${REPODEST_port:+-p "$REPODEST_port"} "${REPODEST_userhost}" "${pbotsay_cmd}"
+ fi
return $EXIT_SUCCESS
}