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() {
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
}