Compare commits
1 Commits
5c534c23bc
...
fb96c7e74e
| Author | SHA1 | Date | |
|---|---|---|---|
| fb96c7e74e |
36
installJRMC
36
installJRMC
@@ -337,6 +337,8 @@ EOF
|
||||
# Installs a package using the system package manager
|
||||
# Arguments:
|
||||
# One or more package names
|
||||
# Options:
|
||||
# --noquery, -n: Do not query the package state
|
||||
# Returns:
|
||||
# Will exit 1 if failed
|
||||
#######################################
|
||||
@@ -344,6 +346,29 @@ EOF
|
||||
|
||||
_runDebug "${FUNCNAME[0]}" "$@"
|
||||
|
||||
unset _noquery _pkg_array _url_pkg_array
|
||||
|
||||
if _input=$(getopt -o +n -l noquery -- "$@"); then
|
||||
eval set -- "$_input"
|
||||
while true; do
|
||||
case "$1" in
|
||||
--noquery|-n)
|
||||
local _noquery="true"
|
||||
;;
|
||||
--)
|
||||
shift
|
||||
break
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
else
|
||||
err "Incorrect options provided"
|
||||
_printHelpAndExit 1
|
||||
fi
|
||||
|
||||
echo "DEBUG:" "$@"
|
||||
|
||||
# We will add packages to this array if their command is not available
|
||||
local -a _pkg_array
|
||||
local -a _url_pkg_array
|
||||
@@ -353,13 +378,15 @@ EOF
|
||||
# Clean up package name and handle OS-specific tweaks
|
||||
_packageQuirks "$_pkg"
|
||||
# Insert the package name to test if already installed
|
||||
if [[ -n $_force ]] || [[ "$_pkg" != "" ]] && ! _pkg_query "$_pkg" > /dev/null 2>&1; then
|
||||
if [[ "$_pkg" != "" ]]; then
|
||||
if [[ -n $_noquery ]] || ! _pkg_query "$_pkg" > /dev/null 2>&1; then
|
||||
if [[ -n $_url_pkg ]]; then
|
||||
_url_pkg_array+=("$_url_pkg")
|
||||
else
|
||||
_pkg_array+=("$_pkg")
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
[[ -n $_debug ]] && echo "_pkg_array:" "${_pkg_array[@]}"
|
||||
@@ -367,7 +394,8 @@ EOF
|
||||
|
||||
# Install from package name (with gpg check)
|
||||
if [[ ${#_pkg_array[@]} -ge 1 ]]; then
|
||||
echo "Installing: " "${_pkg_array[@]}"
|
||||
|
||||
echo "Installing:" "${_pkg_array[@]}"
|
||||
if [[ -n $_debug ]]; then
|
||||
if ! _pkg_install "${_pkg_array[@]}"; then
|
||||
err "Failed to install required package"
|
||||
@@ -381,7 +409,7 @@ EOF
|
||||
|
||||
# Install from package url (without gpg check)
|
||||
if [[ ${#_url_pkg_array[@]} -ge 1 ]]; then
|
||||
echo "Installing: " "${_url_pkg_array[@]}"
|
||||
echo "Installing:" "${_url_pkg_array[@]}"
|
||||
if [[ -n $_debug ]]; then
|
||||
if ! _pkg_install_nogpg "${_url_pkg_array[@]}"; then
|
||||
err "Failed to install required package from url"
|
||||
@@ -1201,7 +1229,7 @@ EOF"
|
||||
if [[ -n $_rpminstall ]]; then
|
||||
if [[ "$ID" =~ ^(fedora|centos)$ ]]; then
|
||||
_installPackage rpmfusion-free-release epel-release
|
||||
_installPackage "$_mcrpm"
|
||||
_installPackage --noquery "$_mcrpm"
|
||||
_symlinkCerts
|
||||
_restoreLicense
|
||||
_openFirewall
|
||||
|
||||
Reference in New Issue
Block a user