From 45a631dbaf03d63b66a8745d4d4960953121a58a Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Sun, 2 Jan 2022 22:05:57 +0530 Subject: [PATCH] Fix update_lists in ppa.sh --- src/scripts/tools/ppa.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/scripts/tools/ppa.sh b/src/scripts/tools/ppa.sh index b2f56f06..e3d39249 100644 --- a/src/scripts/tools/ppa.sh +++ b/src/scripts/tools/ppa.sh @@ -54,14 +54,17 @@ update_lists_helper() { update_lists() { local ppa=${1:-} local ppa_search=${2:-} - if [ ! -e /tmp/setup_php ] || [[ -n $ppa && -n $ppa_search ]]; then - if [[ -n "$ppa" && -n "$ppa_search" ]]; then - list="$list_dir"/"$(basename "$(grep -lr "$ppa_search" "$list_dir")")" - elif grep -Eq '^deb ' "$list_file"; then - list="$list_file" - fi + local list= + status_file=/tmp/os_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 + list="$list_file" + fi + if [ ! -e "$status_file" ]; then update_lists_helper "$list" >/dev/null 2>&1 - echo '' | tee /tmp/setup_php >/dev/null 2>&1 + echo '' | tee "$status_file" >/dev/null 2>&1 fi }