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