YunoHost-Apps / onlyoffice_ynh

OnlyOffice package for YunoHost
https://www.onlyoffice.com
GNU General Public License v3.0
19 stars 19 forks source link

Correct upgrade #73

Closed Gredin67 closed 2 years ago

Gredin67 commented 2 years ago

Problem

Solution

PR Status

Automatic tests

Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ after creating the PR, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization)

Gredin67 commented 2 years ago

!testme

We should probably replace

apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5
ynh_install_extra_repo --repo="deb http://download.onlyoffice.com/repo/debian squeeze main" --append

#=================================================
# UPGRADE ONLYOFFICE
#=================================================
ynh_script_progression --message="Upgrading OnlyOffice..."

# ynh_remove_app_dependencies
ynh_exec_warn_less ynh_add_app_dependencies --package=$extra_dependencies

by something like https://github.com/YunoHost-Apps/mautrix_signal_ynh/blob/master/scripts/upgrade#L128 But we may then fall on the same helper issue https://github.com/YunoHost-Apps/mautrix_signal_ynh/issues/22

yunohost-bot commented 2 years ago

:carousel_horse: Test Badge

Gredin67 commented 2 years ago

!testme

yunohost-bot commented 2 years ago

:rocket: Test Badge

Gredin67 commented 2 years ago

!testme

yunohost-bot commented 2 years ago

:rocket: Test Badge

Gredin67 commented 2 years ago

If the version still does not upgrade properly, instead of doing

# ynh_remove_app_dependencies
ynh_package_remove $extra_dependencies
ynh_install_extra_app_dependencies --repo="https://download.onlyoffice.com/repo/debian squeeze main" --package=$extra_dependencies 

we may have to tweak as in the remove script

#=================================================
# REMOVE ONLYOFFICE
#=================================================
ynh_script_progression --message="Removing OnlyOffice..."

ynh_secure_remove --file=/var/lib/dpkg/info/onlyoffice-documentserver.prerm

# Here you will wonder what the fuck this is, and the answer is : this is a
# fucking stupid hack because onlyoffice's dev deviced to put a "supervisorctl
# update" inside their postrm, but when their postrm is ran, supervisorctl is
# already removed ... so their removal fails which breaks dpkg.
# So instead, we trick it with this stupid link to /bin/true which is removed
# right after.
ln -s /bin/true /usr/local/bin/supervisorctl
ynh_package_autopurge onlyoffice-documentserver
Gredin67 commented 2 years ago
Gredin67 commented 2 years ago

!testme

yunohost-bot commented 2 years ago

May the CI gods be with you! Test Badge

Gredin67 commented 2 years ago

!testme

yunohost-bot commented 2 years ago

Fingers crossed! Test Badge