mirror of
https://github.com/YunoHost-Apps/minetest_ynh.git
synced 2024-09-03 20:36:00 +02:00
Fixed upgrade
This commit is contained in:
parent
7479885c96
commit
1b1bdbfd82
2 changed files with 7 additions and 8 deletions
|
@ -25,7 +25,7 @@
|
||||||
multi_instance=1
|
multi_instance=1
|
||||||
incorrect_path=0
|
incorrect_path=0
|
||||||
port_already_use=1
|
port_already_use=1
|
||||||
change_url=0
|
change_url=1
|
||||||
|
|
||||||
;;; Levels
|
;;; Levels
|
||||||
# If the level 5 (Package linter) is forced to 1. Please add justifications here.
|
# If the level 5 (Package linter) is forced to 1. Please add justifications here.
|
||||||
|
|
|
@ -118,8 +118,6 @@ mkdir -p /home/yunohost.app/$app/.minetest/
|
||||||
mkdir /home/yunohost.app/$app/.minetest/worlds/
|
mkdir /home/yunohost.app/$app/.minetest/worlds/
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cp -a ../conf/minetest.conf /home/yunohost.app/$app/.minetest/
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC UPGRADE
|
# SPECIFIC UPGRADE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -134,16 +132,15 @@ make -j$(nproc)
|
||||||
|
|
||||||
popd
|
popd
|
||||||
|
|
||||||
### Verify the checksum of a file, stored by `ynh_store_file_checksum` in the install script.
|
|
||||||
### And create a backup of this file if the checksum is different. So the file will be backed up if the admin had modified it.
|
|
||||||
ynh_backup_if_checksum_is_different --file="$home_path/.minetest/minetest.conf"
|
|
||||||
# Recalculate and store the checksum of the file for the next upgrade.
|
|
||||||
ynh_store_file_checksum --file="$home_path/.minetest/minetest.conf"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# MODIFY A CONFIG FILE
|
# MODIFY A CONFIG FILE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
|
ynh_backup_if_checksum_is_different --file="$home_path/.minetest/minetest.conf"
|
||||||
|
|
||||||
|
cp ../conf/minetest.conf $home/.minetest/minetest.conf
|
||||||
|
|
||||||
### `ynh_replace_string` is used to replace a string in a file.
|
### `ynh_replace_string` is used to replace a string in a file.
|
||||||
### (It's compatible with sed regular expressions syntax)
|
### (It's compatible with sed regular expressions syntax)
|
||||||
|
|
||||||
|
@ -156,6 +153,8 @@ ynh_replace_string --match_string="__PVP__" --replace_string="$pvp" --target_fil
|
||||||
ynh_replace_string --match_string="__CREATIVE__" --replace_string="$creative" --target_file="$home_path/.minetest/minetest.conf"
|
ynh_replace_string --match_string="__CREATIVE__" --replace_string="$creative" --target_file="$home_path/.minetest/minetest.conf"
|
||||||
ynh_replace_string --match_string="__DAMAGE__" --replace_string="$damage" --target_file="$home_path/.minetest/minetest.conf"
|
ynh_replace_string --match_string="__DAMAGE__" --replace_string="$damage" --target_file="$home_path/.minetest/minetest.conf"
|
||||||
|
|
||||||
|
ynh_store_file_checksum --file="$home_path/.minetest/minetest.conf"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP LOGROTATE
|
# SETUP LOGROTATE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Reference in a new issue