Skip to content

Commit

Permalink
v9.10
Browse files Browse the repository at this point in the history
- DietPi-Software | Raspotify: Migrate to new APT list name and key format
- DietPi-Software | Raspotify: Try to use old DNS-SD backend, to avoid new Avahi-Daemon dependency
  • Loading branch information
MichaIng committed Dec 30, 2024
1 parent 4262dea commit 5df01ae
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
19 changes: 19 additions & 0 deletions .update/patches
Original file line number Diff line number Diff line change
Expand Up @@ -2067,6 +2067,25 @@ Patch_9_9()
fi
}

Patch_9_10()
{
# Software updates, migrations and patches
if [[ -f '/boot/dietpi/.installed' ]]
then
# Raspotify
if grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[167\]=2' /boot/dietpi/.installed
then
G_DIETPI-NOTIFY 2 'Migrating to new Raspotify APT list name and key format ...'
[[ -f '/etc/apt/sources.list.d/raspotify.list' ]] && G_EXEC mv /etc/apt/sources.list.d/{,dietpi-}raspotify.list
if [[ -f '/etc/apt/trusted.gpg.d/dietpi-raspotify.gpg' ]]
then
G_EXEC curl -sSfo /etc/apt/trusted.gpg.d/dietpi-raspotify.asc 'https://dtcooper.github.io/raspotify/key.asc'
G_EXEC rm /etc/apt/trusted.gpg.d/dietpi-raspotify.gpg
fi
fi
fi
}

# v6.35 => v7 migration
if (( $G_DIETPI_VERSION_CORE == 6 && $G_DIETPI_VERSION_SUB > 34 ))
then
Expand Down
15 changes: 8 additions & 7 deletions dietpi/dietpi-software
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ Available commands:
aSOFTWARE_DESC[$software_id]='Spotify connect client'
aSOFTWARE_CATX[$software_id]=2
aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/media/#raspotify'
aSOFTWARE_DEPS[$software_id]='5 152'
aSOFTWARE_DEPS[$software_id]='5'
# - RISC-V: No package: https://github.com/dtcooper/raspotify/releases
aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,11]=0
# - Bookworm/Trixie on ARMv6 (older package): "/usr/bin/librespot: error while loading shared libraries: ld-linux.so.3: cannot open shared object file: No such file or directory"
Expand Down Expand Up @@ -10903,16 +10903,17 @@ _EOF_
# ARMv7/ARMv8/x86_64
else
# APT key
local url='https://dtcooper.github.io/raspotify/key.asc'
G_CHECK_URL "$url"
G_EXEC eval "curl -sSfL '$url' | gpg --dearmor -o /etc/apt/trusted.gpg.d/dietpi-raspotify.gpg --yes"
Download_Install 'https://dtcooper.github.io/raspotify/key.asc' /etc/apt/trusted.gpg.d/dietpi-raspotify.asc

# APT list
G_EXEC eval 'echo '\''deb https://dtcooper.github.io/raspotify raspotify main'\'' > /etc/apt/sources.list.d/raspotify.list'
G_EXEC eval 'echo '\''deb https://dtcooper.github.io/raspotify raspotify main'\'' > /etc/apt/sources.list.d/dietpi-raspotify.list'
G_AGUP

# APT package
G_AGI raspotify

# Switch to old DNS-SD backend, to avoid Avahi-Daemon dependency: https://github.com/MichaIng/DietPi/issues/7323
GGI_PRESERVE=1 G_CONFIG_INJECT 'LIBRESPOT_ZEROCONF_BACKEND=' 'LIBRESPOT_ZEROCONF_BACKEND="dns-sd"' /etc/raspotify/conf
fi

# Stop service
Expand Down Expand Up @@ -13793,8 +13794,8 @@ _EOF_
if To_Uninstall 167 # Raspotify
then
G_AGP raspotify
[[ -f '/etc/apt/sources.list.d/raspotify.list' ]] && G_EXEC rm /etc/apt/sources.list.d/raspotify.list
[[ -f '/etc/apt/trusted.gpg.d/dietpi-raspotify.gpg' ]] && G_EXEC rm /etc/apt/trusted.gpg.d/dietpi-raspotify.gpg
[[ -f '/etc/apt/sources.list.d/dietpi-raspotify.list' ]] && G_EXEC rm /etc/apt/sources.list.d/dietpi-raspotify.list
[[ -f '/etc/apt/trusted.gpg.d/dietpi-raspotify.asc' ]] && G_EXEC rm /etc/apt/trusted.gpg.d/dietpi-raspotify.asc
fi

if To_Uninstall 169 # Google AIY
Expand Down

0 comments on commit 5df01ae

Please sign in to comment.