diff --git a/scripts/_common.sh b/scripts/_common.sh index ed1a2b8..59992d6 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -120,6 +120,15 @@ ynh_debian_release () { lsb_release --codename --short } +is_buster () { + if [ "$(ynh_debian_release)" == "buster" ] + then + return 0 + else + return 1 + fi +} + is_stretch () { if [ "$(ynh_debian_release)" == "stretch" ] then diff --git a/scripts/upgrade b/scripts/upgrade index 3401b3b..139e4ee 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -57,10 +57,14 @@ if grep "borg.timer" /etc/yunohost/services.yml > /dev/null ; then fi # Replace backports with pip -if is_stretch; then +if is_buster; then + if [ ! -f /opt/borg-env/buster ] ; then rm -f /etc/apt/sources.list.d/$app-stretch-backports.list - + ynh_secure_remove /opt/borg-env install_borg_with_pip + touch /opt/borg-env/buster + fi + fi #=================================================