Wire up yum

This commit is contained in:
2022-01-14 00:52:48 -05:00
parent 42990727b7
commit 7a8b1fb2aa

View File

@@ -1421,6 +1421,7 @@ uninstall() {
echo "To remove your rpmbuild output files, run: rm -rf $OUTPUTDIR" echo "To remove your rpmbuild output files, run: rm -rf $OUTPUTDIR"
elif [[ $? -eq 100 ]]; then elif [[ $? -eq 100 ]]; then
err "JRiver Media Center package '$MCPKG' is not present" err "JRiver Media Center package '$MCPKG' is not present"
err "and was not uninstalled"
else else
err "Could not remove Media Center package" err "Could not remove Media Center package"
fi fi
@@ -1453,9 +1454,14 @@ main() {
# Distro-specific commands # Distro-specific commands
if [[ "$ID" =~ ^(fedora|centos)$ ]]; then if [[ "$ID" =~ ^(fedora|centos)$ ]]; then
pkg_install(){ sudo dnf install -y "$@"; } if hash dnf &>/dev/null; then
pkg_remove(){ sudo dnf remove -y "$@"; } declare mgr="dnf"
pkg_update(){ sudo dnf makecache; } elif hash yum &>/dev/null; then
declare mgr="yum"
fi
pkg_install(){ sudo "$mgr" install -y "$@"; }
pkg_remove(){ sudo "$mgr" remove -y "$@"; }
pkg_update(){ sudo "$mgr" makecache; }
pkg_query(){ rpm -q "$@"; } pkg_query(){ rpm -q "$@"; }
firewall_cmd(){ sudo firewall-cmd "$@"; } firewall_cmd(){ sudo firewall-cmd "$@"; }
elif [[ "$ID" =~ ^(debian|ubuntu)$ ]]; then elif [[ "$ID" =~ ^(debian|ubuntu)$ ]]; then