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-08-29 10:30:48 -0400
commit579280e9f3e65d8aa2b105c4067e3f3d6a084552 (patch)
tree25520662ad275e2bb7aba74ee0c6cd7430ca1cb2
parent530617992bab82f209cab922956cde32514cf9ee (diff)
pbot announce - ignore empty pushes (ie: nothing was 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 57eb291..e57be7d 100755
--- a/src/abslibre-tools/librerelease
+++ b/src/abslibre-tools/librerelease
@@ -313,12 +313,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
}