[packages/rpm-build-tools/merge-pld-builder-client: 53/2675] - by default use http for delivering requests
glen
glen at pld-linux.org
Mon Dec 19 21:53:23 CET 2016
commit 94c75ef632195170b0666eeeca241f9e338eb24e
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Sun Feb 8 15:26:34 2009 +0000
- by default use http for delivering requests
Changed files:
client/make-request.sh -> 1.52
make-request.sh | 30 +++++++++++++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)
---
diff --git a/make-request.sh b/make-request.sh
index 7717f2a..8eb8f8a 100644
--- a/make-request.sh
+++ b/make-request.sh
@@ -10,6 +10,9 @@ command_flags=
gpg_opts=
default_branch='HEAD'
distro=
+url="http://ep09.pld-linux.org:1234/"
+
+[ -x /usr/bin/python ] && send_mode="python" || send_mode="mail"
if [ -n "$HOME_ETC" ]; then
USER_CFG=$HOME_ETC/.requestrc
@@ -23,6 +26,8 @@ if [ ! -f "$USER_CFG" ]; then
priority=2
requester=deviloper at pld-linux.org
default_key=deviloper at pld-linux.org
+send_mode="$send_mode"
+url="$url"
mailer="/usr/sbin/sendmail -t"
gpg_opts=""
distro=th
@@ -37,6 +42,29 @@ if [ -f "$USER_CFG" ]; then
. $USER_CFG
fi
+send_request() {
+ case "$send_mode" in
+ "mail")
+ cat - | $mailer
+ ;;
+ *)
+ cat - | python -c '
+import sys, urllib2
+
+try:
+ data = sys.stdin.read()
+ req = urllib2.Request(sys.argv[1], data)
+ f = urllib2.urlopen(req, timeout=10)
+ f.close()
+except Exception, e:
+ print >> sys.stderr, "Problem while sending request: %s" % e
+ sys.exit(1)
+print >> sys.stdout, "Requires posted."
+' "$url"
+ ;;
+ esac
+}
+
die() {
echo >&2 "$0: $*"
exit 1
@@ -407,4 +435,4 @@ $(echo "$req" | gpg --clearsign --default-key $default_key $gpg_opts)
EOF
}
-gen_email | $mailer
+gen_email | send_request
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/rpm-build-tools.git/commitdiff/cca6584b96e6c33d0732d559e43e100d804e2ecd
More information about the pld-cvs-commit
mailing list