equal
deleted
inserted
replaced
102 # Store new PLC filename based on md5 key |
102 # Store new PLC filename based on md5 key |
103 f = open(self._GetMD5FileName(), "w") |
103 f = open(self._GetMD5FileName(), "w") |
104 f.write(self.md5key) |
104 f.write(self.md5key) |
105 f.close() |
105 f.close() |
106 |
106 |
107 if oldmd5 != self.md5key : |
107 if oldmd5 != self.md5key: |
108 target = self.CTRInstance.GetTarget().getcontent() |
108 target = self.CTRInstance.GetTarget().getcontent() |
109 beremizcommand = {"src": ' '.join(srcfiles), |
109 beremizcommand = {"src": ' '.join(srcfiles), |
110 "cflags": ' '.join(cflags), |
110 "cflags": ' '.join(cflags), |
111 "md5": self.md5key, |
111 "md5": self.md5key, |
112 "buildpath": self.buildpath |
112 "buildpath": self.buildpath |
118 command = [ token % beremizcommand for token in cmd.split(' ')] |
118 command = [ token % beremizcommand for token in cmd.split(' ')] |
119 |
119 |
120 # Call Makefile to build PLC code and link it with target specific code |
120 # Call Makefile to build PLC code and link it with target specific code |
121 status, result, err_result = ProcessLogger(self.CTRInstance.logger, |
121 status, result, err_result = ProcessLogger(self.CTRInstance.logger, |
122 command).spin() |
122 command).spin() |
123 if status : |
123 if status: |
124 self.md5key = None |
124 self.md5key = None |
125 self.CTRInstance.logger.write_error(_("C compilation failed.\n")) |
125 self.CTRInstance.logger.write_error(_("C compilation failed.\n")) |
126 return False |
126 return False |
127 return True |
127 return True |
128 else : |
128 else: |
129 self.CTRInstance.logger.write(_("Source didn't change, no build.\n")) |
129 self.CTRInstance.logger.write(_("Source didn't change, no build.\n")) |
130 return True |
130 return True |