diff options
author | Hess Chen <hesheng.chen@intel.com> | 2016-07-29 14:09:00 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2016-08-03 10:52:08 +0800 |
commit | 06eb35402e456066c86f621e566160967b7740ad (patch) | |
tree | 3d88edfcc44244108dacbc801ffff9e30e33ce00 /BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py | |
parent | 0e025deac50ec0fbcfc419afb47014ad1a8e10c5 (diff) | |
download | edk2-platforms-06eb35402e456066c86f621e566160967b7740ad.tar.xz |
BaseTool/Upt: Avoid UNI file name conflict
When creating a UNI file if there is a name conflict, add an index
from 0 to the file name
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <hesheng.chen@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py')
-rw-r--r-- | BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py b/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py index a131f98ead..c1362e6fb3 100644 --- a/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py +++ b/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py @@ -2,7 +2,7 @@ #
# This file contained the logical of transfer package object to INF files.
#
-# Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2011 - 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 which accompanies this
@@ -41,6 +41,7 @@ import Logger.Log as Logger from Library import DataType as DT
from GenMetaFile import GenMetaFileMisc
from Library.UniClassObject import FormatUniEntry
+from Library.String import GetUniFileName
## Transfer Module Object to Inf files
@@ -225,8 +226,8 @@ def GenModuleUNIEncodeFile(ModuleObject, UniFileHeader='', Encoding=DT.TAB_ENCOD return
else:
ModuleObject.UNIFlag = True
- ContainerFile = os.path.normpath(os.path.join(os.path.dirname(ModuleObject.GetFullPath()),
- (ModuleObject.GetBaseName() + '.uni')))
+ ContainerFile = GetUniFileName(os.path.dirname(ModuleObject.GetFullPath()), ModuleObject.GetBaseName())
+
if not os.path.exists(os.path.dirname(ModuleObject.GetFullPath())):
os.makedirs(os.path.dirname(ModuleObject.GetFullPath()))
|