Remove explicit version check
This commit is contained in:
@@ -31,7 +31,7 @@ $ installJRMC --help
|
|||||||
--compat
|
--compat
|
||||||
Build/install MC without minimum dependency version requirements.
|
Build/install MC without minimum dependency version requirements.
|
||||||
--mcversion VERSION
|
--mcversion VERSION
|
||||||
Specify the MC version, ex. "33", "34.0.51", or "34.0.51-1" (default: latest).
|
Specify the MC version, ex. "33", "34.0.58", or "34.0.58-1" (default: latest).
|
||||||
--arch ARCH
|
--arch ARCH
|
||||||
Specify the target MC architecture, ex. "amd64", "arm64", etc (default: host architecture).
|
Specify the target MC architecture, ex. "amd64", "arm64", etc (default: host architecture).
|
||||||
--mcrepo REPO
|
--mcrepo REPO
|
||||||
@@ -126,8 +126,8 @@ Install the latest version of MC33 from the best available repository with debug
|
|||||||
Install a more widely-compatible version of the latest MC version.
|
Install a more widely-compatible version of the latest MC version.
|
||||||
[code]installJRMC --install repo --service jriver-mediacenter --service-type user[/code]
|
[code]installJRMC --install repo --service jriver-mediacenter --service-type user[/code]
|
||||||
Install MC from the repository and start/enable jriver-mediacenter.service as a user service.
|
Install MC from the repository and start/enable jriver-mediacenter.service as a user service.
|
||||||
[code]installJRMC --install local --compat --restorefile /path/to/license.mjr --mcversion 34.0.51[/code]
|
[code]installJRMC --install local --compat --restorefile /path/to/license.mjr --mcversion 34.0.58[/code]
|
||||||
Build and install an MC 34.0.51 comptability RPM locally and activate it using the [tt]/path/to/license.mjr[/tt].
|
Build and install an MC 34.0.58 comptability RPM locally and activate it using the [tt]/path/to/license.mjr[/tt].
|
||||||
[code]installJRMC --createrepo --createrepo-webroot /srv/jriver/repo --createrepo-user www-user[/code]
|
[code]installJRMC --createrepo --createrepo-webroot /srv/jriver/repo --createrepo-user www-user[/code]
|
||||||
Build an RPM locally for the current distro, move it to the webroot, and run createrepo as www-user.
|
Build an RPM locally for the current distro, move it to the webroot, and run createrepo as www-user.
|
||||||
[code]installJRMC --service jriver-createrepo --createrepo-webroot /srv/jriver/repo --createrepo-user www-user[/code]
|
[code]installJRMC --service jriver-createrepo --createrepo-webroot /srv/jriver/repo --createrepo-user www-user[/code]
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ $ installJRMC --help
|
|||||||
--compat
|
--compat
|
||||||
Build/install MC without minimum dependency version requirements.
|
Build/install MC without minimum dependency version requirements.
|
||||||
--mcversion VERSION
|
--mcversion VERSION
|
||||||
Build or install a specific MC version, ex. "34.0.51" or "33" (default: latest).
|
Build or install a specific MC version, ex. "34.0.58" or "33" (default: latest).
|
||||||
--mcrepo REPO
|
--mcrepo REPO
|
||||||
Specify the MC repository, ex. "bullseye", "bookworm", "noble", etc (default: latest official).
|
Specify the MC repository, ex. "bullseye", "bookworm", "noble", etc (default: latest official).
|
||||||
--arch ARCH
|
--arch ARCH
|
||||||
@@ -130,9 +130,9 @@ Multiple services (but not `--service-types`) can be installed at one time using
|
|||||||
|
|
||||||
Install MC from the repository and start/enable `jriver-mediacenter.service` as a user service.
|
Install MC from the repository and start/enable `jriver-mediacenter.service` as a user service.
|
||||||
|
|
||||||
* `installJRMC --install local --compat --restorefile /path/to/license.mjr --mcversion 34.0.51`
|
* `installJRMC --install local --compat --restorefile /path/to/license.mjr --mcversion 34.0.58`
|
||||||
|
|
||||||
Build and install an MC 34.0.51 compatibility RPM locally and activate it using the `/path/to/license.mjr`.
|
Build and install an MC 34.0.58 compatibility RPM locally and activate it using the `/path/to/license.mjr`.
|
||||||
|
|
||||||
* `installJRMC --createrepo --createrepo-webroot /srv/jriver/repo --createrepo-user www-user`
|
* `installJRMC --createrepo --createrepo-webroot /srv/jriver/repo --createrepo-user www-user`
|
||||||
|
|
||||||
|
|||||||
25
installJRMC
25
installJRMC
@@ -22,7 +22,7 @@
|
|||||||
shopt -s extglob
|
shopt -s extglob
|
||||||
|
|
||||||
declare -g SCRIPT_VERSION="1.34.9-dev"
|
declare -g SCRIPT_VERSION="1.34.9-dev"
|
||||||
declare -g MC_VERSION="34.0.51" # do find all replace (hardcoded fallback)
|
declare -g MC_VERSION="34.0.58" # do find all replace (hardcoded fallback)
|
||||||
declare -g MC_REPO="bookworm" # should match the MC_VERSION
|
declare -g MC_REPO="bookworm" # should match the MC_VERSION
|
||||||
declare -g BOARD_ID="89.0" # MC34 board ID for automatic version detection
|
declare -g BOARD_ID="89.0" # MC34 board ID for automatic version detection
|
||||||
declare -gi SELF_UPDATE_SWITCH=1 # 0 to disable installJRMC self-update
|
declare -gi SELF_UPDATE_SWITCH=1 # 0 to disable installJRMC self-update
|
||||||
@@ -208,7 +208,7 @@ parse_input() {
|
|||||||
err "Incorrect option provided, see installJRMC --help"; exit 1
|
err "Incorrect option provided, see installJRMC --help"; exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set some default conditions
|
# Default to --install=repo (can be overridden later by OS defaults)
|
||||||
if ! ((UNINSTALL_SWITCH || BUILD_SWITCH || CREATEREPO_SWITCH || LOCAL_INSTALL_SWITCH
|
if ! ((UNINSTALL_SWITCH || BUILD_SWITCH || CREATEREPO_SWITCH || LOCAL_INSTALL_SWITCH
|
||||||
|| CONTAINER_INSTALL_SWITCH || SNAP_INSTALL_SWITCH || APPIMAGE_INSTALL_SWITCH)) &&
|
|| CONTAINER_INSTALL_SWITCH || SNAP_INSTALL_SWITCH || APPIMAGE_INSTALL_SWITCH)) &&
|
||||||
[[ ${#SERVICES[@]} -eq 0 && ${#CONTAINERS[@]} -eq 0 ]]; then
|
[[ ${#SERVICES[@]} -eq 0 && ${#CONTAINERS[@]} -eq 0 ]]; then
|
||||||
@@ -257,11 +257,6 @@ init() {
|
|||||||
|
|
||||||
# Get host information and immediately fail if required vars are unavailable
|
# Get host information and immediately fail if required vars are unavailable
|
||||||
[[ -f /etc/os-release ]] && source /etc/os-release
|
[[ -f /etc/os-release ]] && source /etc/os-release
|
||||||
if [[ -n $ID && -n $VERSION_ID ]]; then
|
|
||||||
err "Failed to detect OS ID and VERSION_ID"
|
|
||||||
err "Use ID=debian VERSION_ID=12 installJRMC to pass manually"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Detect host architecture and translate to MC convention
|
# Detect host architecture and translate to MC convention
|
||||||
if ARCH=$(uname -m); then
|
if ARCH=$(uname -m); then
|
||||||
@@ -287,7 +282,7 @@ init() {
|
|||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Normalize ID and set host-specific vars
|
# Normalize ID and set OS defaults
|
||||||
case $ID in
|
case $ID in
|
||||||
debian|fedora|centos) ;;
|
debian|fedora|centos) ;;
|
||||||
rhel|almalinux) ID="centos" ;;
|
rhel|almalinux) ID="centos" ;;
|
||||||
@@ -314,7 +309,7 @@ init() {
|
|||||||
BUILD_SWITCH=1
|
BUILD_SWITCH=1
|
||||||
LOCAL_INSTALL_SWITCH=1
|
LOCAL_INSTALL_SWITCH=1
|
||||||
fi ;;
|
fi ;;
|
||||||
*) err "Auto-detecting distro, this is unreliable and --compat may be required"
|
*) err "Auto-detecting OS, this is unreliable and --compat may be required."
|
||||||
for cmd in dnf yum apt-get pacman; do
|
for cmd in dnf yum apt-get pacman; do
|
||||||
if command -v "$cmd" &>/dev/null; then
|
if command -v "$cmd" &>/dev/null; then
|
||||||
case "$cmd" in
|
case "$cmd" in
|
||||||
@@ -330,7 +325,7 @@ init() {
|
|||||||
if [[ -z $ID ]]; then
|
if [[ -z $ID ]]; then
|
||||||
err "OS detection failed!"
|
err "OS detection failed!"
|
||||||
if ask_ok "Continue with manual installation?"; then
|
if ask_ok "Continue with manual installation?"; then
|
||||||
debug "Automatically using --install=local for unknown distro"
|
debug "Automatically using --install=local for unknown distro."
|
||||||
ID="unknown"
|
ID="unknown"
|
||||||
REPO_INSTALL_SWITCH=0
|
REPO_INSTALL_SWITCH=0
|
||||||
BUILD_SWITCH=1
|
BUILD_SWITCH=1
|
||||||
@@ -341,7 +336,7 @@ init() {
|
|||||||
fi ;;
|
fi ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Set distro-specific package manager commands for normalized IDs
|
# Set distro-specific package manager commands for normalized OS
|
||||||
case $ID in
|
case $ID in
|
||||||
fedora|centos|mandriva)
|
fedora|centos|mandriva)
|
||||||
local rpm_mgr
|
local rpm_mgr
|
||||||
@@ -395,7 +390,7 @@ init() {
|
|||||||
|
|
||||||
echo "MC source -> target: $MC_REPO $MC_ARCH -> $BUILD_TARGET $ARCH"
|
echo "MC source -> target: $MC_REPO $MC_ARCH -> $BUILD_TARGET $ARCH"
|
||||||
|
|
||||||
# Retrieves the latest MC version number if we need it
|
# Retrieve the latest MC version number if we need it
|
||||||
if ((BUILD_SWITCH || LOCAL_INSTALL_SWITCH || CREATEREPO_SWITCH)); then
|
if ((BUILD_SWITCH || LOCAL_INSTALL_SWITCH || CREATEREPO_SWITCH)); then
|
||||||
get_latest_mc_version
|
get_latest_mc_version
|
||||||
fi
|
fi
|
||||||
@@ -476,7 +471,7 @@ install_package() {
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
# Define distribution-specific package aliases
|
# Distribution-specific package aliases
|
||||||
case $ID in
|
case $ID in
|
||||||
debian|ubuntu) pkg_aliases=(
|
debian|ubuntu) pkg_aliases=(
|
||||||
[rpm-build]="rpm"
|
[rpm-build]="rpm"
|
||||||
@@ -509,7 +504,7 @@ install_package() {
|
|||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
# Generate installation flags based on the distribution
|
# Add OS install flags to package manager command
|
||||||
case $ID in
|
case $ID in
|
||||||
debian|ubuntu)
|
debian|ubuntu)
|
||||||
((allow_downgrades)) && install_flags+=(--allow-downgrades)
|
((allow_downgrades)) && install_flags+=(--allow-downgrades)
|
||||||
@@ -928,7 +923,7 @@ translate_packages() {
|
|||||||
unset requires_arr recommends_arr
|
unset requires_arr recommends_arr
|
||||||
}
|
}
|
||||||
|
|
||||||
# @description Creates a SPEC file and builds the RPM from the source DEB using rpmbuild
|
# @description Creates an RPM .spec file and builds the RPM from the source DEB using rpmbuild
|
||||||
build_rpm() {
|
build_rpm() {
|
||||||
debug "${FUNCNAME[0]}()"
|
debug "${FUNCNAME[0]}()"
|
||||||
# shellcheck disable=SC2178
|
# shellcheck disable=SC2178
|
||||||
|
|||||||
Reference in New Issue
Block a user