def update_tooltool_manifests(build_dir, gecko_dir): system = os.path.basename(build_dir) new_manifest_file = os.path.join(build_dir, 'releng.manifest') manifest = tooltool.open_manifest(new_manifest_file) for manifest_glob in PLATFORM_MANIFESTS[system]: for platform_manifest_file in glob.glob(os.path.join(gecko_dir, manifest_glob)): print(platform_manifest_file) platform_manifest = tooltool.open_manifest(platform_manifest_file) for i, f in enumerate(platform_manifest.file_records): if f.filename.startswith('sccache'): platform_manifest.file_records[i] = manifest.file_records[0] rewrite_manifest_entry(platform_manifest_file, manifest, i) break
def update_tooltool_manifests(build_dir, gecko_dir): system = os.path.basename(build_dir) new_manifest_file = os.path.join(build_dir, 'releng.manifest') rev = open(os.path.join(build_dir, 'REV'), 'rb').read().strip() manifest = tooltool.open_manifest(new_manifest_file) b = io.BytesIO() manifest.dump(b) new_data = '\n'.join(['{', ' "version": "sccache rev %s",' % rev] + b.getvalue().strip(' \n[]').splitlines()[1:]) for manifest_glob in PLATFORM_MANIFESTS[system]: for platform_manifest_file in glob.glob(os.path.join(gecko_dir, manifest_glob)): print(platform_manifest_file) platform_manifest = tooltool.open_manifest(platform_manifest_file) for i, f in enumerate(platform_manifest.file_records): if f.filename.startswith('sccache'): platform_manifest.file_records[i] = manifest.file_records[0] rewrite_manifest_entry(platform_manifest_file, new_data, i) break
def getDigests(manifest): manifest = tooltool.open_manifest(manifest) return [(x.digest, x.algorithm) for x in manifest.file_records]