diff options
| author | Danilo M. <danix@danix.xyz> | 2026-10-20 20:21:34 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-10-20 20:21:34 +0200 |
| commit | 91f882df97adea262625a45be0257039f144ae49 (patch) | |
| tree | d7aee7910f79b63ac049579dcf56ce7b8b1b7b7b /remote/sbb-remote | |
| parent | 552d8e5bb6ba6537b7031318bc5a8d7e92c971b4 (diff) | |
| download | sb-builder-91f882df97adea262625a45be0257039f144ae49.tar.gz sb-builder-91f882df97adea262625a45be0257039f144ae49.zip | |
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 <noreply@anthropic.com>
Diffstat (limited to 'remote/sbb-remote')
| -rwxr-xr-x | remote/sbb-remote | 11 |
1 files changed, 10 insertions, 1 deletions
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)), |
