]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools/build/build: delete variable
authorCarsey, Jaben <jaben.carsey@intel.com>
Thu, 24 Jan 2019 16:14:21 +0000 (00:14 +0800)
committerFeng, Bob C <bob.c.feng@intel.com>
Mon, 28 Jan 2019 03:44:45 +0000 (11:44 +0800)
delete the shared global variable from Common.Misc
delete the uncalled users of the variable from build.build

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
BaseTools/Source/Python/Common/Misc.py
BaseTools/Source/Python/build/build.py

index e8be8f866511586c8c0520f72a02765fe2da0dbf..0b4dd7a7c1626915cd1174071a6fdc7093a7e65c 100644 (file)
@@ -54,9 +54,6 @@ secReGeneral = re.compile('^([\da-fA-F]+):([\da-fA-F]+) +([\da-fA-F]+)[Hh]? +([.
 \r
 StructPattern = re.compile(r'[_a-zA-Z][0-9A-Za-z_]*$')\r
 \r
-## Dictionary used to store file time stamp for quick re-access\r
-gFileTimeStampCache = {}    # {file path : file time stamp}\r
-\r
 ## Dictionary used to store dependencies of files\r
 gDependencyDatabase = {}    # arch : {file path : [dependent files list]}\r
 \r
index 44ad86b780da5326ca965968340855bd74da90e0..e79949fa28f98ac8e75d2321b5b36aa2603b5a7a 100644 (file)
@@ -2,7 +2,7 @@
 # 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
@@ -72,43 +72,6 @@ gToolsDefinition = "tools_def.txt"
 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
@@ -2192,31 +2155,11 @@ class Build():
     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
@@ -2440,7 +2383,6 @@ def Main():
         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