the disk. You can disable its usage with @env{$REDO_NO_SYNC=1}
environment variable, for speeding up the build process.
+If redo sees some target modified externally, then by default it warns
+user about that, does not build that target, but continues the build
+process further. That is convenient in most cases: you can build your
+project with manual targets alterings, without touching possibly more
+complicated @file{.do} files. With @env{$REDO_STOP_IF_MODIFIED=1} redo
+won't continue and will exit with failure message.
+
There are other commands that could be found in other implementations too:
@table @command
@item check that @file{stdout} and @file{$3} are not written simultaneously
@item check that generated target was not modified "externally" outside
the redo, preventing its overwriting, but continuing the build
+ (optionally can stop)
@end itemize
@item recursive, indented and serialized logs display ability, with
priority to the depth and bad return codes, like in @command{apenwarr/redo},
corresponding targets has the same content but different
@code{ctime}/@code{mtime} values and rewrites dependencies with that
updated inode information.
+@item
+ With @env{$REDO_STOP_IF_MODIFIED=1} environment variable redo will
+ stop and fail if it meet externally modified file. By default user
+ is only warned about it, but building continues for convenience.
@end itemize
@anchor{Release 1_21_0}
}
NoColor = os.Getenv(EnvNoColor) != ""
NoSync = os.Getenv(EnvNoSync) == "1"
+ StopIfMod = os.Getenv(EnvStopIfMod) == "1"
switch s := os.Getenv(EnvInodeTrust); s {
case "none":
InodeTrust = InodeTrustNone
EnvStderrKeep = "REDO_LOGS"
EnvStderrSilent = "REDO_SILENT"
EnvNoSync = "REDO_NO_SYNC"
+ EnvStopIfMod = "REDO_STOP_IF_MODIFIED"
RedoDir = ".redo"
LockSuffix = ".lock"
StderrKeep = false
StderrSilent = false
StderrPrefix string
+ StopIfMod = false
Jobs sync.WaitGroup
flagTrace *bool
return TgtError{tgtOrig, err}
}
if modified {
- tracef(CWarn, "%s externally modified: not redoing", tgtOrig)
lockRelease()
+ if StopIfMod {
+ return fmt.Errorf("%s externally modified", tgtOrig)
+ }
+ tracef(CWarn, "%s externally modified: not redoing", tgtOrig)
go func() {
errs <- nil
}()