From 83272edc5241befaecf436e7f82a083f84998102 Mon Sep 17 00:00:00 2001 From: Project516 <138796702+Project516@users.noreply.github.com> Date: Mon, 12 Oct 2026 17:36:59 -0500 Subject: [PATCH] Upstream watch: read L4T versions from NVIDIA's package index --- scripts/ci/upstream_watch.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/scripts/ci/upstream_watch.py b/scripts/ci/upstream_watch.py index 0f7adc1..6ab0e0d 100755 --- a/scripts/ci/upstream_watch.py +++ b/scripts/ci/upstream_watch.py @@ -15,6 +15,7 @@ import subprocess import sys import tempfile +import urllib.error import urllib.request REPO = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) @@ -170,15 +171,23 @@ def report_allwpilib(): def report_l4t(): pinned = pin("config.env", r"^L4T_VERSION=([\d.]+)") - major_minor = ".".join(pinned.split(".")[:2]) # 36.5 + ver = lambda v: [int(x) for x in v.split(".")] try: - html = urllib.request.urlopen("https://repo.download.nvidia.com/jetson/common/dists/", timeout=30).read().decode() - except Exception as e: + html = urllib.request.urlopen("https://repo.download.nvidia.com/jetson/", timeout=60).read().decode() + except urllib.error.HTTPError as e: + if e.code == 404: + raise RuntimeError("NVIDIA's apt index is gone (404): the L4T check needs a new URL") print(f" couldn't reach NVIDIA's apt repo ({e}): L4T not checked this run") return "unchecked" - found = sorted({m for m in re.findall(r"r(\d+\.\d+)/", html) if m.split(".")[0] == pinned.split(".")[0]}, - key=lambda v: [int(x) for x in v.split(".")]) - newer = [v for v in found if [int(x) for x in v.split(".")] > [int(x) for x in major_minor.split(".")]] + except OSError as e: + print(f" couldn't reach NVIDIA's apt repo ({e}): L4T not checked this run") + return "unchecked" + # The index lists every package file; nvidia-l4t-core's version is the L4T release. t234 is Orin. + found = sorted({m for m in re.findall(r"t234/pool/main/n/nvidia-l4t-core/nvidia-l4t-core_(\d+\.\d+\.\d+)-", html) + if m.split(".")[0] == pinned.split(".")[0]}, key=ver) + if not found: + raise RuntimeError("no t234 nvidia-l4t-core packages in NVIDIA's index: its format changed") + newer = [v for v in found if ver(v) > ver(pinned)] if not newer: return None return {