3 Commity

Autor SHA1 Zpráva Datum
9cf7b6d2b8 1.5.1 release 2025-04-13 13:35:01 -04:00
91cceec62f Fix download to stdout 2025-04-13 13:34:39 -04:00
928d3f248b Combine SUSE/RHEL rpm install 2025-04-12 18:27:15 -04:00
2 změnil soubory, kde provedl 26 přidání a 13 odebrání

Zobrazit soubor

@@ -114,6 +114,10 @@ Multiple services (but not `--service-types`) can be installed at one time using
Install the latest version of MC from the best available repository. Install the latest version of MC from the best available repository.
* `installJRMC --mcversion 32 --debug`
Install the latest version of MC32 from the best available repository with debugging output.
* `installJRMC --install local --compat` * `installJRMC --install local --compat`
Install a more widely-compatible version of the latest MC (for older distros). Install a more widely-compatible version of the latest MC (for older distros).

Zobrazit soubor

@@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# shellcheck disable=SC2317 # shellcheck disable=SC2317
# @file installJRMC # @file installJRMC
# @brief Install JRiver Media Center and associated services # @brief Installs JRiver Media Center and associated services
# @description See installJRMC --help or print_help() below for usage # @description See installJRMC --help or print_help() below for usage
# Copyright (c) 2021-2025 Bryan C. Roessler # Copyright (c) 2021-2025 Bryan C. Roessler
# This software is released under the Apache License. # This software is released under the Apache License.
@@ -18,7 +18,7 @@
# * Be careful with tabs in heredocs # * Be careful with tabs in heredocs
shopt -s extglob shopt -s extglob
declare -g SCRIPT_VERSION="1.5.0" declare -g SCRIPT_VERSION="1.5.1"
declare -g MC_REPO="bullseye" # should match the MC_VERSION declare -g MC_REPO="bullseye" # should match the MC_VERSION
# declare -g MC_REPO="bookworm" # should match the MC_VERSION # declare -g MC_REPO="bookworm" # should match the MC_VERSION
declare -g MC_VERSION="33.0.72" # do find all replace declare -g MC_VERSION="33.0.72" # do find all replace
@@ -350,7 +350,7 @@ init() {
PKG_REMOVE=(sudo "$rpm_mgr" remove -y) PKG_REMOVE=(sudo "$rpm_mgr" remove -y)
PKG_UPDATE=(sudo "$rpm_mgr" makecache) PKG_UPDATE=(sudo "$rpm_mgr" makecache)
PKG_QUERY=(rpm -q) PKG_QUERY=(rpm -q)
PKG_INSTALL_LOCAL() { install_mc_rhel; } PKG_INSTALL_LOCAL() { install_mc_rpm; }
;; ;;
debian|ubuntu) debian|ubuntu)
PKG_INSTALL=(sudo apt-get -f install -y -q0) PKG_INSTALL=(sudo apt-get -f install -y -q0)
@@ -364,7 +364,7 @@ init() {
PKG_REMOVE=(sudo zypper --non-interactive --quiet remove --clean-deps) PKG_REMOVE=(sudo zypper --non-interactive --quiet remove --clean-deps)
PKG_UPDATE=(sudo zypper --non-interactive --quiet refresh jriver) PKG_UPDATE=(sudo zypper --non-interactive --quiet refresh jriver)
PKG_QUERY=(rpm -q) PKG_QUERY=(rpm -q)
PKG_INSTALL_LOCAL() { install_mc_suse; } PKG_INSTALL_LOCAL() { install_mc_rpm; }
;; ;;
arch) arch)
PKG_INSTALL=(sudo pacman -Sy --noconfirm) PKG_INSTALL=(sudo pacman -Sy --noconfirm)
@@ -430,7 +430,7 @@ get_latest_mc_version() {
mc_version_source="containerized package manager" mc_version_source="containerized package manager"
execute buildah rm "$cnt" execute buildah rm "$cnt"
# Fallback to webscrape # Fallback to webscrape
elif MC_VERSION=$(download "$BOARD_URL" | grep -o "[0-9][0-9]\.[0-9]\.[0-9]\+" | head -n 1) \ elif MC_VERSION=$(download_stdout "$BOARD_URL" | grep -o "[0-9][0-9]\.[0-9]\.[0-9]\+" | head -n 1) \
&& [[ $MC_VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+ ]]; then && [[ $MC_VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+ ]]; then
mc_version_source="webscrape" mc_version_source="webscrape"
# Fallback to hardcoded value # Fallback to hardcoded value
@@ -969,14 +969,8 @@ install_mc_deb() {
fi fi
} }
# @description Installs Media Center RPM package on RHEL distros # @description Installs Media Center RPM package
install_mc_rhel() { install_mc_rpm() {
debug "Running: ${FUNCNAME[0]}"
install_package --no-install-check --no-gpg-check --allow-downgrades "$MC_RPM"
}
# @description Installs Media Center RPM package on SUSE
install_mc_suse() {
debug "Running: ${FUNCNAME[0]}" debug "Running: ${FUNCNAME[0]}"
install_package --no-install-check --no-gpg-check --allow-downgrades "$MC_RPM" install_package --no-install-check --no-gpg-check --allow-downgrades "$MC_RPM"
} }
@@ -1808,6 +1802,21 @@ download() {
"${cmd[@]}" "$url" "${cmd[@]}" "$url"
} }
download_stdout() {
local url="$1"
local -a cmd
if command -v curl &>/dev/null; then
cmd=(curl --silent --fail --location -o - "$url")
elif command -v wget &>/dev/null; then
cmd=(wget --quiet -O - "$url")
else
err "Neither curl nor wget is available"
return 1
fi
"${cmd[@]}"
}
# Roughly turn debugging on for pre-init # Roughly turn debugging on for pre-init
# Reset and reparse in parse_input() with getopt # Reset and reparse in parse_input() with getopt