]> Cypherpunks.ru repositories - goredo.git/blobdiff - ifchange.go
default.do-s must not depend on themselves
[goredo.git] / ifchange.go
index 0f430fdebd76741065215382cb76ee406690e3fe..128d1afbef6eaea5fdd1681af86cb1339ec8f738 100644 (file)
@@ -116,7 +116,7 @@ func buildDependants(tgts []string) map[string]struct{} {
        }
        ok := true
        for i := 0; i < len(seen); i++ {
-               ok = ok && isOkRun(<-errs)
+               ok = isOkRun(<-errs) && ok
        }
        Jobs.Wait()
        close(errs)
@@ -163,7 +163,7 @@ RebuildDeps:
                jobs++
        }
        for i := 0; i < jobs; i++ {
-               ok = ok && isOkRun(<-errs)
+               ok = isOkRun(<-errs) && ok
        }
        if !ok {
                trace(CDebug, "dependants failed, skipping them")
@@ -180,7 +180,9 @@ RebuildDeps:
 
 func ifchange(tgts []string, forced, traced bool) (bool, error) {
        jsInit()
-       defer jsAcquire("ifchange exiting")
+       if !IsTopRedo {
+               defer jsAcquire("ifchange exiting")
+       }
        defer Jobs.Wait()
        seen := buildDependants(tgts)
        oodTgtsClear()
@@ -215,7 +217,7 @@ func ifchange(tgts []string, forced, traced bool) (bool, error) {
        }
        ok := true
        for ; jobs > 0; jobs-- {
-               ok = ok && isOkRun(<-errs)
+               ok = isOkRun(<-errs) && ok
        }
        return ok, nil
 }