Example #1
0
        public static int SaveToolStdout(BinaryInfo info, string extra_args, MBFile stdout,
                                         IBuildContext ctxt, bool fatal, string message)
        {
            string stderr;
            int    code = SaveToolStdout(info, extra_args, stdout, out stderr, ctxt);

            if (code != 0)
            {
                string detail = info.ToUnixStyle(ctxt) + " " + extra_args + ":\n" + stderr;

                if (fatal)
                {
                    ctxt.Logger.Error(3003, message, detail);
                }
                else
                {
                    ctxt.Logger.Warning(3004, message, detail);
                }
            }
            else if (stderr.Length > 0)
            {
                // FIXME: is this a good idea?
                string detail = info.ToUnixStyle(ctxt) + " " + extra_args + ":\n" + stderr;

                ctxt.Logger.Warning(3010, "Tool warning:", detail);
            }

            return(code);
        }
Example #2
0
        public static string GetToolStdout(BinaryInfo info, string extra_args, bool report,
                                           IBuildContext ctxt)
        {
            int    exit_code;
            string stderr;

            string res = GetToolStdout(info, extra_args, out exit_code, out stderr, ctxt);

            if (exit_code != 0)
            {
                if (report)
                {
                    string detail = info.ToUnixStyle(ctxt) + " " + extra_args + ":\n" + stderr;
                    ctxt.Logger.Error(3003, "Tool error:", detail);
                }

                return(null);
            }

            return(res);
        }
Example #3
0
		public static int SaveToolStdout (BinaryInfo info, string extra_args, MBFile stdout, 
						  IBuildContext ctxt, bool fatal, string message) 
		{
		    string stderr;
		    int code = SaveToolStdout (info, extra_args, stdout, out stderr, ctxt);

		    if (code != 0) {
			string detail = info.ToUnixStyle (ctxt) + " " + extra_args + ":\n" + stderr;

			if (fatal)
			    ctxt.Logger.Error (3003, message, detail);
			else
			    ctxt.Logger.Warning (3004, message, detail);
		    } else if (stderr.Length > 0) {
			// FIXME: is this a good idea?
			string detail = info.ToUnixStyle (ctxt) + " " + extra_args + ":\n" + stderr;

			ctxt.Logger.Warning (3010, "Tool warning:", detail);
		    }

		    return code;
		}
Example #4
0
		public static int RunTool (BinaryInfo info, string extra_args, IBuildContext ctxt,
					   bool fatal, string message) {
			string stdout, stderr;
			int result = RunTool (info, extra_args, out stdout, out stderr, ctxt);

			if (result != 0) {
				string detail = info.ToUnixStyle (ctxt) + " " + extra_args + ":\n" + stdout + "\n" + stderr;

				if (fatal)
					ctxt.Logger.Error (3003, message, detail);
				else
					ctxt.Logger.Warning (3004, message, detail);
			} else if (stderr.Length > 0) {
				// FIXME: is this a good idea?
				string detail = info.ToUnixStyle (ctxt) + " " + extra_args + ":\n" + stderr;

				ctxt.Logger.Warning (3010, "Tool warning:", detail);
			}

			return result;
		}
Example #5
0
		public static string GetToolStdout (BinaryInfo info, string extra_args, bool report, 
						    IBuildContext ctxt) {
		    int exit_code;
		    string stderr;

		    string res = GetToolStdout (info, extra_args, out exit_code, out stderr, ctxt);

		    if (exit_code != 0) {
			if (report) {
			    string detail = info.ToUnixStyle (ctxt) + " " + extra_args + ":\n" + stderr;
			    ctxt.Logger.Error (3003, "Tool error:", detail);
			}

			return null;
		    }

		    return res;
		}