mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Support dumb terminals in bootstrap downloads
Dumb terminals can only interpret a limited number of control codes, and rewriting the terminal buffer will make `./mach build` very talkative on these terminals. This can be tested by setting the environment variable TERM to "dumb" as such: TERM=dumb ./mach build
This commit is contained in:
parent
340ebdfd85
commit
a5b5d358fb
1 changed files with 5 additions and 2 deletions
|
@ -47,8 +47,11 @@ def download(desc, src, dst):
|
|||
print("\rDownloading %s: %5.1f%%" % (desc, pct), end="")
|
||||
sys.stdout.flush()
|
||||
|
||||
urllib.urlretrieve(src, dst, report)
|
||||
print()
|
||||
print("Downloading %s..." % desc)
|
||||
dumb = os.environ.get("TERM") == "dumb"
|
||||
urllib.urlretrieve(src, dst, None if dumb else report)
|
||||
if not dumb:
|
||||
print()
|
||||
|
||||
def extract(src, dst, movedir=None):
|
||||
tarfile.open(src).extractall(dst)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue