mirror of
https://github.com/servo/servo.git
synced 2025-06-29 19:43:39 +01:00
Tidy
This commit is contained in:
parent
6e6870516e
commit
484eee8624
9 changed files with 50 additions and 16 deletions
|
@ -72,7 +72,6 @@ class MachCommands(CommandBase):
|
|||
system_image = "google_apis;armeabi-v7a"
|
||||
avd_name = "servo-armv7"
|
||||
|
||||
|
||||
toolchains = path.join(self.context.topdir, "android-toolchains")
|
||||
if not path.isdir(toolchains):
|
||||
os.makedirs(toolchains)
|
||||
|
|
|
@ -153,6 +153,7 @@ def download_file(desc, src, dst):
|
|||
download(desc, src, fd)
|
||||
os.rename(tmp_path, dst)
|
||||
|
||||
|
||||
# https://stackoverflow.com/questions/39296101/python-zipfile-removes-execute-permissions-from-binaries
|
||||
# In particular, we want the executable bit for executable files.
|
||||
class ZipFileWithUnixPermissions(zipfile.ZipFile):
|
||||
|
@ -169,6 +170,7 @@ class ZipFileWithUnixPermissions(zipfile.ZipFile):
|
|||
os.chmod(extracted, mode)
|
||||
return extracted
|
||||
|
||||
|
||||
def extract(src, dst, movedir=None, remove=True):
|
||||
assert src.endswith(".zip")
|
||||
ZipFileWithUnixPermissions(src).extractall(dst)
|
||||
|
@ -183,6 +185,7 @@ def extract(src, dst, movedir=None, remove=True):
|
|||
if remove:
|
||||
os.remove(src)
|
||||
|
||||
|
||||
def check_hash(filename, expected, algorithm):
|
||||
hasher = hashlib.new(algorithm)
|
||||
with open(filename, "rb") as f:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue