From fdda40994b2e4f3515c9a84738c1e0bf5d7aaada Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Sat, 14 Dec 2024 22:26:05 +0100 Subject: [PATCH 1/2] Fix rare case when apt and rpm package managers are found MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- automated install/basic-install.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index b2bbb219..81b240e4 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -484,9 +484,8 @@ build_dependency_package(){ # Move back into the directory the user started in popd &> /dev/null || return 1 - fi - if is_command rpm; then + elif is_command rpm; then # move into the tmp directory pushd /tmp &>/dev/null || return 1 @@ -517,6 +516,13 @@ build_dependency_package(){ # Move back into the directory the user started in popd &> /dev/null || return 1 + + # If neither apt-get or yum/dnf package managers were found + else + # we cannot build required packages + printf " %b No supported package manager found\\n" "${CROSS}" + # so exit the installer + exit 1 fi # Remove the build directory From cc01c110f18a2137a2c3f7cd874de80a979b63a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Sat, 14 Dec 2024 22:31:02 +0100 Subject: [PATCH 2/2] Also check during installlation of the dependency package MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- automated install/basic-install.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 81b240e4..f1ef8887 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -1517,11 +1517,9 @@ install_dependent_packages() { printf " %b Error: Unable to find Pi-hole dependency meta package.\\n" "${COL_LIGHT_RED}" return 1 fi - fi - # Install Fedora/CentOS packages - if is_command rpm; then - if [ -f /tmp/pihole-meta.rpm ]; then + elif is_command rpm; then + if [ -f /tmp/pihole-meta.rpm ]; then eval "${PKG_INSTALL}" "/tmp/pihole-meta.rpm" rm /tmp/pihole-meta.rpm else @@ -1529,7 +1527,14 @@ install_dependent_packages() { return 1 fi + # If neither apt-get or yum/dnf package managers were found + else + # we cannot install the dependency package + printf " %b No supported package manager found\\n" "${CROSS}" + # so exit the installer + exit 1 fi + printf "\\n" return 0 }