BaseTools/UPT: Replace os.linesep with '\r\n' when generating UNI files.

Replace os.linesep with '\r\n' when generating UNI files to make sure all files are under DOS format.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <hesheng.chen@intel.com>
Reviewed-by: Gao, Liming <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16041 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Hess Chen
2014-09-03 08:25:10 +00:00
committed by hchen30
parent b5fd61fe8c
commit cf2b2bdef3
4 changed files with 47 additions and 50 deletions

View File

@ -230,22 +230,22 @@ def GenModuleUNIEncodeFile(ModuleObject, UniFileHeader='', Encoding=DT.TAB_ENCOD
if not os.path.exists(os.path.dirname(ModuleObject.GetFullPath())):
os.makedirs(os.path.dirname(ModuleObject.GetFullPath()))
Content = UniFileHeader + os.linesep
Content += DT.END_OF_LINE
Content = UniFileHeader + '\r\n'
Content += '\r\n'
Content += FormatUniEntry('#string ' + DT.TAB_INF_ABSTRACT, ModuleObject.GetAbstract(), ContainerFile) + os.linesep
Content += FormatUniEntry('#string ' + DT.TAB_INF_ABSTRACT, ModuleObject.GetAbstract(), ContainerFile) + '\r\n'
Content += FormatUniEntry('#string ' + DT.TAB_INF_DESCRIPTION, ModuleObject.GetDescription(), ContainerFile) \
+ os.linesep
+ '\r\n'
BinaryAbstractString = FormatUniEntry('#string ' + DT.TAB_INF_BINARY_ABSTRACT, BinaryAbstract, ContainerFile)
if BinaryAbstractString:
Content += BinaryAbstractString + os.linesep
Content += BinaryAbstractString + '\r\n'
BinaryDescriptionString = FormatUniEntry('#string ' + DT.TAB_INF_BINARY_DESCRIPTION, BinaryDescription, \
ContainerFile)
if BinaryDescriptionString:
Content += BinaryDescriptionString + os.linesep
Content += BinaryDescriptionString + '\r\n'
if not os.path.exists(ContainerFile):
File = codecs.open(ContainerFile, 'wb', Encoding)