19FILE_DIR = os.path.dirname(os.path.abspath(__file__))
20INFRA_BOTS_DIR = os.path.realpath(os.path.join(FILE_DIR, os.pardir, os.pardir))
21sys.path.insert(0, INFRA_BOTS_DIR)
26URL =
'https://ftp.debian.org/debian/pool/main/b/binutils/binutils-x86-64-linux-gnu_2.31.1-16_amd64.deb'
27SHA256 =
'c1da1cffff8a024b5eca0a6795558d9e0ec88fbd24fe059490dc665dc5cac92f'
32 'x86_64-linux-gnu-strip':
'strip',
38 subprocess.check_call([
'wget',
'--output-document=binutils.deb',
'--quiet', URL])
39 output = subprocess.check_output([
'sha256sum',
'binutils.deb'], encoding=
'utf-8')
40 actual_hash = output.split(
' ')[0]
41 if actual_hash != SHA256:
42 raise Exception(
'SHA256 does not match (%s != %s)' % (actual_hash, SHA256))
44 subprocess.check_call([
'ar',
'x',
'binutils.deb'])
46 subprocess.check_call([
'tar',
'-xf',
'data.tar.xz'])
47 for (orig, copy)
in to_copy.items():
48 shutil.copy(os.path.join(
'usr',
'bin', orig), os.path.join(target_dir, copy))
52 parser = argparse.ArgumentParser()
53 parser.add_argument(
'--target_dir',
'-t', required=
True)
54 args = parser.parse_args()
58if __name__ ==
'__main__':
def create_asset(target_dir)