aboutsummaryrefslogtreecommitdiff
path: root/scripts/ynh_add_secure_repos__2
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/ynh_add_secure_repos__2')
-rw-r--r--scripts/ynh_add_secure_repos__29
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/ynh_add_secure_repos__2 b/scripts/ynh_add_secure_repos__2
index 51a9f1b..39bc21b 100644
--- a/scripts/ynh_add_secure_repos__2
+++ b/scripts/ynh_add_secure_repos__2
@@ -137,7 +137,13 @@ ynh_install_extra_repo () {
if [ -n "$key" ]
then
mkdir -p "/etc/apt/trusted.gpg.d"
- wget -q "$key" -O - | $wget_append /etc/apt/trusted.gpg.d/$name.gpg
+ if [[ "$(basename "$key")" =~ ".asc" ]]
+ then
+ local key_ext=asc
+ else
+ local key_ext=gpg
+ fi
+ wget -q "$key" -O - | gpg --dearmor | $wget_append /etc/apt/trusted.gpg.d/$name.$key_ext
fi
# Update the list of package with the new repo
@@ -160,6 +166,7 @@ ynh_remove_extra_repo () {
ynh_secure_remove "/etc/apt/sources.list.d/$name.list"
ynh_secure_remove "/etc/apt/preferences.d/$name"
ynh_secure_remove "/etc/apt/trusted.gpg.d/$name.gpg"
+ ynh_secure_remove "/etc/apt/trusted.gpg.d/$name.asc"
# Update the list of package to exclude the old repo
ynh_package_update