Add radio, which finds radios on USB, and put you in the uucp group
`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:
co-authored by
Claude Opus 5.5
parent
48d94ca432
commit
6c76f94ac6
@@ -83,6 +83,33 @@ remove() {
|
||||
[ ! -e "$SIBLING" ]
|
||||
}
|
||||
|
||||
@test "removes the radio command, but not someone else's" {
|
||||
ln -s "$SIBLING/radio" "$HOME/.local/bin/radio"
|
||||
remove
|
||||
[ ! -L "$HOME/.local/bin/radio" ]
|
||||
|
||||
setup
|
||||
echo theirs > "$HOME/.local/bin/radio"
|
||||
remove
|
||||
[ "$(cat "$HOME/.local/bin/radio")" = theirs ]
|
||||
}
|
||||
|
||||
@test "takes you out of the uucp group only if HamPack put you in" {
|
||||
echo uucp > "$FAKE_GROUPS"
|
||||
mkdir -p "$HAMPACK_STATE"
|
||||
echo uucp > "$HAMPACK_STATE/added-groups"
|
||||
remove
|
||||
[ "$status" -eq 0 ]
|
||||
grep -qx "gpasswd -d $USER uucp" "$STUB_LOG"
|
||||
! grep -qx uucp "$FAKE_GROUPS"
|
||||
|
||||
setup
|
||||
echo uucp > "$FAKE_GROUPS"
|
||||
remove
|
||||
! grep -q gpasswd "$STUB_LOG"
|
||||
grep -qx uucp "$FAKE_GROUPS"
|
||||
}
|
||||
|
||||
@test "does nothing unless confirmed" {
|
||||
mark_installed fldigi
|
||||
mkdir -p "$HAMPACK_STATE"
|
||||
|
||||
Reference in New Issue
Block a user