Fix: Keyring-Handling, Error-Traps und Docker/Spotify-Repositorys korrigiert

- lib/apt.sh: GPG-Dearmor mit --yes --batch und ASCII-Armor-Erkennung über grep

- stages/05-fonts.sh: Bereinigung nur noch bei EXIT trappen

- stages/06-services.sh: Standard-Codename für Docker-Repo auf trixie gesetzt

- stages/08-flatpaks-apps.sh: Einheitliche Hilfsfunktion apt_add_keyring_from_url für Spotify genutzt

Co-authored-by: Junie <junie@jetbrains.com>
This commit is contained in:
2026-09-06 13:12:37 +02:00
co-authored by Junie
parent 8e36e4ce0d
commit 6cd6e789ba
4 changed files with 6 additions and 8 deletions
+2 -2
View File
@@ -46,8 +46,8 @@ apt_add_keyring_from_url() {
if curl -fsSL "$url" -o "$tmp_key"; then
# Check if the key is ASCII armored or binary
if gpg --dry-run --quiet --import "$tmp_key" >/dev/null 2>&1; then
if file "$tmp_key" | grep -q "PGP public key block"; then
gpg --dearmor -o "$dest_path" < "$tmp_key" 2>/dev/null || cp "$tmp_key" "$dest_path"
if grep -q "BEGIN PGP PUBLIC KEY BLOCK" "$tmp_key"; then
gpg --dearmor --yes --batch -o "$dest_path" < "$tmp_key" 2>/dev/null || cp "$tmp_key" "$dest_path"
else
cp "$tmp_key" "$dest_path"
fi
+1 -1
View File
@@ -24,7 +24,7 @@ cleanup() {
rm -rf "$TEMP_DIR"
fi
}
trap cleanup EXIT ERR
trap cleanup EXIT
mkdir -p "$FONT_DIR"
+2 -2
View File
@@ -37,11 +37,11 @@ log_substep "Setting up Docker service & repository..."
apt_ensure_keyrings_dir
apt_add_keyring_from_url "https://download.docker.com/linux/debian/gpg" "docker.asc"
DEBIAN_CODENAME="sid"
DEBIAN_CODENAME="trixie"
if [[ -f /etc/os-release ]]; then
# shellcheck source=/dev/null
source /etc/os-release
DEBIAN_CODENAME="${VERSION_CODENAME:-sid}"
DEBIAN_CODENAME="${VERSION_CODENAME:-trixie}"
# Docker uses 'bookworm' or 'trixie' upstream repo suite for Debian testing/unstable if sid is not explicitly provided
if [[ "$DEBIAN_CODENAME" == "sid" ]]; then
DEBIAN_CODENAME="trixie"
+1 -3
View File
@@ -40,9 +40,7 @@ fi
# 3. Spotify Client Installation (Debian APT repo)
log_substep "Configuring Spotify repository and client..."
apt_ensure_keyrings_dir
if curl -fsSL https://download.spotify.com/debian/pubkey_5384CE82BA52C83A.asc | gpg --dearmor -o /etc/apt/keyrings/spotify.gpg 2>/dev/null; then
chmod 0644 /etc/apt/keyrings/spotify.gpg
if apt_add_keyring_from_url "https://download.spotify.com/debian/pubkey_5384CE82BA52C83A.asc" "spotify.gpg"; then
cat <<EOF > /etc/apt/sources.list.d/spotify.sources
Types: deb
URIs: http://repository.spotify.com