aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xremote/sbb-remote8
-rw-r--r--sb_builder/__init__.py2
-rw-r--r--tests/test_remote.py16
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 <pkg> [<version>] [--no-dl]")
- pairs = [(rest[0], rest[1] if len(rest) == 2 else None)]
+ if not rest:
+ raise Error("usage: hint-new <pkg>... [--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 <pkg>"),
- ("hint-new", ["x", "1", "2"], "hint-new <pkg>"),
- ("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