X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-dev.git/blobdiff_plain/7bc450adac529e07b594f2b38d268c056563ac9e..fd83f91bcdb156d5f7557597bf728167f437e409:/invirt-submit-build diff --git a/invirt-submit-build b/invirt-submit-build index f9b5697..4bed2ee 100755 --- a/invirt-submit-build +++ b/invirt-submit-build @@ -46,7 +46,11 @@ def main(): commit = b.canonicalize_commit(package, commit) b.validateBuild(pocket, package, commit) except b.InvalidBuild, e: - print >>sys.stderr, "E: %s" % e + msg = "E: %s" % e + print >>sys.stderr, msg + # Prevent an attack by submitting excessively long arguments + args = [arg[:min(len(arg), 80)] for arg in (pocket, package, commit)] + b.runHook('failed-submit', args + [principal], stdin_str=msg) sys.exit(1) # To keep from triggering the Invirtibuilder before we've actually @@ -57,6 +61,9 @@ def main(): print >>q, "%s %s %s %s" % (pocket, package, commit, principal) q.close() os.rename(q_name, q_path) + short_commit = b.canonicalize_commit(package, commit, shorten=True) + b.runHook('post-submit', [pocket, package, short_commit, principal]) + print '%s, your job to build %s for %s:%s has been submitted!' % (principal, short_commit, package, pocket) if __name__ == '__main__':