]> git.pld-linux.org Git - packages/rpm-build-tools.git/blame - fetchsrc_request
- list by size, show total
[packages/rpm-build-tools.git] / fetchsrc_request
CommitLineData
62f6c727 1#!/bin/sh
2# $Id$
3#
bed5496e 4# Sending by
294f78c2
MB
5MAILER='/usr/sbin/sendmail'
6# MAILER='/usr/bin/msmtp'
4793b338 7# Sending via
16641ef8 8VIA="SENDMAIL"
294f78c2
MB
9#VIA="localhost"
10VIA_ARGS=""
53e563db 11#VIA_ARGS="some additional flags"
bed5496e 12# e.g. for msmtp:
294f78c2 13# VIA_ARGS='-a gmail'
62f6c727 14#
15# DISTFILES EMAIL
656c0675 16DMAIL="distfiles@pld-linux.org"
62f6c727 17#
18# CVS LOGIN or fill it by hand :)
12ad34ad
ER
19tmp=$(awk -F: '{ print $3; }' CVS/Root)
20LOGIN=${tmp%@*}
62f6c727 21#LOGIN="djrzulf"
22#
23# HOST
8bd92021 24HOST=`hostname -f`
16641ef8 25#HOST="knycz.net"
62f6c727 26#
27# functions
28
29usage()
30{
8b4d080a 31 echo "Usage: fetchsrc_request file.spec [BRANCH]"
32 echo
62f6c727 33}
34
35#------------------
36# main()
37if [ "$#" = 0 ]; then
8b4d080a 38 usage
39 exit 1
40fi
41if [ "$LOGIN" == "cvs" ]; then
42 echo "Use fetchsrc_request from your R/W CVS tree or set LOGIN by hand" >&2
62f6c727 43 exit 1
44fi
a6359a62 45if [ "$2" != "" ]; then
46 BRANCH="$2"
62f6c727 47else
48 BRANCH="HEAD"
49fi
806edb9e 50SPEC="$(basename $1)"
1077a939
ER
51if [[ "$SPEC" != *.spec ]]; then
52 SPEC="$SPEC.spec"
53fi
62f6c727 54
16641ef8 55if [ "$VIA" = "SENDMAIL" ]; then
bed5496e 56 echo >&2 "Requesting $SPEC:$BRANCH via $MAILER ${VIA_ARGS:+ ($VIA_ARGS)}"
57 cat <<EOF | "$MAILER" -t -i $VIA_ARGS
c17d602d 58To: $DMAIL
59From: $LOGIN <$LOGIN@$HOST>
4793b338 60Subject: fetchsrc_request notify
c17d602d 61X-CVS-Module: SPECS
62X-distfiles-request: yes
63X-Login: $LOGIN
1077a939 64X-Spec: $SPEC
c17d602d 65X-Branch: $BRANCH
66X-Flags: force-reply
8e5f00de 67
c17d602d 68.
69EOF
16641ef8 70else
1077a939 71 echo >&2 "Requesting $SPEC:$BRANCH via SMTP ($VIA:25)"
c17d602d 72 cat <<EOF | /usr/bin/nc $VIA 25 > /dev/null
73EHLO $HOST
74MAIL FROM: $LOGIN <$LOGIN@$HOST>
75RCPT TO: $DMAIL
76DATA
77To: $DMAIL
78Subject: fetchsrc_request notify
79X-CVS-Module: SPECS
80X-distfiles-request: yes
81X-Login: $LOGIN
1077a939 82X-Spec: $SPEC
c17d602d 83X-Branch: $BRANCH
84X-Flags: force-reply
8e5f00de 85
c17d602d 86.
87QUIT
88EOF
16641ef8 89fi
62f6c727 90
This page took 0.057576 seconds and 4 git commands to generate.