Fix update_lists in ppa.sh

This commit is contained in:
Shivam Mathur 2022-01-02 22:05:57 +05:30
parent 1fd26e45c8
commit 45a631dbaf
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A

View File

@ -54,14 +54,17 @@ update_lists_helper() {
update_lists() { update_lists() {
local ppa=${1:-} local ppa=${1:-}
local ppa_search=${2:-} local ppa_search=${2:-}
if [ ! -e /tmp/setup_php ] || [[ -n $ppa && -n $ppa_search ]]; then local list=
if [[ -n "$ppa" && -n "$ppa_search" ]]; then status_file=/tmp/os_lists
list="$list_dir"/"$(basename "$(grep -lr "$ppa_search" "$list_dir")")" if [[ -n "$ppa" && -n "$ppa_search" ]]; then
elif grep -Eq '^deb ' "$list_file"; then list="$list_dir"/"$(basename "$(grep -lr "$ppa_search" "$list_dir")")"
list="$list_file" status_file=/tmp/"${ppa/\//_}"
fi elif grep -Eq '^deb ' "$list_file"; then
list="$list_file"
fi
if [ ! -e "$status_file" ]; then
update_lists_helper "$list" >/dev/null 2>&1 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 fi
} }