diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9153fd1d..79b423d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -182,8 +182,8 @@ jobs: - name: Install packages if: startsWith(matrix.os, 'ubuntu') run: | - SOURCE_KEYS=(${{join(matrix.source_keys, ' ')}}) - SOURCES=(${{join(matrix.sources, ' ')}}) + SOURCE_KEYS=("${{join(matrix.source_keys, '" "')}}") + SOURCES=("${{join(matrix.sources, '" "')}}") # Add this by default SOURCE_KEYS+=('http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x1E9377A2BA9EF27F') SOURCES+=(ppa:ubuntu-toolchain-r/test) diff --git a/ci/add-apt-keys.sh b/ci/add-apt-keys.sh index 3c299ee5..3d3f71c6 100755 --- a/ci/add-apt-keys.sh +++ b/ci/add-apt-keys.sh @@ -1,12 +1,12 @@ #!/bin/bash # -# Copyright 2023 Alexander Grund +# Copyright 2023-2024 Alexander Grund # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) # # Add APT keys -# - Each argument should be a key URL +# - Each argument should be a key URL or a key ID (0x...) # - $NET_RETRY_COUNT is the amount of retries attempted set -eu @@ -16,9 +16,13 @@ function do_add_key key_url=$1 # If a keyserver URL (e.g. http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x1E9377A2BA9EF27F) # use the hash as the filename, + # if it is an ID, e.g. 0x1E9377A2BA9EF27F, use it as the filename, and http://keyserver.ubuntu.com/pks/lookup as the URL # else assume the URL contains a filename, e.g. https://apt.llvm.org/llvm-snapshot.gpg.key if [[ "$key_url" =~ .*keyserver.*search=0x([A-F0-9]+) ]]; then keyfilename="${BASH_REMATCH[1]}.key" + elif [[ $key_url =~ ^0x[A-F0-9]+$ ]]; then + keyfilename=${key_url#0x}.key + key_url="http://keyserver.ubuntu.com/pks/lookup?op=get&search=$key_url" else keyfilename=$(basename -s .key "$key_url") fi @@ -30,5 +34,6 @@ function do_add_key } for key_url in "$@"; do + [[ -n $key_url ]] || continue do_add_key "$key_url" done diff --git a/ci/add-apt-repositories.sh b/ci/add-apt-repositories.sh index b5e5dce8..e31fb3ea 100755 --- a/ci/add-apt-repositories.sh +++ b/ci/add-apt-repositories.sh @@ -1,6 +1,7 @@ #!/bin/bash # -# Copyright 2023 Alexander Grund, Sam Darwin +# Copyright 2023 Sam Darwin +# Copyright 2023-2024 Alexander Grund # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) @@ -28,5 +29,6 @@ function do_add_repository { } for repo_name in "$@"; do + [[ -n $repo_name ]] || continue do_add_repository "$repo_name" done