1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/borg_ynh.git synced 2024-09-03 18:16:05 +02:00

[enh] Support jessie anew

This commit is contained in:
ljf 2018-09-03 19:07:55 +02:00
parent 6d80785cec
commit 9b6c3f5ccc
3 changed files with 36 additions and 4 deletions

View file

@ -15,7 +15,7 @@
"url": "https://reflexlibre.net"
},
"requirements": {
"yunohost": ">= 3.1"
"yunohost": ">= 2.7.14"
},
"multi_instance": true,
"services": [],

View file

@ -198,3 +198,25 @@ ynh_install_backports () {
ynh_remove_backports () {
rm /etc/apt/sources.list.d/$app-stretch-backports.list
}
ynh_debian_release () {
lsb_release --codename --short
}
is_stretch () {
if [ "$(ynh_debian_release)" == "stretch" ]
then
return 0
else
return 1
fi
}
is_jessie () {
if [ "$(ynh_debian_release)" == "jessie" ]
then
return 0
else
return 1
fi
}

View file

@ -33,13 +33,23 @@ ynh_save_args server ssh_user passphrase on_calendar conf data apps
# CONFIGURE BACKPORTS
#=================================================
# We need borg 1.1+ available only in backports
ynh_install_backports
if is_stretch; then
ynh_install_backports
fi
#=================================================
# STORE SETTINGS FROM MANIFEST
#=================================================
ynh_install_app_dependencies $pkg_dependencies
ynh_package_install -t stretch-backports borgbackup
if is_stretch; then
ynh_package_install -t stretch-backports borgbackup
else
if [ ! -d /opt/borg-env ]; then
virtualenv --python=python3 /opt/borg-env
/opt/borg-env/bin/python /opt/borg-env/bin/pip install borgbackup
echo "#!/bin/bash
/opt/borg-env/bin/python /opt/borg-env/bin/borg \"\$@\"" > /usr/local/bin/borg
fi
fi
#=================================================
# ACTIVATE BACKUP METHODS