mirror of
https://github.com/YunoHost-Apps/seafile_ynh.git
synced 2024-09-03 20:26:01 +02:00
Fix upgrade from old version
This commit is contained in:
parent
41369ebe6d
commit
c108375dba
4 changed files with 6 additions and 8 deletions
|
@ -37,7 +37,7 @@ run_seafile_cmd() {
|
|||
}
|
||||
|
||||
install_source() {
|
||||
ynh_setup_source --dest_dir="$install_dir"/seafile_image --full_replace
|
||||
ynh_setup_source_custom --dest_dir="$install_dir"/seafile_image --full_replace
|
||||
mkdir -p "$install_dir"/seafile_image/opt/seafile/{seafile-data,seahub-data,conf,logs}
|
||||
grep "^$app:x" /etc/passwd | sed "s|$install_dir|/opt/seafile|" >> "$install_dir"/seafile_image/etc/passwd
|
||||
grep "^$app:x" /etc/group >> "$install_dir"/seafile_image/etc/group
|
||||
|
|
|
@ -7,10 +7,10 @@
|
|||
# Import common cmd
|
||||
source ./experimental_helper.sh
|
||||
source ./_common.sh
|
||||
source ./ynh_setup_source
|
||||
|
||||
# Source YunoHost helpers
|
||||
source /usr/share/yunohost/helpers
|
||||
source ./ynh_setup_source
|
||||
|
||||
seafile_version=$(ynh_app_upstream_version)
|
||||
seafile_code="$install_dir/seafile_image/opt/seafile/seafile-server-$seafile_version"
|
||||
|
|
|
@ -7,10 +7,10 @@
|
|||
# Import common cmd
|
||||
source ./experimental_helper.sh
|
||||
source ./_common.sh
|
||||
source ./ynh_setup_source
|
||||
|
||||
# Source YunoHost helpers
|
||||
source /usr/share/yunohost/helpers
|
||||
source ./ynh_setup_source
|
||||
|
||||
seafile_version="$(ynh_app_upstream_version)"
|
||||
installed_version="${YNH_APP_CURRENT_VERSION/~ynh*/}"
|
||||
|
@ -125,9 +125,7 @@ case "$installed_version" in
|
|||
;&
|
||||
"7.0"* )
|
||||
# Fix file comment
|
||||
pushd "$seafile_code"
|
||||
run_seafile_cmd "/opt/seafile/seafile-server-$seafile_version/seahub.sh" python-env python3 seahub/manage.py migrate_file_comment
|
||||
popd
|
||||
run_seafile_cmd "/opt/seafile/seafile-server-$seafile_version/seahub.sh" python-env python3 "/opt/seafile/seafile-server-$seafile_version/seahub/manage.py" migrate_file_comment
|
||||
|
||||
# Update seafile by script
|
||||
ynh_replace_string --match_string='read dummy' --replace_string='# patched' --target_file="$seafile_code/upgrade/upgrade_7.0_7.1.sh"
|
||||
|
@ -155,7 +153,7 @@ case "$installed_version" in
|
|||
"10."* )
|
||||
ynh_replace_string --match_string='read dummy' --replace_string='# patched' --target_file="$seafile_code/upgrade/upgrade_9.0_10.0.sh"
|
||||
run_seafile_cmd "/opt/seafile/seafile-server-$seafile_version/upgrade/upgrade_9.0_10.0.sh"
|
||||
sudo -u "$app" "$install_dir"/venv/bin/python "$seafile_code/migrate_ldapusers.py"
|
||||
run_seafile_cmd "/opt/seafile/seafile-server-$seafile_version/seahub.sh" python-env python3 "/opt/seafile/seafile-server-$seafile_version/migrate_ldapusers.py"
|
||||
;&
|
||||
esac
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#
|
||||
# WARNING Note it's a patched version of the official helper with a fix for docker specific to arm64
|
||||
#
|
||||
ynh_setup_source() {
|
||||
ynh_setup_source_custom() {
|
||||
# Declare an array to define the options of this helper.
|
||||
local legacy_args=dsk
|
||||
local -A args_array=([d]=dest_dir= [s]=source_id= [k]=keep= [r]=full_replace=)
|
||||
|
|
Loading…
Reference in a new issue