mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-24 20:51:06 +07:00
Add dkpg option to overwrite conf files
This commit is contained in:
parent
fc14643b0a
commit
4b56933e00
@ -23,6 +23,10 @@ fix_broken_packages() {
|
|||||||
# Function to install a package
|
# Function to install a package
|
||||||
install_packages() {
|
install_packages() {
|
||||||
packages=("$@")
|
packages=("$@")
|
||||||
|
if ! [ -e /etc/dpkg/dpkg.cfg.d/force-confnew ]; then
|
||||||
|
echo "force-confnew" | sudo tee /etc/dpkg/dpkg.cfg.d/force-confnew >/dev/null 2>&1
|
||||||
|
trap "sudo rm -f /etc/dpkg/dpkg.cfg.d/force-confnew 2>/dev/null" exit
|
||||||
|
fi
|
||||||
$apt_install "${packages[@]}" >/dev/null 2>&1 || (update_lists && fix_broken_packages && $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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user