]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/UPT/Xml/IniToXml.py
BaseTools: skip updating temporary variable.
[mirror_edk2.git] / BaseTools / Source / Python / UPT / Xml / IniToXml.py
index 4be20d00cacd6e472dfe7b5314fcc490a8600728..037471056d81fc40b8053c91e3325e4fddb71d2e 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is for converting package information data file to xml file.\r
 #\r
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 # This program and the accompanying materials are licensed and made available \r
 # under the terms and conditions of the BSD License which accompanies this \r
@@ -32,6 +32,7 @@ from Library.DataType import TAB_SECTION_END
 from Logger import StringTable as ST\r
 from Library.String import ConvertSpecialChar\r
 from Library.ParserValidate import IsValidPath\r
+from Library import GlobalData\r
 \r
 ## log error:\r
 #\r
@@ -58,9 +59,7 @@ def __ValidatePath(Path, Root):
 # @param Filename: File to be checked\r
 #\r
 def ValidateMiscFile(Filename):\r
-    Root = ''\r
-    if 'WORKSPACE' in os.environ:\r
-        Root = os.environ['WORKSPACE']\r
+    Root = GlobalData.gWORKSPACE\r
     return __ValidatePath(Filename, Root)\r
 \r
 ## ValidateToolsFile\r
@@ -71,8 +70,8 @@ def ValidateToolsFile(Filename):
     Valid, Cause = False, ''\r
     if not Valid and 'EDK_TOOLS_PATH' in os.environ:\r
         Valid, Cause = __ValidatePath(Filename, os.environ['EDK_TOOLS_PATH'])\r
-    if not Valid and 'WORKSPACE' in os.environ:\r
-        Valid, Cause = __ValidatePath(Filename, os.environ['WORKSPACE'])\r
+    if not Valid:\r
+        Valid, Cause = __ValidatePath(Filename, GlobalData.gWORKSPACE)\r
     return Valid, Cause\r
 \r
 ## ParseFileList\r
@@ -332,7 +331,7 @@ def IniToXml(IniFile):
     for Index in range(0, len(FileContent)):\r
         LastIndex = Index\r
         Line = FileContent[Index].strip()\r
-        if Line == '':\r
+        if Line == '' or Line.startswith(';'):\r
             continue\r
         if Line[0] == TAB_SECTION_START and Line[-1] == TAB_SECTION_END:\r
             CurrentKey = ''\r