From f1cc14e3d5baeef2f4bbb238688a6ac68b94ed3f Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Sun, 2 Jul 2023 02:16:13 +0530 Subject: [PATCH] Fix grep call in ppa.sh When distros use DEB822-STYLE .sources file or a custom default list file the list_file is not present, so we check if it exists before calling grep on it --- src/scripts/tools/ppa.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripts/tools/ppa.sh b/src/scripts/tools/ppa.sh index acc8ee27..abaac71d 100644 --- a/src/scripts/tools/ppa.sh +++ b/src/scripts/tools/ppa.sh @@ -59,7 +59,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 grep -Eq '^deb ' "$list_file"; then + elif [ -e "$list_file" ] && grep -Eq '^deb ' "$list_file"; then list="$list_file" fi if [ ! -e "$status_file" ]; then