self.PkgsToBeDepend.extend(self.GenToBeInstalledPkgList(ToBeInstalledPkgList))\r
\r
def GenToBeInstalledPkgList(self, ToBeInstalledPkgList):\r
+ if not ToBeInstalledPkgList:\r
+ return []\r
RtnList = []\r
for Dist in ToBeInstalledPkgList:\r
for Package in Dist.PackageSurfaceArea:\r
#\r
FileHeader = GenHeaderCommentSection(ModuleAbstract, ModuleDescription, ModuleCopyright, ModuleLicense, False, \\r
DT.TAB_COMMENT_EDK1_SPLIT)\r
- GenModuleUNIEncodeFile(ModuleObject, FileHeader)\r
+ ModuleUniFile = GenModuleUNIEncodeFile(ModuleObject, FileHeader)\r
+ if ModuleUniFile:\r
+ ModuleObject.SetModuleUniFile(os.path.basename(ModuleUniFile))\r
\r
#\r
# Judge whether the INF file is an AsBuild INF.\r
# TAB_INF_DEFINES_VERSION_STRING\r
if ModuleObject.UNIFlag:\r
Statement = (u'%s ' % DT.TAB_INF_DEFINES_MODULE_UNI_FILE).ljust(LeftOffset) + \\r
- u'= %s' % ModuleObject.GetBaseName() + '.uni'\r
+ u'= %s' % ModuleObject.GetModuleUniFile()\r
SpecialStatementList.append(Statement)\r
\r
# TAB_INF_DEFINES_MODULE_TYPE\r
pass\r
\r
LargestIndex = -1\r
+ IndexNotFound = True\r
for File in Files:\r
if File.upper().startswith(FileName.upper()) and File.upper().endswith('.UNI'):\r
Index = File.upper().replace(FileName.upper(), '').replace('.UNI', '')\r
except Exception:\r
Index = -1\r
else:\r
+ IndexNotFound = False\r
Index = 0\r
if Index > LargestIndex:\r
LargestIndex = Index + 1\r
\r
- if LargestIndex > -1:\r
+ if LargestIndex > -1 and not IndexNotFound:\r
return os.path.normpath(os.path.join(FilePath, FileName + str(LargestIndex) + '.uni'))\r
else:\r
return os.path.normpath(os.path.join(FilePath, FileName + '.uni'))\r
## @file\r
# This file is used to define a class object to describe a module\r
#\r
-# Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.<BR>\r
#\r
# This program and the accompanying materials are licensed and made available \r
# under the terms and conditions of the BSD License which accompanies this \r
self.PiSpecificationVersion = ''\r
self.UefiSpecificationVersion = ''\r
self.UNIFlag = False\r
+ self.ModuleUniFile = ''\r
#\r
# SpecObject\r
#\r
def GetSupArchList(self):\r
return self.SupArchList\r
\r
+ def SetModuleUniFile(self, ModuleUniFile):\r
+ self.ModuleUniFile = ModuleUniFile\r
+\r
+ def GetModuleUniFile(self):\r
+ return self.ModuleUniFile\r
##\r
# SourceFileObject\r
#\r