diff --git a/scripts/compare_pkg_completeness.py b/scripts/compare_pkg_completeness.py index b8035ba1..7ee2ecca 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 @@ -354,15 +356,19 @@ 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} + # index version or source repository, but installable all the same. Rolling's + # ros-rolling-* names are skipped here: they are empty shims pinning the + # ros2-* package of the same version, so a row of their own would duplicate + # every package on the page. + prefix = f"{package_prefix}-" + released = {f"{package_prefix}-{name.replace('_', '-')}" for name in index} for conda_name in sorted(set(builds) - released): if not conda_name.startswith(prefix): continue packages.append( [ conda_name.removeprefix(prefix), + conda_name, "", "", newest_build.get(conda_name, 0) // 1000, @@ -379,7 +385,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 +429,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..6b64edaa 100644 --- a/src/components/package-table/PackageTable.svelte +++ b/src/components/package-table/PackageTable.svelte @@ -473,7 +473,10 @@ {/if} {#each slice as row, i (row.name)} - {@const conda = "ros-" + distro + "-" + row.name} + {@const conda = row.condaName} + + {@const prefix = conda.slice(0, conda.length - row.name.length)} {@const rosName = row.name.replace(/-/g, "_")} @@ -490,7 +493,7 @@ > - ros-{distro}-{row.name} + {prefix}{row.name}