mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[utils] Inline caffeinate logic into sole client.
- This eliminates the last client of `SwiftBuildSupport.check_call`, which is now replaced by `swift_build_support.shell.call`. - Part of SR-237.
This commit is contained in:
@@ -18,7 +18,6 @@ except ImportError:
|
||||
import configparser as ConfigParser
|
||||
|
||||
import os
|
||||
import platform
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
@@ -70,28 +69,6 @@ SWIFT_BUILD_ROOT = os.environ.get(
|
||||
"SWIFT_BUILD_ROOT", os.path.join(SWIFT_SOURCE_ROOT, "build"))
|
||||
|
||||
|
||||
def check_call(args, print_command=False, verbose=False, disable_sleep=False):
|
||||
if disable_sleep:
|
||||
if platform.system() == 'Darwin':
|
||||
# Don't mutate the caller's copy of the arguments.
|
||||
args = list(args)
|
||||
args.insert(0, "caffeinate")
|
||||
|
||||
if print_command:
|
||||
print(os.getcwd() + "$ " + shell.quote_command(args))
|
||||
sys.stdout.flush()
|
||||
try:
|
||||
return subprocess.check_call(args)
|
||||
except subprocess.CalledProcessError as e:
|
||||
diagnostics.fatal(
|
||||
"command terminated with a non-zero exit status " +
|
||||
str(e.returncode) + ", aborting")
|
||||
except OSError as e:
|
||||
diagnostics.fatal(
|
||||
"could not execute '" + shell.quote_command(args) +
|
||||
"': " + e.strerror)
|
||||
|
||||
|
||||
def check_output(args, print_command=False, verbose=False):
|
||||
if print_command:
|
||||
print(os.getcwd() + "$ " + shell.quote_command(args))
|
||||
|
||||
Reference in New Issue
Block a user