From eb9a460c3760a718cc35874db69a4d88f6256a00 Mon Sep 17 00:00:00 2001 From: "Ivan A. Melnikov" Date: Fri, 29 Nov 2024 11:52:52 +0400 Subject: [PATCH] Add new script: st-build-in-task.sh Adds given SRPMs to a given task. Does not run anything. --- bin/st-build-in-task.sh | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 bin/st-build-in-task.sh diff --git a/bin/st-build-in-task.sh b/bin/st-build-in-task.sh new file mode 100755 index 0000000..e82ffac --- /dev/null +++ b/bin/st-build-in-task.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +set -eu + +usage() { + echo "$0 " +} + +die () { + echo "$*" >&2 + exit 1 +} + +alias="${1:-`usage`}" +shift +task="${1:-`usage`}" +shift + +for srpm in "$@"; do + [ -r "$srpm" ] || die "$srpm is not readable" +done + +echo "== Adding $# srpms to" +ssh "$alias" task show --brief "$task" + +echo "== Uploading..." +rsync -yaPL "$@" "${alias}:" + +echo "== Adding..." +for srpm in "$@"; do + ssh "$alias" task add "$task" srpm "$(basename "$srpm")" +done + +echo "== Result:" +ssh "$alias" task show --brief "$task"