From: Sergey Matveev Date: Thu, 29 Apr 2021 09:47:36 +0000 (+0300) Subject: Fix REDO_TRACE workability X-Git-Tag: v1.4.0~2 X-Git-Url: http://www.git.cypherpunks.ru/?p=goredo.git;a=commitdiff_plain;h=468a150138cdc10c3ec5ee00a77db06429b47456 Fix REDO_TRACE workability --- diff --git a/doc/news.texi b/doc/news.texi index cbcd68d..6d5baba 100644 --- a/doc/news.texi +++ b/doc/news.texi @@ -1,6 +1,16 @@ @node News @unnumbered News +@anchor{Release 1.4.0} +@section Release 1.4.0 +@itemize +@item + Fixed proper @option{-xx} and @env{REDO_TRACE} workability, that + previously was not applied to all targets. +@item + Updated dependant libraries. +@end itemize + @anchor{Release 1.3.0} @section Release 1.3.0 @itemize diff --git a/main.go b/main.go index a3773f4..f6668c2 100644 --- a/main.go +++ b/main.go @@ -160,10 +160,11 @@ func main() { if *flagTraceAll { mustSetenv(EnvTrace, "1") } - if *flagTrace { + if os.Getenv(EnvTrace) == "1" { + TracedAll = true traced = true } else { - traced = os.Getenv(EnvTrace) == "1" + traced = *flagTrace } // Those are internal envs diff --git a/run.go b/run.go index 2efd2d3..a4aeb87 100644 --- a/run.go +++ b/run.go @@ -67,6 +67,8 @@ var ( flagTraceAll = flag.Bool("xx", false, fmt.Sprintf("trace (sh -x) all targets (%s=1)", EnvTrace)) flagStderrKeep = flag.Bool("logs", false, fmt.Sprintf("keep job's stderr (%s=1)", EnvStderrKeep)) flagStderrSilent = flag.Bool("silent", false, fmt.Sprintf("do not print job's stderr (%s=1)", EnvStderrSilent)) + + TracedAll bool ) type RunErr struct { @@ -304,7 +306,7 @@ func runScript(tgtOrig string, errs chan error, traced bool) error { args = make([]string, 0, 3) } else { cmdName = "/bin/sh" - if traced { + if traced || TracedAll { args = append(args, "-ex") } else { args = append(args, "-e") diff --git a/usage.go b/usage.go index 80bea55..179eb15 100644 --- a/usage.go +++ b/usage.go @@ -24,7 +24,7 @@ import ( ) const ( - Version = "1.3.0" + Version = "1.4.0" Warranty = `Copyright (C) 2020-2021 Sergey Matveev This program is free software: you can redistribute it and/or modify