mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
Use shutil.unpack_archive.
This commit is contained in:
parent
a1dd8fc883
commit
7f0ecddfb2
1 changed files with 2 additions and 8 deletions
|
@ -3,6 +3,7 @@
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import shutil
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
|
||||||
import urllib.request
|
import urllib.request
|
||||||
|
@ -59,14 +60,7 @@ def sifive_riscv_download():
|
||||||
print("Using existing file", fn)
|
print("Using existing file", fn)
|
||||||
|
|
||||||
print("Extracting", fn)
|
print("Extracting", fn)
|
||||||
if fn.endswith(".tar.gz"):
|
shutil.unpack_archive(fn)
|
||||||
import tarfile
|
|
||||||
with tarfile.open(fn) as t:
|
|
||||||
t.extractall()
|
|
||||||
elif fn.endswith(".zip"):
|
|
||||||
import zipfile
|
|
||||||
with zipfile.open(fn) as z:
|
|
||||||
z.extractall()
|
|
||||||
|
|
||||||
if "--user" in sys.argv[1:] and not is_windows:
|
if "--user" in sys.argv[1:] and not is_windows:
|
||||||
print("Linking compiler into ~/.local/bin")
|
print("Linking compiler into ~/.local/bin")
|
||||||
|
|
Loading…
Reference in a new issue