Browse Source

fix upgrade

pull/327/head
Kay0u 6 years ago
parent
commit
74f3112fea
No known key found for this signature in database GPG Key ID: AE1DCADB6415A156
  1. 7
      scripts/install
  2. 25
      scripts/upgrade
  3. 9
      scripts/upgrade.d/upgrade.last.sh

7
scripts/install

@ -273,7 +273,12 @@ exec_occ background:cron
# POST-INSTALL MAINTENANCE
#=================================================
(cd /tmp ; at now + 10 minutes <<< "(cd $final_path ; sudo -u $app php${YNH_PHP_VERSION} occ db:add-missing-indices ; sudo -u $app php${YNH_PHP_VERSION} occ db:convert-filecache-bigint -n) > /tmp/${app}_maintenance.log")
(
cd $final_path
sudo -u $app php${YNH_PHP_VERSION} occ db:add-missing-indices
sudo -u $app php${YNH_PHP_VERSION} occ db:add-missing-columns
sudo -u $app php${YNH_PHP_VERSION} occ db:convert-filecache-bigint -n
)
#=================================================
# CONFIGURE THE HOOK FILE FOR USER CREATE

25
scripts/upgrade

@ -229,6 +229,8 @@ then
source upgrade.d/upgrade.last.sh
last_version=$next_version
last_major_version=${last_version%%.*}
# Set write access for the following commands
chown -R $app: "$final_path" "$datadir"
@ -240,23 +242,19 @@ then
do
# The major version is the first part of the version number
# major_version=${next_version%%.*}
major_version=${last_version%%.*}
current_major_version=${current_version%%.*}
# Load the value for this version
source upgrade.d/upgrade.$current_major_version.sh
# If the current version has the same major version than the next one,
# then it's the last upgrade to do
# We also cover the case where the last version is the first of the current major version series
# (e.g. 19.0.0 is the latest version)
if [[ ("$major_version" -eq "$current_major_version") || ( ("$major_version" -eq "$((current_major_version+1))") && ("$next_version" == "$last_version") ) ]]; then
if [ "$last_major_version" -eq "$current_major_version" ]; then
current_major_version=last
# Execute the commands dedicated to the last upgrade
last_upgrade_operations
# Enable YunoHost patches on Nextcloud sources
cp -a ../sources/patches_last_version/* ../sources/patches
fi
# Load the value for this version
source upgrade.d/upgrade.$current_major_version.sh
ynh_print_info --message="Upgrade to nextcloud $next_version"
# Create an app.src for this version of nextcloud
@ -311,6 +309,13 @@ then
exec_occ -V
done
(
cd $final_path
sudo -u $app php${YNH_PHP_VERSION} occ db:add-missing-indices
sudo -u $app php${YNH_PHP_VERSION} occ db:add-missing-columns
sudo -u $app php${YNH_PHP_VERSION} occ db:convert-filecache-bigint -n
)
#=================================================
# CONFIGURE NEXTCLOUD
#=================================================

9
scripts/upgrade.d/upgrade.last.sh

@ -5,12 +5,3 @@ next_version="19.0.1"
# Nextcloud tarball checksum sha256
nextcloud_source_sha256="4ef311e00d939915d3a9714cd3a1ad436db9157e04620e4a88c2f427e5e65b2d"
# This function will only be executed upon applying the last upgrade referenced above
last_upgrade_operations () {
# Patch nextcloud files only for the last version
cp -a ../sources/patches_last_version/* ../sources/patches
# Execute post-upgrade operations later on
(cd /tmp ; at now + 10 minutes <<< "(cd $final_path ; sudo -u $app php${YNH_PHP_VERSION} occ db:add-missing-indices ; sudo -u $app php${YNH_PHP_VERSION} occ db:add-missing-columns ; sudo -u $app php${YNH_PHP_VERSION} occ db:convert-filecache-bigint -n) > /tmp/${app}_maintenance.log")
}
Loading…
Cancel
Save