From f954cfe2b0e48613e1183d8035d9abc67017f005 Mon Sep 17 00:00:00 2001 From: Marcin Krol Date: Fri, 7 Jul 2023 16:03:06 +0200 Subject: [PATCH] - mail requests are no longer supported --- client/make-request.sh | 88 ++++-------------------------------------- 1 file changed, 8 insertions(+), 80 deletions(-) diff --git a/client/make-request.sh b/client/make-request.sh index 577ffcd..06e3445 100755 --- a/client/make-request.sh +++ b/client/make-request.sh @@ -24,8 +24,8 @@ relup=no if [ -x /usr/bin/python3 ]; then send_mode="python" else - echo "No python present, using mail mode" - send_mode="mail" + echo "No python3 present, aborting" + exit 1 fi if [ -n "$HOME_ETC" ]; then @@ -42,10 +42,9 @@ requester=deviloper@tld-linux.org default_key=deviloper@tld-linux.org send_mode="$send_mode" url="$url" -mailer="/usr/lib/sendmail -t" gpg_opts="" dist=ti -url="https://src.tld-linux.org:1241/" +url="https://giant.tld-linux.org:1241/" # defaults: f_upgrade=yes @@ -63,7 +62,6 @@ fi # internal options, not to be overriden specs= -df_fetch=no upgrade_macros=no upgrade_scripts=no cr=$(printf "\r") @@ -85,23 +83,14 @@ die() { } send_request() { - # switch to mail mode, if no url set - [ -z "$url" ] && send_mode="mail" - if [ -n "$wait" ]; then msg "Waiting $wait seconds before sending request" sleep $wait msg "Wait has ended, proceeding!" fi - case "$send_mode" in - "mail") - msg "Sending using mail mode" - cat - | $mailer - ;; - *) - msg "Sending using HTTP mode to $url" - cat - | python3 -c ' + msg "Sending using HTTP mode to $url" + cat - | python3 -c ' import sys, socket, ssl from urllib import request @@ -124,8 +113,6 @@ except Exception as e: sys.exit(1) print("Request queued via HTTP.", file=sys.stdout) ' "$url" - ;; - esac } # htmlspecialchars: escape <, > and & @@ -134,50 +121,6 @@ hsc() { printf "%s\n" "$input" | sed -e 's,&,\&,g;s,<,\<,g;s,>,\>,g' } -# simple df_fetcher, based on packages/fetchsrc_request -# TODO: tcp (smtp) mode -# TODO: adjust for ~/.requestrc config -df_fetch() { - local specs="$@" - - # Sending by - local MAILER='/usr/lib/sendmail' - # MAILER='/usr/bin/msmtp' - # Sending via - local VIA="SENDMAIL" - #VIA="localhost" - local VIA_ARGS="" - #VIA_ARGS="some additional flags" - # e.g. for msmtp: - # VIA_ARGS='-a gmail' - # - # DISTFILES EMAIL - local DMAIL="df@tld-linux.org" - - local HOST=$(hostname -f) - local LOGIN=${requester%@*} - - local SPEC BRANCH - for spec in $specs; do - SPEC=$(echo "$spec" | sed -e 's|:.*||') - SPEC=${SPEC%.spec} - BRANCH=$(echo "$spec" | sed -e 's|.*:||') - echo >&2 "Distfiles Request: $SPEC:$BRANCH via $MAILER ${VIA_ARGS:+ ($VIA_ARGS)}" - cat <<-EOF | "$MAILER" -t -i $VIA_ARGS - To: $DMAIL - From: $LOGIN <$LOGIN@$HOST> - Subject: fetchsrc_request notify - X-distfiles-request: yes - X-Login: $LOGIN - X-Package: $SPEC - X-Branch: $BRANCH - X-Flags: force-reply - - . - EOF - done -} - # get package revision for specs get_pkgrevision() { local pkgrev pkg spec rpmdir @@ -491,10 +434,6 @@ while [ $# -gt 0 ]; do upgrade_scripts='yes' ;; - -df | --distfiles-fetch | --distfiles-fetch-request) - df_fetch=yes - ;; - --gpg-opts | -g) gpg_opts="$2" shift @@ -522,15 +461,13 @@ done case "$dist" in ti) - builder_email="builderti@src.tld-linux.org" default_builders="ti-*" - url="https://src.tld-linux.org:1241/" + url="https://giant.tld-linux.org:1241/" control_url="http://src.tld-linux.org/~builderti" ;; ti-dev) - builder_email="buildertidev@src.tld-linux.org" default_builders="ti-dev-*" - url="https://src.tld-linux.org:1242/" + url="https://giant.tld-linux.org:1242/" control_url="http://src.tld-linux.org/~buildertidev" ;; *) @@ -625,11 +562,6 @@ if [ "$pkgrevision" = "yes" ]; then specs=$(get_pkgrevision $specs) fi -if [ "$df_fetch" = "yes" ]; then - df_fetch $specs - exit 0 -fi - if [ "$upgrade_macros" = "yes" ]; then command="poldek --up; poldek -uv rpm-build-macros" builders="$dist-src" @@ -690,11 +622,7 @@ gen_req() { msg "Using jobs $jobs" echo " $jobs" fi - if [ -z "$url" ]; then - msg "Using email $builder_email" - else - msg "Using URL $url" - fi + msg "Using URL $url" if [ "$build_mode" = "ready" ]; then msg "Build mode: $(tput setaf 2)$build_mode$c_norm" -- 2.46.0