From c33603bb0ab2b7ef466b3b8c85f1a7750b29d38e Mon Sep 17 00:00:00 2001 From: bryan Date: Thu, 24 Apr 2025 03:23:35 -0400 Subject: [PATCH] Only match host repo on newer MC versions --- installJRMC | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/installJRMC b/installJRMC index 6b6df9c..5541c2c 100755 --- a/installJRMC +++ b/installJRMC @@ -381,8 +381,8 @@ init() { BUILD_TARGET="${BUILD_TARGET:-$ID}" CREATEREPO_TARGET="${CREATEREPO_TARGET:-$ID}" - # Match the MC repo to the host unless specified by user - if [[ $ID =~ debian|ubuntu && -z $USER_MC_REPO && -z $USER_MC_MVERSION ]]; then + # Match newer MC repos to the host unless overriden by user + if [[ $ID =~ debian|ubuntu && (-z $USER_MC_REPO || $USER_MC_MVERSION -ge 31) ]]; then MC_REPO=${UBUNTU_CODENAME:-${VERSION_CODENAME:-$MC_REPO}} fi @@ -725,15 +725,13 @@ acquire_deb() { fi fi - # Define the repositories to check - local repos=( + # Define the repositories to search + local -a repos + [[ -n $BETAPASS ]] && repos=("https://files.jriver-cdn.com/mediacenter/channels/v$MC_MVERSION/beta/$BETAPASS/$fname") + repos+=( "https://files.jriver-cdn.com/mediacenter/channels/v$MC_MVERSION/latest/$fname" "https://files.jriver-cdn.com/mediacenter/test/$fname") - if [[ -n $BETAPASS ]]; then - repos=("https://files.jriver-cdn.com/mediacenter/channels/v$MC_MVERSION/beta/$BETAPASS/$fname" "${repos[@]}") - fi - # Loop through the repositories and attempt to download local found=0 for repo in "${repos[@]}"; do @@ -953,9 +951,10 @@ install_mc_deb() { execute sed -E -i 's/,[[:space:]]*libwebkit2gtk[^,]*(,|\?)?//g' control # TODO workaround for legacy ZorinOS - [[ $ID == "ubuntu" && ${VERSION_ID%.*} -le 16 ]] && - grep -q zorin /etc/os-release && - execute sed -i 's/libva2/libva1/g' control + if [[ $ID == "ubuntu" && ${VERSION_ID%.*} -le 16 ]] && + grep -q zorin /etc/os-release; then + execute sed -i 's/libva2/libva1/g' control + fi execute tar -cJf "control.tar.xz" "control" "postinst" declare -g MC_DEB="${MC_DEB/.deb/.compat.deb}"