From c8cdf865d2ede2f9c09dc7983b0cc0a132b5a387 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Tue, 6 Sep 2011 10:39:57 +0200 Subject: [PATCH] handle non-existing build log gracefully and dont delete workspace on failed builds --- build.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/build.py b/build.py index 8281769..ed26703 100755 --- a/build.py +++ b/build.py @@ -214,6 +214,7 @@ def exit_ok(): sys.exit(0) def exit_error(): + atexit.unregister(remove_git_target_workspace) send_email(SMTP_BUILD_ERROR) sys.exit(1) @@ -406,9 +407,12 @@ if __name__ == '__main__': ) if not ret: build_log=os.path.join('../build-area/result/', '%s_%s_amd64.build' % (pkg_name, version)) - fh = open(build_log, 'r') - logger.info('%s' % (fh.read())) - fh.close() + try: + fh = open(build_log, 'r') + logger.info('%s' % (fh.read())) + fh.close() + except: + pass exit_error() else: create_dput_cfg() -- 2.39.5