targets/toolchain_gcc.py
changeset 677 607731b33026
parent 510 8038c08b9874
child 693 96fcadb6a7a0
--- a/targets/toolchain_gcc.py	Thu Feb 02 00:28:27 2012 +0100
+++ b/targets/toolchain_gcc.py	Thu Feb 02 16:09:27 2012 +0100
@@ -37,6 +37,13 @@
     def _GetMD5FileName(self):
         return os.path.join(self.buildpath, "lastbuildPLC.md5")
 
+    def ResetBinaryCodeMD5(self):
+        self.md5key = None
+        try:
+            os.remove(self._GetMD5FileName())
+        except Exception, e:
+            pass
+    
     def GetBinaryCodeMD5(self):
         if self.md5key is not None:
             return self.md5key
@@ -150,18 +157,18 @@
             
             if status :
                 return False
-            else :
-                # Calculate md5 key and get data for the new created PLC
-                data=self.GetBinaryCode()
-                self.md5key = hashlib.md5(data).hexdigest()
-    
-                # Store new PLC filename based on md5 key
-                f = open(self._GetMD5FileName(), "w")
-                f.write(self.md5key)
-                f.close()
+                
         else:
             self.PluginsRootInstance.logger.write("   [pass]  " + ' '.join(obns)+" -> " + self.exe + "\n")
-            
+        
+        # Calculate md5 key and get data for the new created PLC
+        data=self.GetBinaryCode()
+        self.md5key = hashlib.md5(data).hexdigest()
+
+        # Store new PLC filename based on md5 key
+        f = open(self._GetMD5FileName(), "w")
+        f.write(self.md5key)
+        f.close()
         
         return True