From c8306d6c87a40bb800241cccd90831e3893550b5 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Tue, 20 Oct 2026 12:12:40 +0200 Subject: sbb-remote 0.6.0: hint-new takes several packages, no version Each gets the .info pin; Update selected sets a version later. One package that already has a hint refuses the whole job before it starts. Co-Authored-By: Claude Opus 5.5 --- remote/sbb-remote | 8 ++++---- sb_builder/__init__.py | 2 +- tests/test_remote.py | 16 +++++++++------- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/remote/sbb-remote b/remote/sbb-remote index 2674ed6..5183b77 100755 --- a/remote/sbb-remote +++ b/remote/sbb-remote @@ -40,7 +40,7 @@ import time import tomllib import urllib.request -VERSION = "0.5.0" +VERSION = "0.6.0" DEFAULTS = { "state_dir": "/var/lib/sb-builder", "repo_dir": "/var/lib/sbopkg/SBo-danix", @@ -168,9 +168,9 @@ def hint_args(cfg, kind, args): raise Error(f"{kind}: unknown option {o}") rest = [a for a in args if a != "--no-dl"] if kind == "hint-new": - if not 1 <= len(rest) <= 2: - raise Error("usage: hint-new [] [--no-dl]") - pairs = [(rest[0], rest[1] if len(rest) == 2 else None)] + if not rest: + raise Error("usage: hint-new ... [--no-dl]") + pairs = [(pkg, None) for pkg in rest] # the .info pin; Update sets a version later else: if not rest: raise Error("hint-update needs at least one pkg=version") diff --git a/sb_builder/__init__.py b/sb_builder/__init__.py index 21a93ab..f9bea08 100644 --- a/sb_builder/__init__.py +++ b/sb_builder/__init__.py @@ -16,4 +16,4 @@ """sb-builder: Qt6 GUI driving the SlackBuild tooling on a build VM.""" -VERSION = "0.5.0" # must match remote/sbb-remote VERSION +VERSION = "0.6.0" # must match remote/sbb-remote VERSION diff --git a/tests/test_remote.py b/tests/test_remote.py index 14622b8..54c5614 100644 --- a/tests/test_remote.py +++ b/tests/test_remote.py @@ -331,7 +331,8 @@ class HintJobsTest(Base): me = [sys.executable, os.path.abspath(sbb.__file__), "_hint"] self.assertEqual(sbb.KINDS["hint-update"](self.cfg, ["x=2.0", "--no-dl"]), (me + ["hint-update", "x=2.0", "--no-dl"], {})) - self.assertEqual(sbb.KINDS["hint-new"](self.cfg, ["x", "2.0"]), (me + ["hint-new", "x", "2.0"], {})) + self.make_pkg("misc/y", self.info) + self.assertEqual(sbb.KINDS["hint-new"](self.cfg, ["x", "y"]), (me + ["hint-new", "x", "y"], {})) self.assertFalse(sbb.signs("hint-update", ["x=2.0"])) def test_kinds_reject(self): @@ -351,14 +352,14 @@ class HintJobsTest(Base): ("hint-update", ["neovim=1"], "bundled deps"), ("hint-update", ["shadowed=1"], "not managed"), ("hint-new", [], "hint-new "), - ("hint-new", ["x", "1", "2"], "hint-new "), - ("hint-new", ["neovim", "1"], "bundled deps")): + ("hint-new", ["x", "2.0"], "no such package: 2.0"), # no version any more + ("hint-new", ["x", "x"], "twice")): with self.subTest(kind=kind, args=args), self.assertRaisesRegex(sbb.Error, why): sbb.KINDS[kind](self.cfg, args) sbb.KINDS["hint-new"](self.cfg, ["neovim"]) # no version: no bundled deps to touch self.make_pkg("misc/y", self.info, hint="") - with self.assertRaisesRegex(sbb.Error, "exists"): - sbb.KINDS["hint-new"](self.cfg, ["y"]) + with self.assertRaisesRegex(sbb.Error, "y: hint exists"): + sbb.KINDS["hint-new"](self.cfg, ["x", "y"]) # one with a hint refuses the whole job def test_update_backs_up_and_reports(self): self.make_pkg("misc/x", self.info, hint='DELREQUIRES="rust-opt"\n') @@ -388,8 +389,9 @@ class HintJobsTest(Base): def test_new(self): self.make_pkg("misc/x", self.info) - rc, result, _ = self.run_hint("hint-new", "x") - self.assertEqual((rc, result), (0, {"ok": ["x"], "failed": []})) + self.make_pkg("misc/y", self.info) + rc, result, _ = self.run_hint("hint-new", "x", "y") + self.assertEqual((rc, result), (0, {"ok": ["x", "y"], "failed": []})) self.assertIn('#REQUIRES="rust-opt a"', self.read(self.hint)) self.assertIn('MD5SUM="old"', self.read(self.hint)) # no version given: no download -- cgit v1.2.3