]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Common/DscClassObject.py
Sync EDKII BaseTools to BaseTools project r2093.
[mirror_edk2.git] / BaseTools / Source / Python / Common / DscClassObject.py
index ddccf6507da64170dae0ae4c23df60027d145cfd..943bc6948eb2c7971b665a7b97395c1681579418 100644 (file)
@@ -1,8 +1,8 @@
 ## @file\r
 # This file is used to define each component of DSC file\r
 #\r
-# Copyright (c) 2007 ~ 2008, Intel Corporation\r
-# All rights reserved. This program and the accompanying materials\r
+# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
 # which accompanies this distribution.  The full text of the license may be found at\r
 # http://opensource.org/licenses/bsd-license.php\r
@@ -385,10 +385,11 @@ class Dsc(DscObject):
             for IncludeFile in IncludeFiles:\r
                 if IncludeFile[1] == Arch or IncludeFile[1] == TAB_ARCH_COMMON.upper():\r
                     Filename = CheckFileExist(self.WorkspaceDir, IncludeFile[0], ContainerFile, TAB_LIBRARIES, '', IncludeFile[2])\r
-                    for NewItem in open(Filename, 'r').readlines():\r
-                        if CleanString(NewItem) == '':\r
-                            continue\r
-                        MergeArches(Libraries, NewItem, Arch)\r
+                    if os.path.exists(Filename):\r
+                        for NewItem in open(Filename, 'r').readlines():\r
+                            if CleanString(NewItem) == '':\r
+                                continue\r
+                            MergeArches(Libraries, NewItem, Arch)\r
 \r
             for Record in RecordSet:\r
                 if Record[1] == Arch or Record[1] == TAB_ARCH_COMMON.upper():\r
@@ -988,10 +989,14 @@ class Dsc(DscObject):
             #\r
             elif PreviousIf[2] in (MODEL_META_DATA_CONDITIONAL_STATEMENT_IF, Model):\r
                 List = PreviousIf[0].split(' ')\r
-                Value1 = List[0]\r
-                Value2 = List[1]\r
-                Value3 = List[2]\r
-                Value3 = SplitString(Value3)\r
+                Value1, Value2, Value3 = '', '==', '0'\r
+                if len(List) == 3:\r
+                    Value1 = List[0]\r
+                    Value2 = List[1]\r
+                    Value3 = List[2]\r
+                    Value3 = SplitString(Value3)\r
+                if len(List) == 1:\r
+                    Value1 = List[0]\r
                 Model = PreviousIf[2]\r
                 self.TblDsc.Insert(Model, Value1, Value2, Value3, ArchList, BelongsToItem, self.FileID, PreviousIf[1], StartColumn, EndLine, EndColumn, Enabled)\r
             #\r