1 Commits

Author SHA1 Message Date
d2d366fb02 Fix _installPackage function 2020-04-15 11:27:30 -04:00

View File

@@ -245,7 +245,7 @@ EOF
# parse commands # parse commands
for _pkg in "$@"; do for _pkg in "$@"; do
# Clean up package name and handle OS-specific tweaks # Clean up package name and handle OS-specific tweaks
_packageOverrides "$_pkg" _pkg=$(_packageOverrides "$_pkg")
# Insert the package name to test if already installed # Insert the package name to test if already installed
if [[ "$_pkg" != "" ]] && ! "${_pkg_query_cmd[@]}" "$_pkg" > /dev/null 2>&1; then if [[ "$_pkg" != "" ]] && ! "${_pkg_query_cmd[@]}" "$_pkg" > /dev/null 2>&1; then
if [[ -n $_url_pkg ]]; then if [[ -n $_url_pkg ]]; then
@@ -256,6 +256,11 @@ EOF
fi fi
done done
if [[ -n $_debug ]]; then
echo "_url_pkg_array: " "${_url_pkg_array[@]}"
echo "_pkg_array: " "${_pkg_array[@]}"
fi
if [[ ${#_pkg_array[@]} -ge 1 ]]; then if [[ ${#_pkg_array[@]} -ge 1 ]]; then
echo "Installing: " "${_pkg_array[@]}" echo "Installing: " "${_pkg_array[@]}"
"${_install_cmd[@]}" "${_pkg_array[@]}" > /dev/null 2>&1 "${_install_cmd[@]}" "${_pkg_array[@]}" > /dev/null 2>&1
@@ -273,23 +278,23 @@ EOF
unset _url_pkg unset _url_pkg
if [[ "$1" == "rpm-build" && "$ID" =~ ^(ubuntu|debian)$ ]]; then if [[ "$1" == "rpm-build" && "$ID" =~ ^(ubuntu|debian)$ ]]; then
_pkg="rpm" echo "rpm"
elif [[ "$1" == "createrepo_c" && "$ID" =~ ^(ubuntu|debian)$ ]]; then elif [[ "$1" == "createrepo_c" && "$ID" =~ ^(ubuntu|debian)$ ]]; then
_pkg="createrepo" echo "createrepo"
elif [[ "$1" == "rpmfusion-free-release" ]]; then elif [[ "$1" == "rpmfusion-free-release" ]]; then
if [[ "$ID" == "fedora" ]]; then if [[ "$ID" == "fedora" ]]; then
_url_pkg="https://download1.rpmfusion.org/free/$ID/rpmfusion-free-release-$VERSION_ID.noarch.rpm" _url_pkg="https://download1.rpmfusion.org/free/$ID/rpmfusion-free-release-$VERSION_ID.noarch.rpm"
_pkg="$1" echo "$1"
elif [[ "$ID" == "centos" ]]; then elif [[ "$ID" == "centos" ]]; then
_url_pkg="https://download1.rpmfusion.org/free/el/rpmfusion-free-release-$VERSION_ID.noarch.rpm" _url_pkg="https://download1.rpmfusion.org/free/el/rpmfusion-free-release-$VERSION_ID.noarch.rpm"
_pkg="$1" echo "$1"
else else
_pkg="" echo ""
fi fi
elif [[ "$1" == "epel-release" && "$ID" != "centos" ]]; then elif [[ "$1" == "epel-release" && "$ID" != "centos" ]]; then
_pkg="" echo ""
else else
_pkg="$1" echo "$1"
fi fi
} }