summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2022-01-24 09:39:48 -0500
committerbill-auger <mr.j.spam.me@gmail.com>2022-08-29 10:31:17 -0400
commit029e9d1e3b730e5b897980763358b3e8fd5c7033 (patch)
treedcda73db448f7b4f850a31896161120a9409efaa
parent579280e9f3e65d8aa2b105c4067e3f3d6a084552 (diff)
pbot announce - refactorv20220124
-rwxr-xr-xsrc/abslibre-tools/librerelease36
1 files changed, 24 insertions, 12 deletions
diff --git a/src/abslibre-tools/librerelease b/src/abslibre-tools/librerelease
index e57be7d..f1907b1 100755
--- a/src/abslibre-tools/librerelease
+++ b/src/abslibre-tools/librerelease
@@ -299,9 +299,12 @@ release_packages() {
return $EXIT_SUCCESS
fi
+ local tier0_port="${REPODEST_port:+-p "$REPODEST_port"}"
+ local tier0_host="${REPODEST_userhost}"
+ local dbupdate_cmd="STAGING=${REPODEST_path@Q} DBSCRIPTS_CONFIG=${DBSCRIPTS_CONFIG@Q} db-update"
+
msg "Running db-update on repos"
- # eg: ssh -p 1863 autobuilder@repo.parabola.nu STAGING='staging/' DBSCRIPTS_CONFIG='/etc/dbscripts/config.local.parabola' db-update
- ssh ${REPODEST_port:+-p "$REPODEST_port"} "${REPODEST_userhost}" "STAGING=${REPODEST_path@Q} DBSCRIPTS_CONFIG=${DBSCRIPTS_CONFIG@Q} db-update"
+ ssh ${tier0_port} "${tier0_host}" "${dbupdate_cmd}" # eg: ssh -p 1863 autobuilder@repo.parabola.nu STAGING='staging/' DBSCRIPTS_CONFIG='/etc/dbscripts/config.local.parabola' db-update
if [[ -n $HOOKPOSTRELEASE ]]; then
msg "Running HOOKPOSTRELEASE..."
@@ -313,18 +316,27 @@ release_packages() {
# notify pbot of the excellent work we have done
local login=${REPODEST_userinfo:-somebody} ; login=${login%%:*} ;
- 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 select_pkgs_rx='\.pkg\.tar\.[^\.]+$'
+ local reject_pkgs_rx='-debug-'
+ # (repo ) (pkgname)(pkgver) (arch )
+ local pkgname_rx='s|.*([^/]+)/[^/]+/([^/-]+)-([^/-]+)-[^/-]+-([^/-\.]+)\.[^\.]+$|[\4/\1]/\2-\3|'
local pbotsay_fmt="which pbot-say && pbot-say %s just published: %s"
+ local filename
+ local packages=(
+ $(
+ while read -r -d ''
+ do filename="$REPLY"
+ [[ "${filename}" =~ ${select_pkgs_rx} ]] || continue
+ [[ "${filename}" =~ ${reject_pkgs_rx} ]] && continue || :
+
+ sed -E "${pkgname_rx}" <<<${filename} || :
+ done < ${file_list} | sort -u | xargs || :
+ )
+ )
+ if (( ${#packages[@]} )); then
+ local pbotsay_cmd="$(printf "${pbotsay_fmt}" "${login}" "${packages[@]}")"
- if [[ -n "$(echo ${packages})" ]]; then
- local pbotsay_cmd="$(printf "${pbotsay_fmt}" "${login}" "${packages}")"
- ssh ${REPODEST_port:+-p "$REPODEST_port"} "${REPODEST_userhost}" "${pbotsay_cmd}"
+ ssh ${tier0_port} "${tier0_host}" "${pbotsay_cmd}" &> /dev/null || :
fi
return $EXIT_SUCCESS