summaryrefslogtreecommitdiff
path: root/BaseTools
diff options
context:
space:
mode:
authorJordan Justen <jordan.l.justen@intel.com>2016-02-10 10:08:37 -0800
committerJordan Justen <jordan.l.justen@intel.com>2016-03-10 09:59:11 -0800
commit5369c2bb735a741b53f92928463cb425c59eb60b (patch)
treeb610f43d788de4ae0fd2e74d346b579ed5102605 /BaseTools
parenteca22f362cd5f008ba2c1f1a3b4f122b206e0a1c (diff)
downloadedk2-platforms-5369c2bb735a741b53f92928463cb425c59eb60b.tar.xz
BaseTools ConvertMasmToNasm: Fix running script outside of a git tree
The script previously would hit an exception if it was run outside of a git tree. The exception looked like: edk2/BaseTools/Scripts/ConvertMasmToNasm.py Version 0.01 Traceback (most recent call last): File "edk2/BaseTools/Scripts/ConvertMasmToNasm.py", line 986, in <module> ConvertAsmApp() File "edk2/BaseTools/Scripts/ConvertMasmToNasm.py", line 984, in __init__ ConvertAsmFile(src, dst, self) File "edk2/BaseTools/Scripts/ConvertMasmToNasm.py", line 209, in __init__ CommonUtils.__init__(self, clone) File "edk2/BaseTools/Scripts/ConvertMasmToNasm.py", line 69, in __init__ self.gitemail = clone.gitemail AttributeError: ConvertAsmApp instance has no attribute 'gitemail' Fixes: https://github.com/tianocore/edk2/issues/63 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools')
-rwxr-xr-xBaseTools/Scripts/ConvertMasmToNasm.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/BaseTools/Scripts/ConvertMasmToNasm.py b/BaseTools/Scripts/ConvertMasmToNasm.py
index 7ad0bd23f3..2f0dd4f9a6 100755
--- a/BaseTools/Scripts/ConvertMasmToNasm.py
+++ b/BaseTools/Scripts/ConvertMasmToNasm.py
@@ -1,7 +1,7 @@
# @file ConvertMasmToNasm.py
# This script assists with conversion of MASM assembly syntax to NASM
#
-# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -127,6 +127,7 @@ class CommonUtils:
while True:
path = os.path.split(lastpath)[0]
if path == lastpath:
+ self.gitemail = None
return
candidate = os.path.join(path, '.git')
if os.path.isdir(candidate):
@@ -197,6 +198,7 @@ class CommonUtils:
message += '%s to %s\n' % (src, dst)
message += '\n'
message += 'Contributed-under: TianoCore Contribution Agreement 1.0\n'
+ assert(self.gitemail is not None)
message += 'Signed-off-by: %s\n' % self.gitemail
cmd = ('git', 'commit', '-F', '-')