]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #107808 - kadiwa4:built-unsuccessfully, r=albertlarsan68
authorMatthias Krüger <matthias.krueger@famsik.de>
Thu, 9 Feb 2023 10:21:58 +0000 (11:21 +0100)
committerGitHub <noreply@github.com>
Thu, 9 Feb 2023 10:21:58 +0000 (11:21 +0100)
bootstrap.py: fix build-failure message

A small mistake I did.
Corrects #107470, fixes #107804

r? `@albertlarsan68` (since you reviewed the last one)

1  2 
src/bootstrap/bootstrap.py

index c298817895cd17c00cfdea87d99b01f5c4a4946e,0c896733a26d1a9f87acbcc48a0316ea94ea6435..45f238ef4bf1f7202d5cfbe7bc3fcea992e7d139
@@@ -87,16 -87,14 +87,16 @@@ def _download(path, url, probably_big, 
          # If curl is not present on Win32, we should not sys.exit
          #   but raise `CalledProcessError` or `OSError` instead
          require(["curl", "--version"], exception=platform_is_win32)
 -        run(["curl", option,
 -             "-L", # Follow redirect.
 -             "-y", "30", "-Y", "10",    # timeout if speed is < 10 bytes/sec for > 30 seconds
 -             "--connect-timeout", "30",  # timeout if cannot connect within 30 seconds
 -             "--retry", "3", "-Sf", "-o", path, url],
 -            verbose=verbose,
 -            exception=True, # Will raise RuntimeError on failure
 -        )
 +        with open(path, "wb") as outfile:
 +            run(["curl", option,
 +                "-L", # Follow redirect.
 +                "-y", "30", "-Y", "10",    # timeout if speed is < 10 bytes/sec for > 30 seconds
 +                "--connect-timeout", "30",  # timeout if cannot connect within 30 seconds
 +                "--retry", "3", "-Sf", url],
 +                stdout=outfile,    #Implements cli redirect operator '>'
 +                verbose=verbose,
 +                exception=True, # Will raise RuntimeError on failure
 +            )
      except (subprocess.CalledProcessError, OSError, RuntimeError):
          # see http://serverfault.com/questions/301128/how-to-download
          if platform_is_win32:
@@@ -937,6 -935,7 +937,7 @@@ def main()
          )
  
      exit_code = 0
+     success_word = "successfully"
      try:
          bootstrap(args)
      except (SystemExit, KeyboardInterrupt) as error:
          else:
              exit_code = 1
              print(error)
+         success_word = "unsuccessfully"
  
      if not help_triggered:
-         print("Build completed successfully in", format_build_time(time() - start_time))
+         print("Build completed", success_word, "in", format_build_time(time() - start_time))
      sys.exit(exit_code)