Add radio, which finds radios on USB, and put you in the uucp group
check / lint-and-test (push) Successful in 2m2s
check / packages (push) Successful in 23s

`radio` lists each radio plugged into USB: its serial ports, the sound
card that came with it (the same USB device, or behind the radio's own
hub), and its model and Hamlib model number. Icoms are recognised by
their USB serial number. `radio detect --probe` asks the others with the
CAT ID; command or Icom's CI-V transceiver ID, at the usual baud rates,
on ports no other program has open; `radio probe PORT` asks one port.
It drops DTR and RTS as soon as a port opens. The radios it knows are
in radios.conf.

update.sh links ~/.local/bin/radio to the clone, unless a different
radio is already there, and adds you to uucp, which owns serial ports on
Arch. hampackremove removes the link, and takes you out of uucp only if
HamPack put you in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
David Young
2026-11-28 12:12:31 -07:00
co-authored by Claude Opus 5.5
parent 48d94ca432
commit 6c76f94ac6
14 changed files with 944 additions and 3 deletions
+31
View File
@@ -40,6 +40,37 @@ setup() {
[ "$(wc -l < "$HAMPACK_STATE/installed-flatpaks")" -eq "$(all_hampack_flatpaks | wc -l)" ]
grep -qx "uv tool install not1mm" "$STUB_LOG"
[ -x "$HOME/.local/bin/hampackremove" ]
[ "$(readlink "$HOME/.local/bin/radio")" = "$REPO/radio" ]
"$HOME/.local/bin/radio" help | grep -q "Usage: radio"
}
@test "adds you to the uucp group once, and records it" {
run bash "$REPO/update.sh"
[ "$status" -eq 0 ]
[[ "$output" == *"Added you to the uucp group"*"Log out and back in"* ]]
grep -qx "usermod -aG uucp $USER" "$STUB_LOG"
grep -qx uucp "$HAMPACK_STATE/added-groups"
: > "$STUB_LOG"
run bash "$REPO/update.sh"
[[ "$output" != *"Added you to the uucp group"* ]]
! grep -q usermod "$STUB_LOG"
}
@test "doesn't claim the uucp group if you were already in it" {
echo uucp > "$FAKE_GROUPS"
run bash "$REPO/update.sh"
[ "$status" -eq 0 ]
! grep -q usermod "$STUB_LOG"
[ ! -e "$HAMPACK_STATE/added-groups" ]
}
@test "update leaves alone a radio command that isn't HamPack's" {
echo "theirs" > "$HOME/.local/bin/radio"
run bash "$REPO/update.sh"
[ "$status" -eq 0 ]
[[ "$output" == *"Not installing HamPack's radio command"* ]]
[ "$(cat "$HOME/.local/bin/radio")" = theirs ]
}
@test "a later update installs and records nothing new" {