blob: 9c24d3feadefa5e8f4c8c8342b8e6e9d6bed9ff3 [file] [log] [blame]
#!/usr/bin/env python3
# Copyright 2022 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Print information about what git revisions the currently downloaded jiri
# package was built from.
import subprocess
import tempfile
import json
import os
dir_path = os.path.dirname(os.path.realpath(__file__))
fuchsia_root = os.path.abspath(os.path.join(dir_path, "../../../../"))
cipd_path = os.path.join(fuchsia_root, ".jiri_root/bin/cipd")
package_name = "fuchsia/third_party/intel/media-driver/codec_runner_intel_gen-debug-x64"
version = subprocess.check_output(
[
"jiri", "manifest", "-element=" + package_name,
'-template="{{.Version}}"',
os.path.join(fuchsia_root, "integration/fuchsia/prebuilts")
]).strip().strip(b'"')
with tempfile.NamedTemporaryFile() as temp_file:
tag_output = subprocess.check_output(
[
cipd_path, "describe", package_name, "-version", version,
"-json-output", temp_file.name
])
tagjson = json.load(temp_file)
tags = tagjson["result"]["tags"]
for result in tags:
tagvalue = result["tag"]
if "git_revision" not in tagvalue:
continue
print(tagvalue)