Răsfoiți Sursa

SCons: Don't update node count when empty

Thaddeus Crews 9 luni în urmă
părinte
comite
b536b3e12d
1 a modificat fișierele cu 3 adăugiri și 3 ștergeri
  1. 3 3
      methods.py

+ 3 - 3
methods.py

@@ -872,12 +872,12 @@ def show_progress(env):
                     self.max = int(f.readline())
                     self.max = int(f.readline())
             except OSError:
             except OSError:
                 pass
                 pass
-            if self.max == 0:
-                print("NOTE: Performing initial build, progress percentage unavailable!")
 
 
             # Progress reporting is not available in non-TTY environments since it
             # Progress reporting is not available in non-TTY environments since it
             # messes with the output (for example, when writing to a file).
             # messes with the output (for example, when writing to a file).
             self.display = cast(bool, self.max and env["progress"] and IS_TTY)
             self.display = cast(bool, self.max and env["progress"] and IS_TTY)
+            if self.display and not self.max:
+                print_info("Performing initial build, progress percentage unavailable!")
 
 
         def __call__(self, node, *args, **kw):
         def __call__(self, node, *args, **kw):
             self.count += 1
             self.count += 1
@@ -893,7 +893,7 @@ def show_progress(env):
     Progress(progressor)
     Progress(progressor)
 
 
     def progress_finish():
     def progress_finish():
-        if len(GetBuildFailures()):
+        if GetBuildFailures() or not progressor.count:
             return
             return
         try:
         try:
             with open(NODE_COUNT_FILENAME, "w", encoding="utf-8", newline="\n") as f:
             with open(NODE_COUNT_FILENAME, "w", encoding="utf-8", newline="\n") as f: