From 36d87a6d53ecec0ef2634577a15923f50b817e4a Mon Sep 17 00:00:00 2001 From: Maurice Date: Sun, 23 Aug 2026 20:25:00 +0700 Subject: [PATCH 1/3] Add ros2 package names to Rolling page Signed-off-by: Maurice --- scripts/compare_pkg_completeness.py | 44 +++++++++++++------ .../package-table/PackageTable.svelte | 4 +- src/components/package-table/data.ts | 17 +++++-- src/content/docs/GettingStarted.mdx | 3 +- src/content/docs/conda.mdx | 6 ++- src/content/docs/micromamba.mdx | 6 ++- src/data/distros.ts | 4 ++ src/pages/[distro].astro | 13 +++++- 8 files changed, 72 insertions(+), 25 deletions(-) diff --git a/scripts/compare_pkg_completeness.py b/scripts/compare_pkg_completeness.py index b8035ba1..aea69aa3 100644 --- a/scripts/compare_pkg_completeness.py +++ b/scripts/compare_pkg_completeness.py @@ -278,7 +278,7 @@ def collect_builds( for bit, platform in enumerate(PLATFORMS): for artifact in repos[platform]: name = artifact["name"] - if not name.startswith("ros-") or name in MUTEX_NAMES: + if not (name.startswith("ros-") or name.startswith("ros2-")) or name in MUTEX_NAMES: continue newest_build[name] = max( @@ -332,8 +332,9 @@ def slots(per_mutex: dict[str, Slot]) -> list[Any]: return [[per_mutex[v].mask, per_mutex[v].version] if v in per_mutex else 0 for v in mutexes] packages: list[list[Any]] = [] + package_prefix = "ros2" if distro == "rolling" else f"ros-{distro}" for name in sorted(index): - conda_name = f"ros-{distro}-{name.replace('_', '-')}" + conda_name = f"{package_prefix}-{name.replace('_', '-')}" per_mutex = builds.get(conda_name, {}) entry = index[name] @@ -343,7 +344,8 @@ def slots(per_mutex: dict[str, Slot]) -> list[Any]: packages.append( [ - name.replace("_", "-"), # conda spelling, `ros--` stripped + name.replace("_", "-"), # conda spelling, distro prefix stripped + conda_name, metadata.get(name, ""), entry.version, # as released into the ROS index newest_build.get(conda_name, 0) // 1000, # newest build, seconds @@ -353,17 +355,24 @@ def slots(per_mutex: dict[str, Slot]) -> list[Any]: ] ) - # Packages on the channel that rosdistro has never released: no description, - # index version or source repository, but installable all the same. - prefix = f"ros-{distro}-" - released = {f"ros-{distro}-{name.replace('_', '-')}" for name in index} + # Exact channel artifacts without a primary rosdistro row. This includes + # Rolling's ros-rolling-* compatibility aliases and genuinely extra recipes. + # They have no index version or source link, but remain installable. Reuse a + # description when their suffix matches a package in the distribution cache. + prefixes = ("ros2-", "ros-rolling-") if distro == "rolling" else (f"ros-{distro}-",) + released = {f"{package_prefix}-{name.replace('_', '-')}" for name in index} for conda_name in sorted(set(builds) - released): - if not conda_name.startswith(prefix): + prefix = next((prefix for prefix in prefixes if conda_name.startswith(prefix)), None) + if prefix is None: continue + suffix = conda_name.removeprefix(prefix) + row_name = suffix if prefix != "ros-rolling-" else f"rolling-{suffix}" + description = metadata.get(suffix.replace("-", "_"), "") packages.append( [ - conda_name.removeprefix(prefix), - "", + row_name, + conda_name, + description, "", newest_build.get(conda_name, 0) // 1000, -1, @@ -379,7 +388,16 @@ def slots(per_mutex: dict[str, Slot]) -> list[Any]: "platforms": PLATFORMS, "mutexPackage": mutex_package, "mutexes": mutexes, - "fields": ["name", "desc", "indexVersion", "updated", "repo", "indexed", "builds"], + "fields": [ + "name", + "condaName", + "desc", + "indexVersion", + "updated", + "repo", + "indexed", + "builds", + ], "repos": repo_urls, "packages": packages, } @@ -414,8 +432,8 @@ def refresh(distro: str, channel: str) -> None: total = len(document["packages"]) newest = document["mutexes"][0] if document["mutexes"] else None - on_newest = sum(1 for p in document["packages"] if p[6] and p[6][0]) - ever = sum(1 for p in document["packages"] if any(p[6])) + on_newest = sum(1 for p in document["packages"] if p[7] and p[7][0]) + ever = sum(1 for p in document["packages"] if any(p[7])) print( f" -> {path}: {total} packages, {ever} built at some point, " f"{on_newest} on mutex {newest}, {path.stat().st_size / 1e6:.2f} MB", diff --git a/src/components/package-table/PackageTable.svelte b/src/components/package-table/PackageTable.svelte index 1c5e2575..0c0c5d3c 100644 --- a/src/components/package-table/PackageTable.svelte +++ b/src/components/package-table/PackageTable.svelte @@ -473,7 +473,7 @@ {/if} {#each slice as row, i (row.name)} - {@const conda = "ros-" + distro + "-" + row.name} + {@const conda = row.condaName} {@const rosName = row.name.replace(/-/g, "_")} @@ -490,7 +490,7 @@ > - ros-{distro}-{row.name} + {conda} + {@const prefix = conda.slice(0, conda.length - row.name.length)} {@const rosName = row.name.replace(/-/g, "_")} @@ -490,7 +493,7 @@ > - {conda} + {prefix}{row.name}