summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py
diff options
context:
space:
mode:
authorHess Chen <hesheng.chen@intel.com>2016-07-29 14:09:00 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2016-08-03 10:52:08 +0800
commit06eb35402e456066c86f621e566160967b7740ad (patch)
tree3d88edfcc44244108dacbc801ffff9e30e33ce00 /BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py
parent0e025deac50ec0fbcfc419afb47014ad1a8e10c5 (diff)
downloadedk2-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/GenDecFile.py')
-rw-r--r--BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py b/BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py
index 31abd23ccd..d39c1827ba 100644
--- a/BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py
+++ b/BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py
@@ -65,6 +65,7 @@ from Library.DataType import TAB_SECTION_END
from Library.DataType import TAB_SPLIT
import Library.DataType as DT
from Library.UniClassObject import FormatUniEntry
+from Library.String import GetUniFileName
def GenPcd(Package, Content):
#
@@ -586,9 +587,9 @@ def GenPackageUNIEncodeFile(PackageObject, UniFileHeader = '', Encoding=TAB_ENCO
if not os.path.exists(os.path.dirname(PackageObject.GetFullPath())):
os.makedirs(os.path.dirname(PackageObject.GetFullPath()))
- ContainerFile = os.path.normpath(os.path.join(os.path.dirname(PackageObject.GetFullPath()),
- (PackageObject.GetBaseName() + '.uni')))
+ ContainerFile = GetUniFileName(os.path.dirname(PackageObject.GetFullPath()), PackageObject.GetBaseName())
+
Content = UniFileHeader + '\r\n'
Content += '\r\n'