# build a platform or a module\r
#\r
# Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR>\r
-# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR>\r
# Copyright (c) 2018, Hewlett Packard Enterprise Development, L.P.<BR>\r
#\r
# This program and the accompanying materials\r
TemporaryTablePattern = re.compile(r'^_\d+_\d+_[a-fA-F0-9]+$')\r
TmpTableDict = {}\r
\r
-## Make a Python object persistent on file system\r
-#\r
-# @param Data The object to be stored in file\r
-# @param File The path of file to store the object\r
-#\r
-def _DataDump(Data, File):\r
- Fd = None\r
- try:\r
- Fd = open(File, 'wb')\r
- pickle.dump(Data, Fd, pickle.HIGHEST_PROTOCOL)\r
- except:\r
- EdkLogger.error("", FILE_OPEN_FAILURE, ExtraData=File, RaiseError=False)\r
- finally:\r
- if Fd is not None:\r
- Fd.close()\r
-\r
-## Restore a Python object from a file\r
-#\r
-# @param File The path of file stored the object\r
-#\r
-# @retval object A python object\r
-# @retval None If failure in file operation\r
-#\r
-def _DataRestore(File):\r
- Data = None\r
- Fd = None\r
- try:\r
- Fd = open(File, 'rb')\r
- Data = pickle.load(Fd)\r
- except Exception as e:\r
- EdkLogger.verbose("Failed to load [%s]\n\t%s" % (File, str(e)))\r
- Data = None\r
- finally:\r
- if Fd is not None:\r
- Fd.close()\r
- return Data\r
-\r
## Check environment PATH variable to make sure the specified tool is found\r
#\r
# If the tool is found in the PATH, then True is returned\r
def Relinquish(self):\r
OldLogLevel = EdkLogger.GetLevel()\r
EdkLogger.SetLevel(EdkLogger.ERROR)\r
- #self.DumpBuildData()\r
Utils.Progressor.Abort()\r
if self.SpawnMode == True:\r
BuildTask.Abort()\r
EdkLogger.SetLevel(OldLogLevel)\r
\r
- def DumpBuildData(self):\r
- CacheDirectory = os.path.dirname(GlobalData.gDatabasePath)\r
- Utils.CreateDirectory(CacheDirectory)\r
- Utils._DataDump(Utils.gFileTimeStampCache, os.path.join(CacheDirectory, "gFileTimeStampCache"))\r
- Utils._DataDump(Utils.gDependencyDatabase, os.path.join(CacheDirectory, "gDependencyDatabase"))\r
-\r
- def RestoreBuildData(self):\r
- FilePath = os.path.join(os.path.dirname(GlobalData.gDatabasePath), "gFileTimeStampCache")\r
- if Utils.gFileTimeStampCache == {} and os.path.isfile(FilePath):\r
- Utils.gFileTimeStampCache = Utils._DataRestore(FilePath)\r
- if Utils.gFileTimeStampCache is None:\r
- Utils.gFileTimeStampCache = {}\r
-\r
- FilePath = os.path.join(os.path.dirname(GlobalData.gDatabasePath), "gDependencyDatabase")\r
- if Utils.gDependencyDatabase == {} and os.path.isfile(FilePath):\r
- Utils.gDependencyDatabase = Utils._DataRestore(FilePath)\r
- if Utils.gDependencyDatabase is None:\r
- Utils.gDependencyDatabase = {}\r
-\r
def ParseDefines(DefineList=[]):\r
DefineDict = {}\r
if DefineList is not None:\r
if not (MyBuild.LaunchPrebuildFlag and os.path.exists(MyBuild.PlatformBuildPath)):\r
MyBuild.Launch()\r
\r
- #MyBuild.DumpBuildData()\r
#\r
# All job done, no error found and no exception raised\r
#\r