[llvm-commits] [zorg] r171806 - in /zorg/trunk: buildbot/llvmlab/master/process_changelist.py zorg/buildbot/PhasedBuilderUtils.py
David Dean
david_dean at apple.com
Mon Jan 7 15:03:10 PST 2013
Author: ddean
Date: Mon Jan 7 17:03:10 2013
New Revision: 171806
URL: http://llvm.org/viewvc/llvm-project?rev=171806&view=rev
Log:
Add missing script and fix path where it is called.
Added:
zorg/trunk/buildbot/llvmlab/master/process_changelist.py (with props)
Modified:
zorg/trunk/zorg/buildbot/PhasedBuilderUtils.py
Added: zorg/trunk/buildbot/llvmlab/master/process_changelist.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/buildbot/llvmlab/master/process_changelist.py?rev=171806&view=auto
==============================================================================
--- zorg/trunk/buildbot/llvmlab/master/process_changelist.py (added)
+++ zorg/trunk/buildbot/llvmlab/master/process_changelist.py Mon Jan 7 17:03:10 2013
@@ -0,0 +1,46 @@
+#!/usr/bin/env python
+
+import sys, getopt, subprocess, json, time, os
+
+class Usage(Exception):
+ def __init__(self, msg):
+ self.msg = msg
+
+def main(argv=None):
+ if argv is None:
+ argv = sys.argv
+ try:
+ try:
+ opts, args = getopt.getopt(argv[1:], "h", ["help"])
+ except getopt.error, msg:
+ raise Usage(msg)
+ category = args[0]
+ filename = args[1]
+ changelist = []
+ if not os.path.isfile(filename):
+ return
+ for line in open(filename).readlines():
+ change = json.loads(line)
+ if not change in changelist:
+ print "rejected duplicate: %s" % change['revision']
+ changelist.append(change)
+ while len(changelist) > 0:
+ changelist = sorted(changelist, key=lambda k: k['timestamp'])
+ change = changelist.pop(0)
+ command = ['./sendchange.py', category, json.dumps(change)]
+ status = subprocess.call(command)
+ if status:
+ print 'An error occurred will retry in sixty seconds'
+ print change
+ changelist.append(change)
+ time.sleep(60)
+ except Usage, err:
+ print >>sys.stderr, err.msg
+ print >>sys.stderr, "for help use --help"
+ return 2
+
+def wait(res):
+ time.sleep(15)
+
+if __name__ == "__main__":
+ sys.exit(main())
\ No newline at end of file
Propchange: zorg/trunk/buildbot/llvmlab/master/process_changelist.py
------------------------------------------------------------------------------
svn:executable = *
Modified: zorg/trunk/zorg/buildbot/PhasedBuilderUtils.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/PhasedBuilderUtils.py?rev=171806&r1=171805&r2=171806&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/PhasedBuilderUtils.py (original)
+++ zorg/trunk/zorg/buildbot/PhasedBuilderUtils.py Mon Jan 7 17:03:10 2013
@@ -221,7 +221,7 @@
copy_properties = copy_properties))
f.addStep(MasterShellCommand(
name='trigger.next_phase', haltOnFailure = True,
- command = ['../master-0/process_changelist.py', next_phase,
+ command = ['./process_changelist.py', next_phase,
WithProperties('%(scheduler)s_changes.txt')],
description = ['Trigger', next_phase],
descriptionDone = ['Trigger', next_phase]))
More information about the llvm-commits
mailing list