Unverified Commit 17cc3874 authored by Yaroslav Halchenko's avatar Yaroslav Halchenko Committed by GitHub

Merge pull request #40 from neurodebian/bf-nd-configurepo

BF: nd-configurepo was not correctly obtaining the key if gpg was not present
parents 81e778d0 dc9142d3
......@@ -2,7 +2,11 @@
#emacs: -*- mode: shell-script; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
#ex: set sts=4 ts=4 sw=4 et:
# Depends: apt (assumed to be present), python, wget
# Depends:
# assumes to be present:
# apt
# installs if needed if NEURODEBIAN_INSTALL=1:
# python, wget, gnupg, dirmngr (when older gnupg)
# Recommends: netselect
# play safe
......@@ -545,6 +549,14 @@ fi
# Figure out if key needs to be imported (if ran within package,
# should already be there due to neurodebian-archive-keyring package)
# Ideas taken from neurodebian-docker setup to guarantee correct apt-key functioning
# gnupg needed by apt-key might not yet be installed
assure_command_from_package gpg gnupg 1
# Ubuntu includes "gnupg" (not "gnupg2", but still 2.x), but not dirmngr, and gnupg 2.x requires dirmngr
# so, if we're not running gnupg 1.x, explicitly install dirmngr too
gpg --version | grep -q '^gpg (GnuPG) 1\.' || assure_command_from_package dirmngr dirmngr 1
if LANG=C eval $ae_sudo apt-key export $nd_key_id 2>&1 1>/dev/null | grep -qe "nothing exported"; then
print_verbose 1 "Fetching the key from the server"
eval_dry apt-key adv --recv-keys --keyserver pgp.mit.edu $nd_key_id
......@@ -573,7 +585,7 @@ if [ "$ae_update" = "1" ]; then
error 5 "Update failed with exit code $?."
eval_dry apt-get update
eval_dry apt-get update # --no-allow-insecure-repositories
print_verbose 1 "apt-get update was not run. Please run to take an effect of changes"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment