summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/UPT/Library
diff options
context:
space:
mode:
authorGao, Liming <liming.gao@intel.com>2014-07-01 07:10:10 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2014-07-01 07:10:10 +0000
commite4ac870fe95adc7d178a79b73ad2792e0c8bfeb8 (patch)
tree7dc08edb8004fdb21d2450a88c1e7957246e8029 /BaseTools/Source/Python/UPT/Library
parent148af3872273ef476230db1d0df5ea00167853a1 (diff)
downloadedk2-e4ac870fe95adc7d178a79b73ad2792e0c8bfeb8.tar.gz
edk2-e4ac870fe95adc7d178a79b73ad2792e0c8bfeb8.tar.bz2
edk2-e4ac870fe95adc7d178a79b73ad2792e0c8bfeb8.zip
Sync BaseTool trunk (version r2670) into EDKII BaseTools.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Gao, Liming <liming.gao@intel.com> Reviewed-by: Liu, Yingke D (yingke.d.liu@intel.com) git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15605 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/Python/UPT/Library')
-rw-r--r--BaseTools/Source/Python/UPT/Library/String.py28
1 files changed, 27 insertions, 1 deletions
diff --git a/BaseTools/Source/Python/UPT/Library/String.py b/BaseTools/Source/Python/UPT/Library/String.py
index 0953e47cb1..f709ff1bce 100644
--- a/BaseTools/Source/Python/UPT/Library/String.py
+++ b/BaseTools/Source/Python/UPT/Library/String.py
@@ -2,7 +2,7 @@
# This file is used to define common string related functions used in parsing
# process
#
-# Copyright (c) 2011 - 2012, 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
@@ -937,3 +937,29 @@ def SplitPcdEntry(String):
return ['', '', ''], False
return ['', '', ''], False
+
+## Check if two arches matched?
+#
+# @param Arch1
+# @param Arch2
+#
+def IsMatchArch(Arch1, Arch2):
+ if 'COMMON' in Arch1 or 'COMMON' in Arch2:
+ return True
+ if isinstance(Arch1, basestring) and isinstance(Arch2, basestring):
+ if Arch1 == Arch2:
+ return True
+
+ if isinstance(Arch1, basestring) and isinstance(Arch2, list):
+ return Arch1 in Arch2
+
+ if isinstance(Arch2, basestring) and isinstance(Arch1, list):
+ return Arch2 in Arch1
+
+ if isinstance(Arch1, list) and isinstance(Arch2, list):
+ for Item1 in Arch1:
+ for Item2 in Arch2:
+ if Item1 == Item2:
+ return True
+
+ return False