Commits

Anonymous committed c2324f9

contl10n01: gsicheck error logs + merge in own repository

Comments (0)

Files changed (2)

l10ntools/scripts/tool/commands.py

         reference_list.append("en-US");
         self._default_src_lang = pseudo.PseudoSet(reference_list)
         self._cws_root   = utils.Util.replace_variables(tool_cfg.get("CWS","cws_root"), env, tool_cfg, self._log)  
+        self._cws_root_dir = utils.Util.replace_variables(tool_cfg.get("CWS","cws_root_dir"), env, tool_cfg, self._log)        
         self._l10n_path  = utils.Util.replace_variables(tool_cfg.get("L10N Dir", "l10n_rel_path"), env, tool_cfg, self._log)
         self._lic_header = utils.Util.replace_variables(tool_cfg.get("L10N Dir", "lic_header_rel_path"), env, tool_cfg, self._log)
         self._dest_path  = utils.Util.replace_variables(tool_cfg.get("Download Server", "dest_path"), env, tool_cfg, self._log)  
         [utils.Util.exe_ignore_errors(self._cws_root + "/solenv/bin/gsicheck -l none -k -wc -we " + file, self._log, env, True) 
                 for file in glob.glob(self._dest_path + "/*.sdf") if not file.endswith("_ok.sdf")] 
         files = glob.glob(self._dest_path + "/*_ok.sdf")
+        
+        # Gsicheck all err.sdf again and write the gsicheck log
+        err_files = glob.glob(self._dest_path + "/*_err.sdf")
+        for err_file in err_files:
+            returncode, stdout_value, stderr_value = utils.Util.exe_ignore_errors(self._cws_root + "/solenv/bin/gsicheck -l none -k -c " + err_file, self._log, env, True)
+            try:
+                fh = open( err_file+".log", "w")
+                fh.write(stdout_value)
+                fh.write(stderr_value)
+                fh.close()
+            except IOError:
+                pass
+
         for file in files:
             self._log.info("Processing " + file)
             sdfdata = sdf.SdfData(file)
                     for key,value in sdfdata.iteritems():
                         if value.langid != "en-US":
                             mylist.append(str(value))
-                    utils.Util.makedirs(self._cws_root + "/" + self._l10n_path + "/" + cur_lang[0], self._log)
-                    target_file = self._cws_root + "/" + self._l10n_path + "/" + cur_lang[0] + "/localize.sdf"
+                    utils.Util.makedirs(self._cws_root_dir + "/l10n/" + self._l10n_path + "/" + cur_lang[0], self._log)
+                    target_file = self._cws_root_dir + "/l10n/" + self._l10n_path + "/" + cur_lang[0] + "/localize.sdf"
                     utils.Util.rm(target_file + "_tmp", self._log)
                     utils.Util.rename(target_file, target_file + "_tmp", self._log)
-                    src_file = self._cws_root + "/" + self._lic_header
+                    src_file = self._cws_root_dir + "/l10n/" + self._lic_header
                     utils.Util.copyfile(src_file, target_file, self._log)
                     try:
                         f = open(target_file, "a+") 
         self._server_path       = utils.Util.replace_variables(tool_cfg.get("Upload Server", "server_path"), env, tool_cfg, self._log)
         self._source_pattern    = utils.Util.replace_variables(tool_cfg.get("Upload Server", "source_pattern"), env, tool_cfg, self._log)
         self._sdf_error_pattern = utils.Util.replace_variables(tool_cfg.get("Upload Server", "sdf_error_pattern"), env, tool_cfg, self._log)
+        self._sdf_error_log_pattern = utils.Util.replace_variables(tool_cfg.get("Upload Server", "sdf_error_log_pattern"), env, tool_cfg, self._log)
         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._cws_root = "/cygdrive/" + self._cws_root[0] + self._cws_root[2:]
         if self._sdf_error_pattern[1] == ":":
             self._sdf_error_pattern = "/cygdrive/" + self._sdf_error_pattern[0] + self._sdf_error_pattern[2:]
+        if self._sdf_error_log_pattern[1] == ":":
+            self._sdf_error_log_pattern = "/cygdrive/" + self._sdf_error_log_pattern[0] + self._sdf_error_log_pattern[2:]
+
+
         if self._log_file_pattern[1] == ":":
             self._log_file_pattern = "/cygdrive/" + self._log_file_pattern[0] + self._log_file_pattern[2:]
 
         self._files = glob.glob(self._cws_root+"/"+self._source_pattern)
         self._sdf_error_files = glob.glob(self._sdf_error_pattern)
+        self._sdf_error_files.append(" ".join(glob.glob(self._sdf_error_log_pattern)))
         self._log_files = glob.glob(self._log_file_pattern)
         self._log = log
         

l10ntools/scripts/tool/utils.py

         mail_str = Util.get_platform()+ ": " + text 
         mail_str += "\n\nCWS               = "+self._cws_name
         mail_str += "\nJobID             = "+os.environ["id"] 
-        mail_str += "\nlocation          = "+os.environ["location"]
+        #mail_str += "\nlocation          = "+os.environ["location"]
         state_cfg = StateCfg()
         mail_str += "\ncurrent_state     = "+state_cfg.get("Runtime","current_state")
         mail_str += "\nConnection string = "+os.environ["connectionstring"]