pld-builder.new: client/make-request.sh - add queue id verifier for skip
glen
glen at pld-linux.org
Sat Feb 13 20:32:00 CET 2010
Author: glen Date: Sat Feb 13 19:32:00 2010 GMT
Module: pld-builder.new Tag: HEAD
---- Log message:
- add queue id verifier for skip
---- Files affected:
pld-builder.new/client:
make-request.sh (1.69 -> 1.70)
---- Diffs:
================================================================
Index: pld-builder.new/client/make-request.sh
diff -u pld-builder.new/client/make-request.sh:1.69 pld-builder.new/client/make-request.sh:1.70
--- pld-builder.new/client/make-request.sh:1.69 Mon Feb 8 21:37:30 2010
+++ pld-builder.new/client/make-request.sh Sat Feb 13 20:31:55 2010
@@ -291,6 +291,7 @@
default_builders="ac-*"
default_branch="AC-branch"
url="http://ep09.pld-linux.org:1289/"
+ control_url="http://ep09.pld-linux.org/~buildsrc"
;;
ac-java) # fake "distro" for java available ac architectures
builder_email="builder-ac at pld-linux.org"
@@ -328,6 +329,55 @@
# need to do this after distro selection
if [ "$skip" ]; then
+ skip=$(skip="$skip" control_url="$control_url" python -c '
+import urllib2
+import sys
+import StringIO
+import gzip
+import re
+import os
+import string
+from xml.dom import minidom
+
+skip = os.environ.get("skip").split(",");
+control_url = os.environ.get("control_url")
+
+print >> sys.stderr, "* Check queue_id-s against %s" % control_url
+
+try:
+ headers = { "Cache-Control": "no-cache", "Pragma": "no-cache" }
+ req = urllib2.Request(url=control_url + "/queue.gz", headers=headers)
+ f = urllib2.urlopen(req)
+except Exception, e:
+ print >> sys.stderr, "Fetch error %s: %s" % (control_url + "/queue.gz", e)
+ sys.exit(1)
+
+sio = StringIO.StringIO()
+sio.write(f.read())
+f.close()
+sio.seek(0)
+f = gzip.GzipFile(fileobj = sio)
+
+xml = re.compile("(<queue>.*?</queue>)", re.DOTALL).match(f.read()).group(1)
+d = minidom.parseString(xml)
+
+q = []
+for c in d.documentElement.childNodes:
+ if c.nodeName != "group":
+ continue
+ q.append(c.attributes["id"].value)
+
+err = 0
+for s in skip:
+ if s not in q:
+ print >> sys.stderr, "- Check %s: ERROR: Not valid queue-id" % s
+ err = 1
+ else:
+ print >> sys.stderr, "- Check %s: OK" % s
+if err == 1:
+ sys.exit(1)
+print string.join(skip, ",")
+') || exit $?
f_upgrade=no
build_mode=test
priority=-1
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/pld-builder.new/client/make-request.sh?r1=1.69&r2=1.70&f=u
More information about the pld-cvs-commit
mailing list