• Home
  • Raw
  • Download

Lines Matching refs:sr

77     for (ShellResult* sr : commands_) {  in ~StampChecker()
78 delete sr; in ~StampChecker()
240 ShellResult* sr = new ShellResult; in CheckStep1() local
241 commands_.push_back(sr); in CheckStep1()
242 sr->op = static_cast<CommandOp>(LOAD_INT(fp)); in CheckStep1()
243 LOAD_STRING(fp, &sr->shell); in CheckStep1()
244 LOAD_STRING(fp, &sr->shellflag); in CheckStep1()
245 LOAD_STRING(fp, &sr->cmd); in CheckStep1()
246 LOAD_STRING(fp, &sr->result); in CheckStep1()
248 if (sr->op == CommandOp::FIND) { in CheckStep1()
252 sr->missing_dirs.push_back(s); in CheckStep1()
257 sr->files.push_back(s); in CheckStep1()
262 sr->read_dirs.push_back(s); in CheckStep1()
308 bool ShouldRunCommand(const ShellResult* sr) { in ShouldRunCommand() argument
309 if (sr->op != CommandOp::FIND) in ShouldRunCommand()
313 for (const string& dir : sr->missing_dirs) { in ShouldRunCommand()
317 for (const string& file : sr->files) { in ShouldRunCommand()
321 for (const string& dir : sr->read_dirs) { in ShouldRunCommand()
344 bool CheckShellResult(const ShellResult* sr, string* err) { in CheckShellResult() argument
345 if (sr->op == CommandOp::READ_MISSING) { in CheckShellResult()
346 if (Exists(sr->cmd)) { in CheckShellResult()
348 printf("file %s: dirty\n", sr->cmd.c_str()); in CheckShellResult()
351 sr->cmd.c_str()); in CheckShellResult()
355 printf("file %s: clean\n", sr->cmd.c_str()); in CheckShellResult()
359 if (sr->op == CommandOp::READ) { in CheckShellResult()
360 double ts = GetTimestamp(sr->cmd); in CheckShellResult()
363 printf("file %s: dirty\n", sr->cmd.c_str()); in CheckShellResult()
366 sr->cmd.c_str()); in CheckShellResult()
370 printf("file %s: clean\n", sr->cmd.c_str()); in CheckShellResult()
374 if (sr->op == CommandOp::WRITE || sr->op == CommandOp::APPEND) { in CheckShellResult()
376 fopen(sr->cmd.c_str(), (sr->op == CommandOp::WRITE) ? "wb" : "ab"); in CheckShellResult()
381 if (fwrite(&sr->result[0], sr->result.size(), 1, f) != 1) { in CheckShellResult()
390 printf("file %s: clean (write)\n", sr->cmd.c_str()); in CheckShellResult()
394 if (!ShouldRunCommand(sr)) { in CheckShellResult()
396 printf("shell %s: clean (no rerun)\n", sr->cmd.c_str()); in CheckShellResult()
401 if (fc.Parse(sr->cmd) && !fc.chdir.empty() && ShouldIgnoreDirty(fc.chdir)) { in CheckShellResult()
403 printf("shell %s: ignored\n", sr->cmd.c_str()); in CheckShellResult()
407 COLLECT_STATS_WITH_SLOW_REPORT("shell time (regen)", sr->cmd.c_str()); in CheckShellResult()
409 RunCommand(sr->shell, sr->shellflag, sr->cmd, RedirectStderr::DEV_NULL, in CheckShellResult()
412 if (sr->result != result) { in CheckShellResult()
414 printf("shell %s: dirty\n", sr->cmd.c_str()); in CheckShellResult()
417 sr->cmd.c_str()); in CheckShellResult()
422 printf("shell %s: clean (rerun)\n", sr->cmd.c_str()); in CheckShellResult()
448 for (ShellResult* sr : commands_) { in CheckStep2()
450 if (CheckShellResult(sr, &err)) { in CheckStep2()