diff --git a/installJRMC b/installJRMC index 2344988..503fee5 100755 --- a/installJRMC +++ b/installJRMC @@ -681,61 +681,62 @@ install_mc_repo() { fi } +# # @description Acquires the source DEB package from JRiver (deprecated) +# acquire_deb() { +# debug "${FUNCNAME[0]}()" +# declare -g MC_SOURCE +# local fname + +# [[ -d $OUTPUT_DIR/SOURCES ]] || execute mkdir -p "$OUTPUT_DIR/SOURCES" + +# # Usually JRiver excludes the release number from the filename +# # but in some cases (test builds) it may be included +# if [[ $MC_RELEASE -gt 1 ]]; then +# fname="MediaCenter-$MC_VERSION-$MC_RELEASE-$MC_ARCH.deb" +# else +# fname="MediaCenter-$MC_VERSION-$MC_ARCH.deb" +# fi + +# declare -g MC_DEB="$OUTPUT_DIR/SOURCES/$fname" + +# # If deb file already exists, skip download +# if [[ -f $MC_DEB ]]; then +# if [[ $(stat -c%s "$MC_DEB") -lt 10000000 ]]; then +# echo "Removing existing DEB under 10MB: $MC_DEB" +# execute rm "$MC_DEB" +# else +# echo "Using existing DEB: $MC_DEB" +# # Use dummy source since we don't know where it came from +# # TODO could attach source tag to filename +# MC_SOURCE="https://files.jriver-cdn.com/mediacenter/channels/v$MC_MVERSION/latest/$fname" +# return 0 +# fi +# fi + +# # 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") + +# # Loop through the repositories and attempt to download +# local found=0 +# for repo in "${repos[@]}"; do +# echo "Checking $repo for DEB package" +# if download "$repo" "$MC_DEB"; then +# echo "Found" +# found=1 +# MC_SOURCE="$repo" +# break +# fi +# done + +# # Return if the download was successful +# ((found)) && [[ -f $MC_DEB ]] +# } + # @description Acquires the source DEB package from JRiver -acquire_deb() { - debug "${FUNCNAME[0]}()" - declare -g MC_SOURCE - local fname - - [[ -d $OUTPUT_DIR/SOURCES ]] || execute mkdir -p "$OUTPUT_DIR/SOURCES" - - # Usually JRiver excludes the release number from the filename - # but in some cases (test builds) it may be included - if [[ $MC_RELEASE -gt 1 ]]; then - fname="MediaCenter-$MC_VERSION-$MC_RELEASE-$MC_ARCH.deb" - else - fname="MediaCenter-$MC_VERSION-$MC_ARCH.deb" - fi - - declare -g MC_DEB="$OUTPUT_DIR/SOURCES/$fname" - - # If deb file already exists, skip download - if [[ -f $MC_DEB ]]; then - if [[ $(stat -c%s "$MC_DEB") -lt 10000000 ]]; then - echo "Removing existing DEB under 10MB: $MC_DEB" - execute rm "$MC_DEB" - else - echo "Using existing DEB: $MC_DEB" - # Use dummy source since we don't know where it came from - # TODO could attach source tag to filename - MC_SOURCE="https://files.jriver-cdn.com/mediacenter/channels/v$MC_MVERSION/latest/$fname" - return 0 - fi - fi - - # 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") - - # Loop through the repositories and attempt to download - local found=0 - for repo in "${repos[@]}"; do - echo "Checking $repo for DEB package" - if download "$repo" "$MC_DEB"; then - echo "Found" - found=1 - MC_SOURCE="$repo" - break - fi - done - - # Return if the download was successful - ((found)) && [[ -f $MC_DEB ]] -} - acquire_deb_new() { debug "${FUNCNAME[0]}()" declare -g MC_DEB MC_SOURCE @@ -765,7 +766,7 @@ acquire_deb_new() { fi # Download the deb file using the containerized package manager - if ! { create_mc_apt_container "apt-get -t $MC_REPO download --allow-unauthenticated mediacenter$MC_MVERSION" && + if ! { create_mc_apt_container "apt-get -o Acquire::Sandbox::User=root -t $MC_REPO download --allow-unauthenticated mediacenter$MC_MVERSION" && mnt="$(sudo buildah mount "$CNT")" && execute sudo find "$mnt" -maxdepth 1 -type f -name "*.deb" -exec cp {} "$MC_DEB" \; && [[ -f $MC_DEB ]] &&