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>
This commit is contained in:
Hess Chen
2016-07-29 14:09:00 +08:00
committed by Yonghong Zhu
parent 0e025deac5
commit 06eb35402e
3 changed files with 32 additions and 6 deletions

View File

@ -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'