From e10dcd81346cb81644fb5763f358586fecf120a2 Mon Sep 17 00:00:00 2001 From: bryan Date: Thu, 16 Jan 2020 18:29:06 -0500 Subject: [PATCH] Attempt to install dependencies in build mode --- install_MC_fedora.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/install_MC_fedora.sh b/install_MC_fedora.sh index cc07690..8d5a996 100755 --- a/install_MC_fedora.sh +++ b/install_MC_fedora.sh @@ -118,7 +118,7 @@ get_source_deb () { install_dependencies () { - if [ $build_mode == false ]; then + if ! [ -x "$(command -v rpmbuild)" ] || ! [ -x "$(command -v dpkg)" ]; then if [ "$ID" == "fedora" ]; then if ! rpm --quiet --query rpmfusion-free-release; then echo "Installing rpmfusion-free-release repo..."; \ sudo dnf -y --nogpgcheck install https://download1.rpmfusion.org/free/${ID}/rpmfusion-free-release-${VERSION_ID}.noarch.rpm; fi @@ -133,10 +133,12 @@ install_dependencies () { if ! rpm --quiet --query dpkg; then echo "Installing dpkg from EPEL..."; sudo dnf install dpkg -y; fi if ! rpm --quiet --query rpm-build; then echo "Installing rpm-build from EPEL testing..."; sudo dnf install --enablerepo=epel-testing rpm-build -y; fi if ! rpm --quiet --query dpkg; then echo "Installing dpkg from EPEL testing..."; sudo dnf install --enablerepo=epel-testing dpkg -y; fi + else + command -v rpmbuild >/dev/null 2>&1 || { echo "Please install rpmbuild, cannot continue, aborting..." >&2; exit 1; } + command -v dpkg >/dev/null 2>&1 || { echo "Please install dpkg, cannot continue, aborting..." >&2; exit 1; } fi - else - command -v rpmbuild >/dev/null 2>&1 || { echo "Please install rpmbuild, cannot continue, aborting..." >&2; exit 1; } - command -v dpkg >/dev/null 2>&1 || { echo "Please install dpkg, cannot continue, aborting..." >&2; exit 1; } + + echo "rpmbuild and dpkg already installed" fi }