From 868f02c3ff1a410930ea971284c9ea175e986284 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Sat, 27 Apr 2024 21:04:56 +0530 Subject: [PATCH] Improve support for deb822 system sources file --- src/scripts/tools/ppa.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/scripts/tools/ppa.sh b/src/scripts/tools/ppa.sh index b3d8d0456..d9c28fb69 100644 --- a/src/scripts/tools/ppa.sh +++ b/src/scripts/tools/ppa.sh @@ -55,7 +55,7 @@ update_lists() { if [[ -n "$ppa" && -n "$ppa_search" ]]; then list="$list_dir"/"$(basename "$(grep -lr "$ppa_search" "$list_dir")")" status_file=/tmp/"${ppa/\//_}" - elif [ -e "$list_file" ] && grep -Eq '^deb ' "$list_file"; then + elif [ -e "$list_file" ] && grep -Eq '^deb |^Types deb' "$list_file"; then list="$list_file" fi if [ ! -e "$status_file" ]; then @@ -189,8 +189,9 @@ update_ppa() { } # Variables -list_file='/etc/apt/sources.list' -list_dir="$list_file.d" +list_dir='/etc/apt/sources.list.d' +list_file="/etc/apt/sources.list.d/$ID.sources" +[ -e "$list_file" ] || list_file='/etc/apt/sources.list' upstream_lsb='/etc/upstream-release/lsb-release' lp_api='https://api.launchpad.net/1.0' lp_ppa='http://ppa.launchpad.net'