aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authoryalh76 <yalh@yahoo.com>2019-03-22 23:59:16 +0100
committeryalh76 <yalh@yahoo.com>2019-03-22 23:59:16 +0100
commitdddaefcd63215f3416e387dcc2cf94b89c73d682 (patch)
treef24af8095b598b50d66dea93d9617fc5348f1d5a /scripts
parent5cd0ad6b49991cf45a74b4a6c9db3e3bb5e4ebb4 (diff)
downloadmastodon_ynh-dddaefcd63215f3416e387dcc2cf94b89c73d682.tar.gz
mastodon_ynh-dddaefcd63215f3416e387dcc2cf94b89c73d682.tar.bz2
mastodon_ynh-dddaefcd63215f3416e387dcc2cf94b89c73d682.zip
adding ynh_add_secure_repos__2
Diffstat (limited to 'scripts')
-rw-r--r--scripts/install7
-rw-r--r--scripts/remove10
-rw-r--r--scripts/restore8
-rw-r--r--scripts/upgrade8
4 files changed, 14 insertions, 19 deletions
diff --git a/scripts/install b/scripts/install
index e57dbab..bf52357 100644
--- a/scripts/install
+++ b/scripts/install
@@ -92,12 +92,11 @@ if [[ "$arch" = arm* ]]; then
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7638D0442B90D010
fi
-# Install source.list debian package backports & yarn
+# Install extra_repo debian package backports & yarn
if [ "$(lsb_release --codename --short)" == "jessie" ]; then
- echo "deb http://httpredir.debian.org/debian jessie-backports main" | tee /etc/apt/sources.list.d/jessie-backports.list
+ ynh_install_extra_repo --repo="deb http://httpredir.debian.org/debian jessie-backports main"
fi
-curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
-echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
+ynh_install_extra_repo --repo="deb https://dl.yarnpkg.com/debian/ stable main" --key="https://dl.yarnpkg.com/debian/pubkey.gpg"
ynh_package_update
# install nodejs
diff --git a/scripts/remove b/scripts/remove
index 8880c9c..3436bce 100644
--- a/scripts/remove
+++ b/scripts/remove
@@ -9,6 +9,7 @@
source _common.sh
source /usr/share/yunohost/helpers
source ynh_install_ruby
+source ynh_add_secure_repos__2
#=================================================
# LOAD SETTINGS
@@ -77,13 +78,8 @@ ynh_remove_ruby
ynh_remove_app_dependencies
ynh_remove_nodejs
-#=================================================
-# REMOVE APT SOURCES
-#=================================================
-ynh_print_info "Removing apt sources"
-
-ynh_secure_remove "/etc/apt/sources.list.d/jessie-backports.list"
-ynh_secure_remove "/etc/apt/sources.list.d/yarn.list"
+ynh_remove_extra_repo jessie-backports
+ynh_remove_extra_repo yarn
#=================================================
# REMOVE APP MAIN DIR
diff --git a/scripts/restore b/scripts/restore
index 39de26e..c74eadc 100644
--- a/scripts/restore
+++ b/scripts/restore
@@ -10,6 +10,7 @@
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
source ../settings/scripts/ynh_install_ruby
+source ../settings/scripts/ynh_add_secure_repos__2
#=================================================
# MANAGE SCRIPT FAILURE
@@ -86,12 +87,11 @@ if [[ "$arch" = arm* ]]; then
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7638D0442B90D010
fi
-# Install source.list debian package backports & yarn
+# Install extra_repo debian package backports & yarn
if [ "$(lsb_release --codename --short)" == "jessie" ]; then
- echo "deb http://httpredir.debian.org/debian jessie-backports main" | tee /etc/apt/sources.list.d/jessie-backports.list
+ ynh_install_extra_repo --repo="deb http://httpredir.debian.org/debian jessie-backports main"
fi
-curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
-echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
+ynh_install_extra_repo --repo="deb https://dl.yarnpkg.com/debian/ stable main" --key="https://dl.yarnpkg.com/debian/pubkey.gpg"
ynh_package_update
# install nodejs
diff --git a/scripts/upgrade b/scripts/upgrade
index 87b0432..a210372 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -9,6 +9,7 @@
source _common.sh
source /usr/share/yunohost/helpers
source ynh_install_ruby
+source ynh_add_secure_repos__2
#=================================================
# LOAD SETTINGS
@@ -124,12 +125,11 @@ ynh_add_nginx_config
#=================================================
ynh_print_info "Upgrading dependencies..."
-# Install source.list debian package backports & yarn
+# Install extra_repo debian package backports & yarn
if [ "$(lsb_release --codename --short)" == "jessie" ]; then
- echo "deb http://httpredir.debian.org/debian jessie-backports main" | tee /etc/apt/sources.list.d/jessie-backports.list
+ ynh_install_extra_repo --repo="deb http://httpredir.debian.org/debian jessie-backports main"
fi
-curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
-echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
+ynh_install_extra_repo --repo="deb https://dl.yarnpkg.com/debian/ stable main" --key="https://dl.yarnpkg.com/debian/pubkey.gpg"
ynh_package_update
# install nodejs