mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-25 21:13:04 +07:00
Improve install_packages in linux.sh
This commit is contained in:
parent
ca308a6886
commit
6483a6ea70
@ -15,10 +15,15 @@ self_hosted_helper() {
|
|||||||
install_packages apt-transport-https ca-certificates curl file make jq unzip autoconf automake gcc g++ gnupg
|
install_packages apt-transport-https ca-certificates curl file make jq unzip autoconf automake gcc g++ gnupg
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Function to fix broken packages.
|
||||||
|
fix_broken_packages() {
|
||||||
|
sudo apt --fix-broken install >/dev/null 2>&1
|
||||||
|
}
|
||||||
|
|
||||||
# Function to install a package
|
# Function to install a package
|
||||||
install_packages() {
|
install_packages() {
|
||||||
packages=("$@")
|
packages=("$@")
|
||||||
$apt_install "${packages[@]}" >/dev/null 2>&1 || (update_lists && $apt_install "${packages[@]}" >/dev/null 2>&1)
|
$apt_install "${packages[@]}" >/dev/null 2>&1 || (update_lists && fix_broken_packages && $apt_install "${packages[@]}" >/dev/null 2>&1)
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to disable an extension.
|
# Function to disable an extension.
|
||||||
|
Loading…
Reference in New Issue
Block a user