mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
Drop indirection from install_dependent_packages
Previously, install_dependent_packages would receive an array variable name as its single parameter, and would use variable indirection to access it; this change simplifies that function so that it instead receives the expanded array. Signed-off-by: David Haguenauer <ml@kurokatta.org>
This commit is contained in:
parent
ab2f8a0c09
commit
69081a9175
1 changed files with 4 additions and 5 deletions
|
@ -1616,7 +1616,6 @@ install_dependent_packages() {
|
||||||
|
|
||||||
# Install packages passed in via argument array
|
# Install packages passed in via argument array
|
||||||
# No spinner - conflicts with set -e
|
# No spinner - conflicts with set -e
|
||||||
declare -a argArray1=("${!1}")
|
|
||||||
declare -a installArray
|
declare -a installArray
|
||||||
|
|
||||||
# Debian based package install - debconf will download the entire package list
|
# Debian based package install - debconf will download the entire package list
|
||||||
|
@ -1626,7 +1625,7 @@ install_dependent_packages() {
|
||||||
# installed by us, and remove only the installed packages, and not the entire list.
|
# installed by us, and remove only the installed packages, and not the entire list.
|
||||||
if is_command debconf-apt-progress ; then
|
if is_command debconf-apt-progress ; then
|
||||||
# For each package,
|
# For each package,
|
||||||
for i in "${argArray1[@]}"; do
|
for i in "$@"; do
|
||||||
printf " %b Checking for %s..." "${INFO}" "${i}"
|
printf " %b Checking for %s..." "${INFO}" "${i}"
|
||||||
if dpkg-query -W -f='${Status}' "${i}" 2>/dev/null | grep "ok installed" &> /dev/null; then
|
if dpkg-query -W -f='${Status}' "${i}" 2>/dev/null | grep "ok installed" &> /dev/null; then
|
||||||
printf "%b %b Checking for %s\\n" "${OVER}" "${TICK}" "${i}"
|
printf "%b %b Checking for %s\\n" "${OVER}" "${TICK}" "${i}"
|
||||||
|
@ -1645,7 +1644,7 @@ install_dependent_packages() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Install Fedora/CentOS packages
|
# Install Fedora/CentOS packages
|
||||||
for i in "${argArray1[@]}"; do
|
for i in "$@"; do
|
||||||
printf " %b Checking for %s..." "${INFO}" "${i}"
|
printf " %b Checking for %s..." "${INFO}" "${i}"
|
||||||
if "${PKG_MANAGER}" -q list installed "${i}" &> /dev/null; then
|
if "${PKG_MANAGER}" -q list installed "${i}" &> /dev/null; then
|
||||||
printf "%b %b Checking for %s" "${OVER}" "${TICK}" "${i}"
|
printf "%b %b Checking for %s" "${OVER}" "${TICK}" "${i}"
|
||||||
|
@ -2525,7 +2524,7 @@ main() {
|
||||||
notify_package_updates_available
|
notify_package_updates_available
|
||||||
|
|
||||||
# Install packages used by this installation script
|
# Install packages used by this installation script
|
||||||
install_dependent_packages INSTALLER_DEPS[@]
|
install_dependent_packages "${INSTALLER_DEPS[@]}"
|
||||||
|
|
||||||
# Check if SELinux is Enforcing
|
# Check if SELinux is Enforcing
|
||||||
checkSelinux
|
checkSelinux
|
||||||
|
@ -2576,7 +2575,7 @@ main() {
|
||||||
dep_install_list+=("${PIHOLE_WEB_DEPS[@]}")
|
dep_install_list+=("${PIHOLE_WEB_DEPS[@]}")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
install_dependent_packages dep_install_list[@]
|
install_dependent_packages "${dep_install_list[@]}"
|
||||||
unset dep_install_list
|
unset dep_install_list
|
||||||
|
|
||||||
# On some systems, lighttpd is not enabled on first install. We need to enable it here if the user
|
# On some systems, lighttpd is not enabled on first install. We need to enable it here if the user
|
||||||
|
|
Loading…
Reference in a new issue