From c2d65f7ad2427ae611099f7da989a6bb058c8d93 Mon Sep 17 00:00:00 2001 From: Anton Mitrokhin Date: Fri, 4 Jul 2014 15:10:36 +0400 Subject: [PATCH] Fixed multiple message sending and added more verbouse warning regarding inconsistent ISPC_HOME --- alloy.py | 10 ++++++++-- common.py | 9 +++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/alloy.py b/alloy.py index 2b2c82b5..4d55e0bf 100755 --- a/alloy.py +++ b/alloy.py @@ -84,6 +84,10 @@ def build_LLVM(version_LLVM, revision, folder, tarball, debug, selfbuild, extra, # Here we understand what and where do we want to build current_path = os.getcwd() llvm_home = os.environ["LLVM_HOME"] + + + make_sure_dir_exists(llvm_home) + os.chdir(llvm_home) FOLDER_NAME=version_LLVM if version_LLVM == "trunk": @@ -583,7 +587,7 @@ def validation_run(only, only_targets, reference_branch, number, notify, update, msg.attach(text) attach_mail_file(msg, alloy_build, "alloy_build.log") s = smtplib.SMTP(smtp_server) - s.sendmail('ISPC_test_system', options.notify, msg.as_string()) + s.sendmail('ISPC_test_system', options.notify.split(" "), msg.as_string()) s.quit() def Main(): @@ -630,7 +634,8 @@ def Main(): current_path = os.getcwd() make = "make -j" + options.speed if os.environ["ISPC_HOME"] != os.getcwd(): - error("you ISPC_HOME and your current path are different!\n", 2) + error("you ISPC_HOME and your current path are different! (" + os.environ["ISPC_HOME"] + " is not equal to " + os.getcwd() + + ")\n", 2) if options.perf_llvm == True: if options.branch == "master": options.branch = "trunk" @@ -679,6 +684,7 @@ import common error = common.error take_lines = common.take_lines print_debug = common.print_debug +make_sure_dir_exists = common.make_sure_dir_exists if __name__ == '__main__': # parsing options class MyParser(OptionParser): diff --git a/common.py b/common.py index 2a788722..6ec33f33 100755 --- a/common.py +++ b/common.py @@ -34,6 +34,7 @@ # // Author: Filippov Ilia import sys import os +import errno import shutil def write_to_file(filename, line): @@ -49,6 +50,14 @@ def remove_if_exists(filename): else: os.remove(filename) +def make_sure_dir_exists(path): + try: + os.makedirs(path) + except OSError as exception: + if exception.errno != errno.EEXIST: + raise + + # detect version which is printed after command def take_lines(command, which): os.system(command + " > " + "temp_detect_version")