From eab71d7512507e91f685cbb96f5aef718199a05d Mon Sep 17 00:00:00 2001 From: bryan Date: Fri, 11 Mar 2022 13:28:06 -0500 Subject: [PATCH 1/4] Repalce rsync with cp --- installJRMC | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/installJRMC b/installJRMC index b08dbe7..881cb82 100755 --- a/installJRMC +++ b/installJRMC @@ -1400,14 +1400,14 @@ migrateLibrary() { debug "Running: ${FUNCNAME[0]}" declare mc_user_path="$HOME/.jriver" - declare current_config_path="$mc_user_path/Media Center $MVERSION" declare previous_config_path="$mc_user_path/Media Center $(( MVERSION - 1 ))" if [[ ! -d "$current_config_path" ]] && - [[ -d "$previous_config_path" ]]; then + [[ -d "$previous_config_path" ]] && + mkdir -p "$current_config_path"; then echo "Migrating $previous_config_path to $current_config_path" - rsync -a "$previous_config_path" "$current_config_path" &>/dev/null + cp -a "$previous_config_path" "$current_config_path" &>/dev/null fi } From a7aed3c245776d50eed40dc616de1c5acf1e443b Mon Sep 17 00:00:00 2001 From: bryan Date: Fri, 11 Mar 2022 15:36:28 -0500 Subject: [PATCH 2/4] Add migration info and bump version --- README.md | 2 +- installJRMC | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9d32461..f740269 100755 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This program will install [JRiver Media Center](https://www.jriver.com/) (JRMC) Running `installJRMC` without any options will install the latest version of JRiver Media Center from the official JRiver repository (Ubuntu/Debian) or my [unofficial repository](https://repos.bryanroessler.com/jriver/) (Fedora/CentOS) using the system package manager (`--install repo`). If any other option is specified, then the default install method (i.e. `--install repo` or `--install local`) will need to be explicitly specified. This makes it possible to install services and containers independent of MC. -**Note**: `installJRMC` does not perform library migrations. Before moving to a new major version (i.e. v28->v29), you should first [perform a library backup](https://wiki.jriver.com/index.php/Library_Backup), install the new major version, and then [restore the library](https://wiki.jriver.com/index.php/Restore_a_library). +**Note**: As of 1.0b14 major version library migrations are performed if the destination config directory `$HOME/.jriver/Media Center XX` is missing for major release `XX`. However, it is still a good idea to create a manual library backup before migrating major versions. ## Options diff --git a/installJRMC b/installJRMC index 881cb82..b69c4be 100755 --- a/installJRMC +++ b/installJRMC @@ -18,7 +18,7 @@ shopt -s extglob -declare -g SCRIPTVERSION="1.0b13" +declare -g SCRIPTVERSION="1.0b14" declare -g OUTPUTDIR="$PWD/output" declare -g CREATEREPO_WEBROOT="/var/www/jriver" declare -g USER="${SUDO_USER:-$USER}" @@ -1384,6 +1384,7 @@ disableCoW() { declare mc_user_path="$HOME/.jriver" for dir in "$mc_system_path" "$mc_user_path"; do + ! [[ -d "$dir" ]] && return if [[ $(stat -f -c %T "$dir") == "btrfs" ]] && ! lsattr -d "$dir" | cut -f1 -d" " | grep -q C; then echo "Disabling CoW for $dir" From d8094c0fe1a8304bd2118f2fb712ec3654c5161e Mon Sep 17 00:00:00 2001 From: bryan Date: Sat, 12 Mar 2022 16:08:50 -0500 Subject: [PATCH 3/4] Fix migration --- installJRMC | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installJRMC b/installJRMC index b69c4be..2bd12b1 100755 --- a/installJRMC +++ b/installJRMC @@ -1408,7 +1408,7 @@ migrateLibrary() { [[ -d "$previous_config_path" ]] && mkdir -p "$current_config_path"; then echo "Migrating $previous_config_path to $current_config_path" - cp -a "$previous_config_path" "$current_config_path" &>/dev/null + cp -a "$previous_config_path"/* "$current_config_path" &>/dev/null fi } From 2cb935e336670b525e2c5cf33c2c34cd76bf1705 Mon Sep 17 00:00:00 2001 From: bryan Date: Sat, 12 Mar 2022 16:09:08 -0500 Subject: [PATCH 4/4] Version bump --- installJRMC | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installJRMC b/installJRMC index 2bd12b1..5592950 100755 --- a/installJRMC +++ b/installJRMC @@ -18,7 +18,7 @@ shopt -s extglob -declare -g SCRIPTVERSION="1.0b14" +declare -g SCRIPTVERSION="1.0b15" declare -g OUTPUTDIR="$PWD/output" declare -g CREATEREPO_WEBROOT="/var/www/jriver" declare -g USER="${SUDO_USER:-$USER}"