mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-07-28 08:04:11 +02:00
Separate package manager detection and cache update functions
Signed-off-by: Christian König <github@yubiuser.dev>
This commit is contained in:
parent
93ecfb9504
commit
5777497f52
@ -114,7 +114,6 @@ main() {
|
||||
|
||||
|
||||
# Install packages used by this installation script (necessary if users have removed e.g. git from their systems)
|
||||
check_fresh_install
|
||||
package_manager_detect
|
||||
build_dependency_package
|
||||
install_dependent_packages
|
||||
|
@ -254,10 +254,6 @@ package_manager_detect() {
|
||||
PKG_COUNT="${PKG_MANAGER} -s -o Debug::NoLocking=true upgrade | grep -c ^Inst || true"
|
||||
# The command we will use to remove packages (used in the uninstaller)
|
||||
PKG_REMOVE="${PKG_MANAGER} -y remove --purge"
|
||||
# Update package cache only on fresh installs
|
||||
if [[ "${fresh_install}" == true ]]; then
|
||||
update_package_cache || exit 1
|
||||
fi
|
||||
|
||||
# If apt-get is not found, check for rpm.
|
||||
elif is_command rpm; then
|
||||
@ -2208,6 +2204,11 @@ main() {
|
||||
# Check for supported package managers so that we may install dependencies
|
||||
package_manager_detect
|
||||
|
||||
# Update package cache only on fresh installs and apt based systems
|
||||
if [[ "${fresh_install}" == true ]] && is_command apt-get; then
|
||||
update_package_cache || exit 1
|
||||
fi
|
||||
|
||||
# Notify user of package availability
|
||||
notify_package_updates_available
|
||||
|
||||
|
@ -471,6 +471,7 @@ def test_package_manager_has_pihole_deps(host):
|
||||
"""
|
||||
source /opt/pihole/basic-install.sh
|
||||
package_manager_detect
|
||||
update_package_cache
|
||||
build_dependency_package
|
||||
install_dependent_packages
|
||||
"""
|
||||
@ -487,6 +488,7 @@ def test_meta_package_uninstall(host):
|
||||
"""
|
||||
source /opt/pihole/basic-install.sh
|
||||
package_manager_detect
|
||||
update_package_cache
|
||||
build_dependency_package
|
||||
install_dependent_packages
|
||||
"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user