mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-07-29 00:24:16 +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)
|
# Install packages used by this installation script (necessary if users have removed e.g. git from their systems)
|
||||||
check_fresh_install
|
|
||||||
package_manager_detect
|
package_manager_detect
|
||||||
build_dependency_package
|
build_dependency_package
|
||||||
install_dependent_packages
|
install_dependent_packages
|
||||||
|
@ -254,10 +254,6 @@ package_manager_detect() {
|
|||||||
PKG_COUNT="${PKG_MANAGER} -s -o Debug::NoLocking=true upgrade | grep -c ^Inst || true"
|
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)
|
# The command we will use to remove packages (used in the uninstaller)
|
||||||
PKG_REMOVE="${PKG_MANAGER} -y remove --purge"
|
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.
|
# If apt-get is not found, check for rpm.
|
||||||
elif is_command rpm; then
|
elif is_command rpm; then
|
||||||
@ -2208,6 +2204,11 @@ main() {
|
|||||||
# Check for supported package managers so that we may install dependencies
|
# Check for supported package managers so that we may install dependencies
|
||||||
package_manager_detect
|
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 user of package availability
|
||||||
notify_package_updates_available
|
notify_package_updates_available
|
||||||
|
|
||||||
|
@ -471,6 +471,7 @@ def test_package_manager_has_pihole_deps(host):
|
|||||||
"""
|
"""
|
||||||
source /opt/pihole/basic-install.sh
|
source /opt/pihole/basic-install.sh
|
||||||
package_manager_detect
|
package_manager_detect
|
||||||
|
update_package_cache
|
||||||
build_dependency_package
|
build_dependency_package
|
||||||
install_dependent_packages
|
install_dependent_packages
|
||||||
"""
|
"""
|
||||||
@ -487,6 +488,7 @@ def test_meta_package_uninstall(host):
|
|||||||
"""
|
"""
|
||||||
source /opt/pihole/basic-install.sh
|
source /opt/pihole/basic-install.sh
|
||||||
package_manager_detect
|
package_manager_detect
|
||||||
|
update_package_cache
|
||||||
build_dependency_package
|
build_dependency_package
|
||||||
install_dependent_packages
|
install_dependent_packages
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user