Chromium change: https://source.chromium.org/chromium/chromium/src/+/d8cc01ec95f50e75b972b4285192f12277a30595 commit d8cc01ec95f50e75b972b4285192f12277a30595 Author: Xiaoling Bao <xiaolingbao@chromium.org> Date: Fri Aug 5 18:57:24 2022 +0000 Check in lzma 7zz command for mac. The 7zz command originates from: https://7-zip.org/a/7z2107-mac.tar.xz. Created lzma_sdk/bin/mac64 folder for the new binary. sha1 hash digest: c62266f7da3108bef870086c456d002ae8ffe089 sha256 hash digest: c194cd5b88d5cf5842df4f6e5b082ac593780aabc221de01558a4fa58850c43e Moved lzma_sdk/bin/7z*.exe to lzma_sdk/bin/win64/7z*.exe and updated the references. Bug: 1348343
43 lines
1.4 KiB
Python
43 lines
1.4 KiB
Python
#!/usr/bin/env python
|
|
|
|
import argparse
|
|
import sys
|
|
import os
|
|
import subprocess
|
|
from lib.util import scoped_cwd, make_zip, tempdir
|
|
|
|
|
|
def GetLZMAExec():
|
|
root_src_dir = os.path.abspath(os.path.join(
|
|
os.path.dirname(__file__), *[os.pardir] * 2))
|
|
if sys.platform == 'win32':
|
|
lzma_exec = os.path.join(root_src_dir, "third_party",
|
|
"lzma_sdk", "bin", "win64", "7za.exe")
|
|
elif sys.platform == 'darwin':
|
|
lzma_exec = os.path.join(root_src_dir, "..", "..", "third_party",
|
|
"lzma_sdk", "bin", "mac64", "7zz")
|
|
else:
|
|
lzma_exec = '7zr' # Use system 7zr.
|
|
return lzma_exec
|
|
|
|
|
|
def main():
|
|
parser = argparse.ArgumentParser()
|
|
parser.add_argument('--output', help='Path to output archive.')
|
|
parser.add_argument('--input', help='Path to input archive.')
|
|
parser.add_argument('--target_dir',
|
|
help='If provided, the paths in the archive will be '
|
|
'relative to this directory', default='.')
|
|
args = parser.parse_args()
|
|
|
|
temp_dir = tempdir('brave_archive')
|
|
lzma_exec = GetLZMAExec()
|
|
cmd = [lzma_exec, 'x', args.input, '-y', '-o' + temp_dir]
|
|
subprocess.check_call(cmd, stdout=subprocess.PIPE, shell=False)
|
|
with scoped_cwd(os.path.join(temp_dir, args.target_dir)):
|
|
make_zip(args.output, [], ['.'])
|
|
|
|
|
|
if __name__ == '__main__':
|
|
sys.exit(main())
|