aboutsummaryrefslogtreecommitdiffstats
path: root/remote/sbb-remote
diff options
context:
space:
mode:
Diffstat (limited to 'remote/sbb-remote')
-rwxr-xr-xremote/sbb-remote11
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)),