mirror of
https://github.com/YunoHost-Apps/borg_ynh.git
synced 2024-09-03 18:16:05 +02:00
[fix] Use pip instead backport (#32)
* [fix] Use pip instead backport * [fix] Don't remove backport in remove script * [fix] Remove backport in restore script * [fix] Replace backports with pip during upgrade * [fix] Update version number * [fix] Remove backports if exists * [enh] Delete dead code * [fix] Remove backports if they exists * [fix] Don't install backports
This commit is contained in:
parent
c15bb2d799
commit
c01074739e
6 changed files with 33 additions and 33 deletions
|
@ -6,7 +6,7 @@
|
|||
"en": "Backup your server with borg.",
|
||||
"fr": "Sauvegarder votre serveur avec borg."
|
||||
},
|
||||
"version": "1.0.3",
|
||||
"version": "1.1.10~ynh1",
|
||||
"url": "https://borgbackup.readthedocs.io",
|
||||
"license": "BSD-3-Clause",
|
||||
"maintainer": {
|
||||
|
|
|
@ -190,13 +190,8 @@ ynh_check_app_version_changed () {
|
|||
echo $return_value
|
||||
}
|
||||
|
||||
|
||||
ynh_install_backports () {
|
||||
echo "deb http://httpredir.debian.org/debian stretch-backports main" > /etc/apt/sources.list.d/$app-stretch-backports.list
|
||||
}
|
||||
|
||||
ynh_remove_backports () {
|
||||
rm /etc/apt/sources.list.d/$app-stretch-backports.list
|
||||
rm -f /etc/apt/sources.list.d/$app-stretch-backports.list
|
||||
}
|
||||
|
||||
ynh_debian_release () {
|
||||
|
|
|
@ -30,26 +30,16 @@ ynh_export server ssh_user passphrase on_calendar conf data apps
|
|||
ynh_save_args server ssh_user passphrase on_calendar conf data apps
|
||||
|
||||
#=================================================
|
||||
# CONFIGURE BACKPORTS
|
||||
#=================================================
|
||||
# We need borg 1.1+ available only in backports
|
||||
if is_stretch; then
|
||||
ynh_install_backports
|
||||
fi
|
||||
#=================================================
|
||||
# STORE SETTINGS FROM MANIFEST
|
||||
# INSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_install_app_dependencies $pkg_dependencies
|
||||
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
|
||||
|
||||
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
|
||||
chmod u+x /usr/local/bin/borg
|
||||
fi
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -21,7 +21,7 @@ app=$YNH_APP_INSTANCE_NAME
|
|||
ynh_remove_app_dependencies
|
||||
|
||||
#=================================================
|
||||
# REMOVE BACKPORTS
|
||||
# REMOVE BACKPORTS IF EXISTS
|
||||
#=================================================
|
||||
ynh_remove_backports
|
||||
|
||||
|
|
|
@ -30,17 +30,19 @@ app=$YNH_APP_INSTANCE_NAME
|
|||
server=$(ynh_app_setting_get $app server)
|
||||
ssh_user=$(ynh_app_setting_get $app ssh_user)
|
||||
|
||||
#=================================================
|
||||
# CONFIGURE BACKPORTS
|
||||
#=================================================
|
||||
# We need borg 1.1+ available only in backports
|
||||
ynh_install_backports
|
||||
|
||||
#=================================================
|
||||
# INSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_install_app_dependencies $pkg_dependencies
|
||||
ynh_package_install -t stretch-backports borgbackup
|
||||
|
||||
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
|
||||
chmod u+x /usr/local/bin/borg
|
||||
fi
|
||||
|
||||
|
||||
#=================================================
|
||||
# ACTIVATE BACKUP METHODS
|
||||
|
|
|
@ -39,3 +39,16 @@ if grep "borg.timer" /etc/yunohost/services.yml > /dev/null ; then
|
|||
systemctl enable $app.timer
|
||||
systemctl start $app.timer
|
||||
fi
|
||||
|
||||
# Replace backports with pip
|
||||
if is_stretch; then
|
||||
ynh_remove_backports
|
||||
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
|
||||
chmod u+x /usr/local/bin/borg
|
||||
fi
|
||||
fi
|
||||
|
|
Loading…
Add table
Reference in a new issue