diff options
author | bill-auger <mr.j.spam.me@gmail.com> | 2022-01-24 06:00:18 -0500 |
---|---|---|
committer | bill-auger <mr.j.spam.me@gmail.com> | 2024-03-28 23:11:45 -0400 |
commit | 497c26d8841bcb38fba1e619f826bfefb3a25003 (patch) | |
tree | dc04fc624c771f8fda402402d7a8a9a0637384ac /src | |
parent | cd5375272d70e3eddc5d686bff02fb6ca7796607 (diff) |
pbot announce - ignore empty pushes (nothing staged)
Diffstat (limited to 'src')
-rwxr-xr-x | src/abslibre-tools/librerelease | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/abslibre-tools/librerelease b/src/abslibre-tools/librerelease index e1261f3..cbb1b67 100755 --- a/src/abslibre-tools/librerelease +++ b/src/abslibre-tools/librerelease @@ -299,12 +299,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="if type pbot-say &>/dev/null; then pbot-say ${login} just published: ${packages}; fi" - 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="if type pbot-say &>/dev/null ; then pbot-say %s just published: %s ; fi" + + 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 } |