Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix installing homegear on bookworm #1913

Merged
merged 10 commits into from
Oct 4, 2024
16 changes: 8 additions & 8 deletions functions/packages.bash
Original file line number Diff line number Diff line change
Expand Up @@ -220,17 +220,17 @@ homegear_setup() {

if ! add_keys "https://apt.homegear.eu/Release.key" "$keyName"; then return 1; fi

# need to use testing repo to get v0.8
# repo https://apt.homegear.eu/raspberry_pi_os/bookworm/homegear/{testing,stable}/dists/bookworm/
echo "deb [signed-by=/usr/share/keyrings/${keyName}.gpg] https://apt.homegear.eu/${myOS,,}/${myRelease,,}/homegear/testing ${myRelease,,} main" > /etc/apt/sources.list.d/homegear.list

# Add Homegear's repository to APT - need to use testing repo
if ! is_pi || [[ "$(dpkg --print-architecture)" == 'arm64' ]]; then
# 64-bit Raspberry Pi OS:
echo 'deb [signed-by=/usr/share/keyrings/homegear-archive-keyring.gpg] https://apt.homegear.eu/debian/bookworm/homegear/testing/ bookworm main' > /etc/apt/sources.list.d/homegear.list
else
# 32-bit Raspberry Pi OS
echo 'deb [signed-by=/usr/share/keyrings/homegear-archive-keyring.gpg] https://apt.homegear.eu/raspberry_pi_os/bookworm/homegear/testing/ bookworm main' > /etc/apt/sources.list.d/homegear.list
fi
echo -n "$(timestamp) [openHABian] Installing Homegear... "
if ! cond_redirect apt-get update; then echo "FAILED (update apt lists)"; return 1; fi
if is_raspios; then
wget -O "$temp" https://github.com/WiringPi/WiringPi/releases/download/2.61-1/wiringpi-2.61-1-armhf.deb
dpkg -i "$temp"
rm -f "$temp"
fi
if cond_redirect apt-get install --yes -o DPkg::Lock::Timeout="$APTTIMEOUT" homegear homegear-homematicbidcos homegear-homematicwired homegear-max homegear-management; then echo "OK"; else echo "FAILED"; return 1; fi
echo -n "$(timestamp) [openHABian] Setting up Homegear user account permissions... "
if ! cond_redirect adduser "${username:-openhabian}" homegear; then echo "FAILED"; return 1; fi
Expand Down
26 changes: 13 additions & 13 deletions functions/packages.bats
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ teardown_file() {
systemctl kill mosquitto.service || true
}

#@test "destructive-homegear_install" {
# echo -e "# ${COL_CYAN}$(timestamp) [openHABian] Homegear installation starting...${COL_DEF}" >&3
# run homegear_setup 3>&-
# if [ "$status" -ne 0 ]; then echo "$output" >&3; fi
# [ "$status" -eq 0 ]
# echo -e "# ${COL_GREEN}$(timestamp) [openHABian] Homegear installation successful.${COL_DEF}" >&3
#
# echo -e "# ${COL_CYAN}$(timestamp) [openHABian] Checking if Homegear service is running...${COL_DEF}" >&3
# run systemctl is-active --quiet homegear.service
# if [ "$status" -ne 0 ]; then echo "$output" >&3; fi
# [ "$status" -eq 0 ]
# echo -e "# ${COL_GREEN}$(timestamp) [openHABian] Homegear service is running.${COL_DEF}" >&3
#}
@test "destructive-homegear_install" {
echo -e "# ${COL_CYAN}$(timestamp) [openHABian] Homegear installation starting...${COL_DEF}" >&3
run homegear_setup 3>&-
if [ "$status" -ne 0 ]; then echo "$output" >&3; fi
[ "$status" -eq 0 ]
echo -e "# ${COL_GREEN}$(timestamp) [openHABian] Homegear installation successful.${COL_DEF}" >&3

echo -e "# ${COL_CYAN}$(timestamp) [openHABian] Checking if Homegear service is running...${COL_DEF}" >&3
run systemctl is-active --quiet homegear.service
if [ "$status" -ne 0 ]; then echo "$output" >&3; fi
[ "$status" -eq 0 ]
echo -e "# ${COL_GREEN}$(timestamp) [openHABian] Homegear service is running.${COL_DEF}" >&3
}

@test "destructive-mqtt_install" {
if is_aarch64; then skip "Not executing MQTT test because it currently does not support aarch64/arm64 env provided by GitHub Actions."; fi
Expand Down
Loading