diff options
author | bill-auger <mr.j.spam.me@gmail.com> | 2022-01-24 09:39:48 -0500 |
---|---|---|
committer | bill-auger <mr.j.spam.me@gmail.com> | 2024-03-28 23:11:56 -0400 |
commit | 7e57feb771b9ae25a367ae80763c084924497810 (patch) | |
tree | b6c33172ac327149fa60e369f656b928c71eb2cc /src | |
parent | 497c26d8841bcb38fba1e619f826bfefb3a25003 (diff) |
pbot announce - refactor
Diffstat (limited to 'src')
-rwxr-xr-x | src/abslibre-tools/librerelease | 49 |
1 files changed, 32 insertions, 17 deletions
diff --git a/src/abslibre-tools/librerelease b/src/abslibre-tools/librerelease index cbb1b67..ec168c4 100755 --- a/src/abslibre-tools/librerelease +++ b/src/abslibre-tools/librerelease @@ -2,11 +2,11 @@ # Librerelease # Uploads packages and releases them -# Copyright (C) 2010-2012 Joshua Ismael Haase Hernández (xihh) <hahj87@gmail.com> -# Copyright (C) 2010-2013 Nicolás Reynolds <fauno@parabola.nu> -# Copyright (C) 2013 Michał Masłowski <mtjm@mtjm.eu> -# Copyright (C) 2013-2014, 2017-2018, 2024 Luke Shumaker <lukeshu@parabola.nu> -# Copyright (C) 2019 Bill Auger <mr.j.spam.me@gmail.com> +# Copyright (C) 2010-2012 Joshua Ismael Haase Hernández (xihh) <hahj87@gmail.com> +# Copyright (C) 2010-2013 Nicolás Reynolds <fauno@parabola.nu> +# Copyright (C) 2013 Michał Masłowski <mtjm@mtjm.eu> +# Copyright (C) 2013-2014,2017-2018,2024 Luke Shumaker <lukeshu@parabola.nu> +# Copyright (C) 2019-2020,2022-2024 Bill Auger <mr.j.spam.me@gmail.com> # # For just the create_signature() function: # Copyright (C) 2006-2013 Pacman Development Team <pacman-dev@archlinux.org> @@ -19,7 +19,7 @@ # # License: GNU GPLv3+ # -# This file is part of Parabola. +# This file is part of Parabola Libretools. # # Parabola is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -286,8 +286,15 @@ release_packages() { return $EXIT_SUCCESS fi + + ## publish ## + + 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" - 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}" if [[ -n $HOOKPOSTRELEASE ]]; then msg "Running HOOKPOSTRELEASE..." @@ -300,17 +307,25 @@ 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 reject_pkgs='-debug-' + local pkgname_rx='s|\([^/]*\)/\([^/ -]*\)-\([^-]*\)-[^-]*-\([^-\.]*\)\..*$|\2-\3-\4/\1|' 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}" + local filename + local packages=( + $( + while read -r -d '' + do filename="$REPLY" + [[ "${filename}" =~ ${select_pkgs} ]] || continue + [[ "${filename}" =~ ${reject_pkgs} ]] && continue || : + + sed "${pkgname_rx}" <<<${filename} || : + done < ${file_list} | sort -u | xargs || : + ) + ) + if (( ${#packages[@]} )); then + local pbotsay_cmd="$(printf "${pbotsay_fmt}" "${login}" "${packages[@]}")" + + ssh ${tier0_port} "${tier0_host}" "${pbotsay_cmd}" &> /dev/null || : fi return $EXIT_SUCCESS |