Skip to content

Commit 7a9871b

Browse files
committed
Try Ubuntu keyserver on port 80 if default HKP port fails
Closes #719 Closes #717
1 parent 4fca96b commit 7a9871b

File tree

7 files changed

+41
-34
lines changed

7 files changed

+41
-34
lines changed

src/git-lfs/install.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ GIT_LFS_ARCHIVE_ARCHITECTURES="amd64 arm64"
1515
GIT_LFS_ARCHIVE_VERSION_CODENAMES="stretch buster bullseye bionic focal jammy"
1616
GIT_LFS_CHECKSUM_GPG_KEYS="0x88ace9b29196305ba9947552f1ba225c0223b187 0x86cd3297749375bcf8206715f54fe648088335a9 0xaa3b3450295830d2de6db90caba67be5a5795889"
1717
GPG_KEY_SERVERS="keyserver hkp://keyserver.ubuntu.com
18+
keyserver hkp://keyserver.ubuntu.com:80
1819
keyserver hkps://keys.openpgp.org
1920
keyserver hkp://keyserver.pgp.com"
2021

@@ -36,7 +37,7 @@ find_version_from_git_tags() {
3637
local repository=$2
3738
local prefix=${3:-"tags/v"}
3839
local separator=${4:-"."}
39-
local last_part_optional=${5:-"false"}
40+
local last_part_optional=${5:-"false"}
4041
if [ "$(echo "${requested_version}" | grep -o "." | wc -l)" != "2" ]; then
4142
local escaped_separator=${separator//./\\.}
4243
local last_part
@@ -62,7 +63,7 @@ find_version_from_git_tags() {
6263
echo "${variable_name}=${!variable_name}"
6364
}
6465

65-
# Import the specified key in a variable name passed in as
66+
# Import the specified key in a variable name passed in as
6667
receive_gpg_keys() {
6768
local keys=${!1}
6869

@@ -75,7 +76,7 @@ receive_gpg_keys() {
7576
local retry_count=0
7677
local gpg_ok="false"
7778
set +e
78-
until [ "${gpg_ok}" = "true" ] || [ "${retry_count}" -eq "5" ];
79+
until [ "${gpg_ok}" = "true" ] || [ "${retry_count}" -eq "5" ];
7980
do
8081
echo "(*) Downloading GPG key..."
8182
( echo "${keys}" | xargs -n 1 gpg --recv-keys) 2>&1 && gpg_ok="true"

src/git/install.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ USE_PPA_IF_AVAILABLE=${PPA}
1212

1313
GIT_CORE_PPA_ARCHIVE_GPG_KEY=E1DD270288B4E6030699E45FA1715D88E1DF1F24
1414
GPG_KEY_SERVERS="keyserver hkp://keyserver.ubuntu.com
15+
keyserver hkp://keyserver.ubuntu.com:80
1516
keyserver hkps://keys.openpgp.org
1617
keyserver hkp://keyserver.pgp.com"
1718

@@ -25,7 +26,7 @@ if [ "$(id -u)" -ne 0 ]; then
2526
exit 1
2627
fi
2728

28-
# Import the specified key in a variable name passed in as
29+
# Import the specified key in a variable name passed in as
2930
receive_gpg_keys() {
3031
local keys=${!1}
3132
local keyring_args=""
@@ -43,7 +44,7 @@ receive_gpg_keys() {
4344
local retry_count=0
4445
local gpg_ok="false"
4546
set +e
46-
until [ "${gpg_ok}" = "true" ] || [ "${retry_count}" -eq "5" ];
47+
until [ "${gpg_ok}" = "true" ] || [ "${retry_count}" -eq "5" ];
4748
do
4849
echo "(*) Downloading GPG key..."
4950
( echo "${keys}" | xargs -n 1 gpg -q ${keyring_args} --recv-keys) 2>&1 && gpg_ok="true"
@@ -104,7 +105,7 @@ if ([ "${GIT_VERSION}" = "latest" ] || [ "${GIT_VERSION}" = "lts" ] || [ "${GIT_
104105
receive_gpg_keys GIT_CORE_PPA_ARCHIVE_GPG_KEY /usr/share/keyrings/gitcoreppa-archive-keyring.gpg
105106
echo -e "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/gitcoreppa-archive-keyring.gpg] http://ppa.launchpad.net/git-core/ppa/ubuntu ${VERSION_CODENAME} main\ndeb-src [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/gitcoreppa-archive-keyring.gpg] http://ppa.launchpad.net/git-core/ppa/ubuntu ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/git-core-ppa.list
106107
apt-get update
107-
apt-get -y install --no-install-recommends git
108+
apt-get -y install --no-install-recommends git
108109
rm -rf "/tmp/tmp-gnupg"
109110
rm -rf /var/lib/apt/lists/*
110111
exit 0

src/github-cli/install.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ INSTALL_DIRECTLY_FROM_GITHUB_RELEASE=${INSTALLDIRECTLYFROMGITHUBRELEASE:-"true"}
1212

1313
GITHUB_CLI_ARCHIVE_GPG_KEY=23F3D4EA75716059
1414
GPG_KEY_SERVERS="keyserver hkp://keyserver.ubuntu.com
15+
keyserver hkp://keyserver.ubuntu.com:80
1516
keyserver hkps://keys.openpgp.org
1617
keyserver hkp://keyserver.pgp.com"
1718

@@ -26,7 +27,7 @@ if [ "$(id -u)" -ne 0 ]; then
2627
fi
2728

2829

29-
# Import the specified key in a variable name passed in as
30+
# Import the specified key in a variable name passed in as
3031
receive_gpg_keys() {
3132
local keys=${!1}
3233
local keyring_args=""
@@ -43,7 +44,7 @@ receive_gpg_keys() {
4344
local retry_count=0
4445
local gpg_ok="false"
4546
set +e
46-
until [ "${gpg_ok}" = "true" ] || [ "${retry_count}" -eq "5" ];
47+
until [ "${gpg_ok}" = "true" ] || [ "${retry_count}" -eq "5" ];
4748
do
4849
echo "(*) Downloading GPG key..."
4950
( echo "${keys}" | xargs -n 1 gpg -q ${keyring_args} --recv-keys) 2>&1 && gpg_ok="true"
@@ -84,7 +85,7 @@ find_version_from_git_tags() {
8485
local repository=$2
8586
local prefix=${3:-"tags/v"}
8687
local separator=${4:-"."}
87-
local last_part_optional=${5:-"false"}
88+
local last_part_optional=${5:-"false"}
8889
if [ "$(echo "${requested_version}" | grep -o "." | wc -l)" != "2" ]; then
8990
local escaped_separator=${separator//./\\.}
9091
local last_part
@@ -144,7 +145,7 @@ find_prev_version_from_git_tags() {
144145
((breakfix=breakfix-1))
145146
if [ "${breakfix}" = "0" ] && [ "${last_part_optional}" = "true" ]; then
146147
declare -g ${variable_name}="${major}.${minor}"
147-
else
148+
else
148149
declare -g ${variable_name}="${major}.${minor}.${breakfix}"
149150
fi
150151
fi

src/kubectl-helm-minikube/install.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ USERNAME="${USERNAME:-"${_REMOTE_USER:-"automatic"}"}"
2323

2424
HELM_GPG_KEYS_URI="https://raw.githubusercontent.com/helm/helm/main/KEYS"
2525
GPG_KEY_SERVERS="keyserver hkp://keyserver.ubuntu.com
26+
keyserver hkp://keyserver.ubuntu.com:80
2627
keyserver hkps://keys.openpgp.org
2728
keyserver hkp://keyserver.pgp.com"
2829

@@ -61,7 +62,7 @@ find_version_from_git_tags() {
6162
local repository=$2
6263
local prefix=${3:-"tags/v"}
6364
local separator=${4:-"."}
64-
local last_part_optional=${5:-"false"}
65+
local last_part_optional=${5:-"false"}
6566
if [ "$(echo "${requested_version}" | grep -o "." | wc -l)" != "2" ]; then
6667
local escaped_separator=${separator//./\\.}
6768
local last_part
@@ -211,8 +212,8 @@ if [ "${MINIKUBE_VERSION}" != "none" ]; then
211212
MINIKUBE_VERSION="v${MINIKUBE_VERSION}"
212213
fi
213214
fi
214-
# latest is also valid in the download URLs
215-
curl -sSL -o /usr/local/bin/minikube "https://storage.googleapis.com/minikube/releases/${MINIKUBE_VERSION}/minikube-linux-${architecture}"
215+
# latest is also valid in the download URLs
216+
curl -sSL -o /usr/local/bin/minikube "https://storage.googleapis.com/minikube/releases/${MINIKUBE_VERSION}/minikube-linux-${architecture}"
216217
chmod 0755 /usr/local/bin/minikube
217218
if [ "$MINIKUBE_SHA256" = "automatic" ]; then
218219
MINIKUBE_SHA256="$(curl -sSL "https://storage.googleapis.com/minikube/releases/${MINIKUBE_VERSION}/minikube-linux-${architecture}.sha256")"

src/powershell/install.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc"
1919
POWERSHELL_ARCHIVE_ARCHITECTURES="amd64"
2020
POWERSHELL_ARCHIVE_VERSION_CODENAMES="stretch buster bionic focal bullseye jammy"
2121
GPG_KEY_SERVERS="keyserver hkp://keyserver.ubuntu.com
22+
keyserver hkp://keyserver.ubuntu.com:80
2223
keyserver hkps://keys.openpgp.org
2324
keyserver hkp://keyserver.pgp.com"
2425

@@ -35,7 +36,7 @@ find_version_from_git_tags() {
3536
local repository=$2
3637
local prefix=${3:-"tags/v"}
3738
local separator=${4:-"."}
38-
local last_part_optional=${5:-"false"}
39+
local last_part_optional=${5:-"false"}
3940
if [ "$(echo "${requested_version}" | grep -o "." | wc -l)" != "2" ]; then
4041
local escaped_separator=${separator//./\\.}
4142
local last_part
@@ -91,7 +92,7 @@ install_using_apt() {
9192
if [ "${POWERSHELL_VERSION}" = "latest" ] || [ "${POWERSHELL_VERSION}" = "lts" ] || [ "${POWERSHELL_VERSION}" = "stable" ]; then
9293
# Empty, meaning grab whatever "latest" is in apt repo
9394
version_suffix=""
94-
else
95+
else
9596
version_suffix="=$(apt-cache madison powershell | awk -F"|" '{print $2}' | sed -e 's/^[ \t]*//' | grep -E -m 1 "^(${POWERSHELL_VERSION})(\.|$|\+.*|-.*)")"
9697

9798
if [ -z ${version_suffix} ] || [ ${version_suffix} = "=" ]; then
@@ -150,7 +151,7 @@ if [ "${use_github}" = "true" ]; then
150151
install_using_github
151152
fi
152153

153-
# If PowerShell modules are requested, loop through and install
154+
# If PowerShell modules are requested, loop through and install
154155
if [ ${#POWERSHELL_MODULES[@]} -gt 0 ]; then
155156
echo "Installing PowerShell Modules: ${POWERSHELL_MODULES}"
156157
modules=(`echo ${POWERSHELL_MODULES} | tr ',' ' '`)

src/python/install.sh

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ ADDITIONAL_VERSIONS="${ADDITIONALVERSIONS:-""}"
2929
DEFAULT_UTILS=("pylint" "flake8" "autopep8" "black" "yapf" "mypy" "pydocstyle" "pycodestyle" "bandit" "pipenv" "virtualenv" "pytest")
3030
PYTHON_SOURCE_GPG_KEYS="64E628F8D684696D B26995E310250568 2D347EA6AA65421D FB9921286F5E1540 3A5CA953F73C700D 04C367C218ADD4FF 0EDDC5F26A45C816 6AF053F07D9DC8D2 C9BE28DEE6DF025C 126EB563A74B06BF D9866941EA5BBD71 ED9D77D5"
3131
GPG_KEY_SERVERS="keyserver hkp://keyserver.ubuntu.com
32+
keyserver hkp://keyserver.ubuntu.com:80
3233
keyserver hkps://keys.openpgp.org
3334
keyserver hkp://keyserver.pgp.com"
3435

@@ -78,7 +79,7 @@ updaterc() {
7879
fi
7980
}
8081

81-
# Import the specified key in a variable name passed in as
82+
# Import the specified key in a variable name passed in as
8283
receive_gpg_keys() {
8384
local keys=${!1}
8485
local keyring_args=""
@@ -99,7 +100,7 @@ receive_gpg_keys() {
99100
local retry_count=0
100101
local gpg_ok="false"
101102
set +e
102-
until [ "${gpg_ok}" = "true" ] || [ "${retry_count}" -eq "5" ];
103+
until [ "${gpg_ok}" = "true" ] || [ "${retry_count}" -eq "5" ];
103104
do
104105
echo "(*) Downloading GPG key..."
105106
( echo "${keys}" | xargs -n 1 gpg -q ${keyring_args} --recv-keys) 2>&1 && gpg_ok="true"
@@ -124,7 +125,7 @@ find_version_from_git_tags() {
124125
local repository=$2
125126
local prefix=${3:-"tags/v"}
126127
local separator=${4:-"."}
127-
local last_part_optional=${5:-"false"}
128+
local last_part_optional=${5:-"false"}
128129
if [ "$(echo "${requested_version}" | grep -o "." | wc -l)" != "2" ]; then
129130
local escaped_separator=${separator//./\\.}
130131
local last_part
@@ -206,24 +207,24 @@ check_packages() {
206207

207208
add_symlink() {
208209
if [[ ! -d "${CURRENT_PATH}" ]]; then
209-
ln -s -r "${INSTALL_PATH}" "${CURRENT_PATH}"
210+
ln -s -r "${INSTALL_PATH}" "${CURRENT_PATH}"
210211
fi
211212

212213
if [ "${OVERRIDE_DEFAULT_VERSION}" = "true" ]; then
213214
if [[ $(ls -l ${CURRENT_PATH}) != *"-> ${INSTALL_PATH}"* ]] ; then
214215
rm "${CURRENT_PATH}"
215-
ln -s -r "${INSTALL_PATH}" "${CURRENT_PATH}"
216+
ln -s -r "${INSTALL_PATH}" "${CURRENT_PATH}"
216217
fi
217218
fi
218219
}
219220

220221
install_from_source() {
221-
VERSION=$1
222+
VERSION=$1
222223
echo "(*) Building Python ${VERSION} from source..."
223224
# Install prereqs if missing
224225
check_packages curl ca-certificates gnupg2 tar make gcc libssl-dev zlib1g-dev libncurses5-dev \
225226
libbz2-dev libreadline-dev libxml2-dev xz-utils libgdbm-dev tk-dev dirmngr \
226-
libxmlsec1-dev libsqlite3-dev libffi-dev liblzma-dev uuid-dev
227+
libxmlsec1-dev libsqlite3-dev libffi-dev liblzma-dev uuid-dev
227228
if ! type git > /dev/null 2>&1; then
228229
check_packages git
229230
fi
@@ -232,7 +233,7 @@ install_from_source() {
232233
find_version_from_git_tags VERSION "https://github.com/python/cpython"
233234

234235
INSTALL_PATH="${PYTHON_INSTALL_PATH}/${VERSION}"
235-
236+
236237
if [ -d "${INSTALL_PATH}" ]; then
237238
echo "(!) Python version ${VERSION} already exists."
238239
exit 1
@@ -280,9 +281,9 @@ install_from_source() {
280281
}
281282

282283
install_using_oryx() {
283-
VERSION=$1
284+
VERSION=$1
284285
INSTALL_PATH="${PYTHON_INSTALL_PATH}/${VERSION}"
285-
286+
286287
if [ -d "${INSTALL_PATH}" ]; then
287288
echo "(!) Python version ${VERSION} already exists."
288289
exit 1
@@ -370,7 +371,7 @@ export DEBIAN_FRONTEND=noninteractive
370371
# General requirements
371372
check_packages curl ca-certificates gnupg2 tar make gcc libssl-dev zlib1g-dev libncurses5-dev \
372373
libbz2-dev libreadline-dev libxml2-dev xz-utils libgdbm-dev tk-dev dirmngr \
373-
libxmlsec1-dev libsqlite3-dev libffi-dev liblzma-dev uuid-dev
374+
libxmlsec1-dev libsqlite3-dev libffi-dev liblzma-dev uuid-dev
374375

375376

376377
# Install Python from source if needed
@@ -381,7 +382,7 @@ if [ "${PYTHON_VERSION}" != "none" ]; then
381382
usermod -a -G python "${USERNAME}"
382383

383384
CURRENT_PATH="${PYTHON_INSTALL_PATH}/current"
384-
385+
385386
install_python ${PYTHON_VERSION}
386387

387388
# Additional python versions to be installed but not be set as default.
@@ -402,7 +403,7 @@ if [ "${PYTHON_VERSION}" != "none" ]; then
402403
updaterc "if [[ \"\${PATH}\" != *\"${CURRENT_PATH}/bin\"* ]]; then export PATH=${CURRENT_PATH}/bin:\${PATH}; fi"
403404
PATH="${INSTALL_PATH}/bin:${PATH}"
404405
fi
405-
406+
406407
# Updates the symlinks for os-provided, or the installed python version in other cases
407408
chown -R "${USERNAME}:python" "${PYTHON_INSTALL_PATH}"
408409
chmod -R g+r+w "${PYTHON_INSTALL_PATH}"
@@ -427,7 +428,7 @@ if [[ "${INSTALL_PYTHON_TOOLS}" = "true" ]] && [[ $(python --version) != "" ]];
427428
umask 0002
428429
mkdir -p ${PIPX_BIN_DIR}
429430
chown -R "${USERNAME}:pipx" ${PIPX_HOME}
430-
chmod -R g+r+w "${PIPX_HOME}"
431+
chmod -R g+r+w "${PIPX_HOME}"
431432
find "${PIPX_HOME}" -type d -print0 | xargs -0 -n 1 chmod g+s
432433

433434
# Update pip if not using os provided python

src/ruby/install.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ DEFAULT_GEMS="rake"
2424

2525
RVM_GPG_KEYS="409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB"
2626
GPG_KEY_SERVERS="keyserver hkp://keyserver.ubuntu.com
27+
keyserver hkp://keyserver.ubuntu.com:80
2728
keyserver hkps://keys.openpgp.org
2829
keyserver hkp://keyserver.pgp.com"
2930

@@ -71,7 +72,7 @@ updaterc() {
7172
fi
7273
}
7374

74-
# Import the specified key in a variable name passed in as
75+
# Import the specified key in a variable name passed in as
7576
receive_gpg_keys() {
7677
local keys=${!1}
7778
local keyring_args=""
@@ -88,7 +89,7 @@ receive_gpg_keys() {
8889
local retry_count=0
8990
local gpg_ok="false"
9091
set +e
91-
until [ "${gpg_ok}" = "true" ] || [ "${retry_count}" -eq "5" ];
92+
until [ "${gpg_ok}" = "true" ] || [ "${retry_count}" -eq "5" ];
9293
do
9394
echo "(*) Downloading GPG key..."
9495
( echo "${keys}" | xargs -n 1 gpg -q ${keyring_args} --recv-keys) 2>&1 && gpg_ok="true"
@@ -113,7 +114,7 @@ find_version_from_git_tags() {
113114
local repository=$2
114115
local prefix=${3:-"tags/v"}
115116
local separator=${4:-"."}
116-
local last_part_optional=${5:-"false"}
117+
local last_part_optional=${5:-"false"}
117118
if [ "$(echo "${requested_version}" | grep -o "." | wc -l)" != "2" ]; then
118119
local escaped_separator=${separator//./\\.}
119120
local last_part
@@ -205,7 +206,7 @@ else
205206
fi
206207
if [ "${INSTALL_RUBY_TOOLS}" = "true" ]; then
207208
SKIP_GEM_INSTALL="true"
208-
else
209+
else
209210
DEFAULT_GEMS=""
210211
fi
211212
fi

0 commit comments

Comments
 (0)