summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python/UPT/Xml/IniToXml.py
diff options
context:
space:
mode:
Diffstat (limited to 'BaseTools/Source/Python/UPT/Xml/IniToXml.py')
-rw-r--r--BaseTools/Source/Python/UPT/Xml/IniToXml.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/BaseTools/Source/Python/UPT/Xml/IniToXml.py b/BaseTools/Source/Python/UPT/Xml/IniToXml.py
index 4be20d00ca..037471056d 100644
--- a/BaseTools/Source/Python/UPT/Xml/IniToXml.py
+++ b/BaseTools/Source/Python/UPT/Xml/IniToXml.py
@@ -1,7 +1,7 @@
## @file
# This file is for converting package information data file to xml file.
#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2011 - 2014, 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 which accompanies this
@@ -32,6 +32,7 @@ from Library.DataType import TAB_SECTION_END
from Logger import StringTable as ST
from Library.String import ConvertSpecialChar
from Library.ParserValidate import IsValidPath
+from Library import GlobalData
## log error:
#
@@ -58,9 +59,7 @@ def __ValidatePath(Path, Root):
# @param Filename: File to be checked
#
def ValidateMiscFile(Filename):
- Root = ''
- if 'WORKSPACE' in os.environ:
- Root = os.environ['WORKSPACE']
+ Root = GlobalData.gWORKSPACE
return __ValidatePath(Filename, Root)
## ValidateToolsFile
@@ -71,8 +70,8 @@ def ValidateToolsFile(Filename):
Valid, Cause = False, ''
if not Valid and 'EDK_TOOLS_PATH' in os.environ:
Valid, Cause = __ValidatePath(Filename, os.environ['EDK_TOOLS_PATH'])
- if not Valid and 'WORKSPACE' in os.environ:
- Valid, Cause = __ValidatePath(Filename, os.environ['WORKSPACE'])
+ if not Valid:
+ Valid, Cause = __ValidatePath(Filename, GlobalData.gWORKSPACE)
return Valid, Cause
## ParseFileList
@@ -332,7 +331,7 @@ def IniToXml(IniFile):
for Index in range(0, len(FileContent)):
LastIndex = Index
Line = FileContent[Index].strip()
- if Line == '':
+ if Line == '' or Line.startswith(';'):
continue
if Line[0] == TAB_SECTION_START and Line[-1] == TAB_SECTION_END:
CurrentKey = ''