From 91f882df97adea262625a45be0257039f144ae49 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Tue, 20 Oct 2026 20:21:34 +0200 Subject: sbb-remote 0.9.0: SBo orphans tile on the Dashboard stats gains "orphans", the packages whose .info says MAINTAINER="orphaned - no maintainer" (0.14s over the tree on the VM). The placeholder tile shows the count and opens Packages with only the orphaned chip on. Co-Authored-By: Claude Opus 5.5 --- remote/sbb-remote | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'remote') diff --git a/remote/sbb-remote b/remote/sbb-remote index 5f01186..1c87f80 100755 --- a/remote/sbb-remote +++ b/remote/sbb-remote @@ -40,7 +40,7 @@ import time import tomllib import urllib.request -VERSION = "0.8.0" +VERSION = "0.9.0" DEFAULTS = { "state_dir": "/var/lib/sb-builder", "repo_dir": "/var/lib/sbopkg/SBo-danix", @@ -416,6 +416,14 @@ def _packages(cfg): "shadowed": len(shadowed)} +def _orphans(cfg): + """Packages SBo marks MAINTAINER="orphaned - no maintainer"; None without a repo.""" + if not os.path.isdir(cfg["repo_dir"]): + return None + return sum(re.search(r'^MAINTAINER="orphaned', _read(os.path.join(d, os.path.basename(d) + ".info")) or "", + re.M) is not None for d in _pkgdirs(cfg["repo_dir"], "*/*")) + + def _slackrepo(cfg): db = sqlite3.connect(f"file:{cfg['slackrepo_db']}?mode=ro", uri=True) try: @@ -478,6 +486,7 @@ def cmd_stats(cfg): "disk": {"total": root and root.total, "free": root and root.free}, "slackpkg": _slackpkg(), "packages": _try(lambda: _packages(cfg)), + "orphans": _try(lambda: _orphans(cfg)), "sync": {o: _try(lambda o=o: int(_git(cfg, "log", "-1", "--format=%ct", "--", o + "/"))) for o in cfg["overlays"]}, "slackrepo": _try(lambda: _slackrepo(cfg)), -- cgit v1.2.3