Commits

Anonymous committed 3d13a6b

contl10n01: write log files to own location

Comments (0)

Files changed (1)

l10ntools/scripts/tool/commands.py

         self._log_file_pattern  = utils.Util.replace_variables(tool_cfg.get("Upload Server", "log_file_pattern"), env, tool_cfg, self._log)
         self._server_user       = utils.Util.replace_variables(tool_cfg.get("Upload Server", "server_user"), env, tool_cfg, self._log)
         self._server_keyfile    = utils.Util.replace_variables(tool_cfg.get("Upload Server", "server_keyfile"), env, tool_cfg, self._log)
+        self._log_windows_path  = utils.Util.replace_variables(tool_cfg.get("Upload Server", "log_windows_path"), env, tool_cfg, self._log)
+        self._log_unix_path     = utils.Util.replace_variables(tool_cfg.get("Upload Server", "log_unix_path"), env, tool_cfg, self._log)
+
         #self._server_path       = utils.Util.replace_variables(self._server_path, env, tool_cfg, self._log)
 
         if self._cws_root[1] == ":":
             scp_rc, stdout_v, stderr_v = utils.Util.exe(upload_cmd, self._log)
         # Log file
         if len(self._log_files) > 0:
-            self._log.info("Uploading " + str(len(self._log_files)) + " log file to "+self._server_url+":"+self._server_path)
-            upload_cmd = "scp -i %s %s %s@%s " % (self._server_keyfile, " ".join(self._log_files), self._server_user, self._server_url+":"+self._server_path)
-            self._log.info(upload_cmd)
-            scp_rc, stdout_v, stderr_v = utils.Util.exe(upload_cmd, self._log)
+            self._log.info("Copying log file " + str(self._log_files[0]))
+            my_log_file = self._log_files[0]
+            
+            if my_log_file.startswith("./"):
+                my_log_file = my_log_file[2:]
+            
+            if utils.Util.get_platform == "windows":
+                utils.Util.copyfile(self._log_files[0], self._log_windows_path+"/"+env["CWS_WORK_STAMP"]+"_"+my_log_file, self._log)
+            else:
+                utils.Util.copyfile(self._log_files[0], self._log_unix_path+"/"+env["CWS_WORK_STAMP"]+"_"+my_log_file, self._log)
+
+            #self._log.info("Uploading " + str(len(self._log_files)) + " log file to "+self._server_url+":"+self._server_path)
+            #upload_cmd = "scp -i %s %s %s@%s " % (self._server_keyfile, " ".join(self._log_files), self._server_user, self._server_url+":"+self._server_path)
+            #self._log.info(upload_cmd)
+            #scp_rc, stdout_v, stderr_v = utils.Util.exe(upload_cmd, self._log)
 
     def post(self, tool_cfg, state_cfg, env):
         # write status into state_cfg
-        state_cfg.add_section(self.state_name)
+        if not state_cfg.has_section:
+            state_cfg.add_section(self.state_name)
 
     
 class CommitSDF(Command):
         string += "Modified languages:<br>"+" ".join(self._files_modified)+"<p>"
         string += "New languages:<br>"+" ".join(self._new_files)+"<p>"
         string += "Removed languages due to errors that gsicheck did not find:<br>"+" ".join(self._bad_langs)+"<p>"
-        string += "You can find the installation sets and the build log here:<br>"
+        string += "You can find the installation sets here:<br>"
         string += "<a href=ftp://"+self._upload_server+self._upload_path+">ftp://"+self._upload_server+self._upload_path+"</a>"
         self._log.info("Comment:\n")
         eisc.add_comment(string, "Ivo Hinkelmann", "ivo.hinkelmann@openoffice.org")
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.