-# 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
-}
-
-# autotag from rpm-build-macros
-# displays latest used tag for a specfile
-autotag() {
- local out s
- for s in "$@"; do
- # strip branches
- s=${s%:*}
- # ensure package ends with .spec
- s=${s%.spec}.spec
- git fetch --tags
- out=$(git for-each-ref --count=1 --sort=-authordate refs/tags/auto/$dist \
- --format='%(refname:short)')
- echo "$s:$out"
- done
-}
-
-# get autotag for specs
-# WARNING: This may checkout some files from VCS
-get_autotag() {
- local pkg spec rpmdir