mirror of
https://git.yoctoproject.org/meta-arm
synced 2026-01-11 15:00:39 +00:00
scripts/machine-summary: link patches to cgit
Add links from the patch names to the patches in cgit for ease of inspection. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Jon Mason <jon.mason@arm.com>
This commit is contained in:
@@ -49,6 +49,19 @@ def layer_path(layername: str, d) -> pathlib.Path:
|
|||||||
return layer_path.cache[layername]
|
return layer_path.cache[layername]
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
def get_url_for_patch(layer: str, localpath: pathlib.Path, d) -> str:
|
||||||
|
relative = localpath.relative_to(layer_path(layer, d))
|
||||||
|
|
||||||
|
# TODO: use layerindexlib
|
||||||
|
# TODO: assumes default branch
|
||||||
|
if layer == "core":
|
||||||
|
return f"https://git.openembedded.org/openembedded-core/tree/meta/{relative}"
|
||||||
|
elif layer in ("meta-arm", "meta-arm-bsp", "arm-toolchain", "meta-atp", "meta-gem5"):
|
||||||
|
return f"https://git.yoctoproject.org/meta-arm/tree/{layer}/{relative}"
|
||||||
|
else:
|
||||||
|
print(f"WARNING: Don't know web URL for layer {layer}", file=sys.stderr)
|
||||||
|
return None
|
||||||
|
|
||||||
def extract_patch_info(src_uri, d):
|
def extract_patch_info(src_uri, d):
|
||||||
"""
|
"""
|
||||||
Parse the specified patch entry from a SRC_URI and return (base name, layer name, status) tuple
|
Parse the specified patch entry from a SRC_URI and return (base name, layer name, status) tuple
|
||||||
@@ -56,9 +69,10 @@ def extract_patch_info(src_uri, d):
|
|||||||
import bb.fetch, bb.utils
|
import bb.fetch, bb.utils
|
||||||
|
|
||||||
info = {}
|
info = {}
|
||||||
localpath = bb.fetch.decodeurl(src_uri)[2]
|
localpath = pathlib.Path(bb.fetch.decodeurl(src_uri)[2])
|
||||||
info["name"] = os.path.basename(localpath)
|
info["name"] = localpath.name
|
||||||
info["layer"] = bb.utils.get_file_layer(localpath, d)
|
info["layer"] = bb.utils.get_file_layer(str(localpath), d)
|
||||||
|
info["url"] = get_url_for_patch(info["layer"], localpath, d)
|
||||||
|
|
||||||
status = "Unknown"
|
status = "Unknown"
|
||||||
with open(localpath, errors="ignore") as f:
|
with open(localpath, errors="ignore") as f:
|
||||||
|
|||||||
@@ -47,8 +47,11 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
{% for pinfo in data.patches %}
|
{% for pinfo in data.patches %}
|
||||||
<tr>
|
<tr>
|
||||||
<!-- TODO links to cgit -->
|
<td>
|
||||||
<td>{{ pinfo.name }}</td>
|
{% if pinfo.url %}<a href="{{pinfo.url}}">{% endif %}
|
||||||
|
{{ pinfo.name }}
|
||||||
|
{% if pinfo.url %}</a>{% endif %}
|
||||||
|
</td>
|
||||||
<td>{{ pinfo.layer }}</td>
|
<td>{{ pinfo.layer }}</td>
|
||||||
<!-- TODO: tooltip with full status? -->
|
<!-- TODO: tooltip with full status? -->
|
||||||
<td class="has-text-centered">{{ make_patch_tag(pinfo.status)}}</td>
|
<td class="has-text-centered">{{ make_patch_tag(pinfo.status)}}</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user