Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/git/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "git",
"version": "1.3.7",
"version": "1.3.8",
"name": "Git (from source)",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/git",
"description": "Install an up-to-date version of Git, built from source as needed. Useful for when you want the latest and greatest features. Auto-detects latest stable version and installs needed dependencies.",
Expand Down
28 changes: 14 additions & 14 deletions src/git/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,8 @@ get_gpg_key_servers() {

# Import the specified key in a variable name passed in as
receive_gpg_keys() {
local keys=${!1}
local keyring_args=""
if [ ! -z "$2" ]; then
mkdir -p "$(dirname \"$2\")"
keyring_args="--no-default-keyring --keyring $2"
fi
local -a keys="(${!1})"
mkdir -p "$(dirname "$2")"

# Install curl
if ! type curl > /dev/null 2>&1; then
Expand All @@ -133,13 +129,17 @@ receive_gpg_keys() {
set +e
until [ "${gpg_ok}" = "true" ] || [ "${retry_count}" -eq "5" ];
do
echo "(*) Downloading GPG key..."
( echo "${keys}" | xargs -n 1 gpg -q ${keyring_args} --recv-keys) 2>&1 && gpg_ok="true"
if [ "${gpg_ok}" != "true" ]; then
echo "(*) Failed getting key, retrying in 10s..."
(( retry_count++ ))
sleep 10s
fi
for key in "${keys[@]}"; do
echo "(*) Downloading GPG key '${key}'..."
gpg --recv-keys "${key}" \
&& gpg --export "${key}" | gpg --dearmor --yes -o "$2" \
&& gpg_ok="true"
if [ "${gpg_ok}" != "true" ]; then
echo "(*) Failed getting key, retrying in 10s..."
(( retry_count++ ))
sleep 10s
fi
done
done
set -e
if [ "${gpg_ok}" = "false" ]; then
Expand Down Expand Up @@ -275,7 +275,7 @@ elif [ "${ADJUSTED_ID}" = "rhel" ]; then
fi
if ! type awk > /dev/null 2>&1; then
check_packages gawk
fi
fi
if [ $ID = "mariner" ]; then
check_packages glibc-devel kernel-headers binutils
fi
Expand Down
1 change: 1 addition & 0 deletions test/git/install_git_from_ppa_noble.sh
1 change: 1 addition & 0 deletions test/git/install_git_from_ppa_resolute.sh
1 change: 1 addition & 0 deletions test/git/install_git_from_src_resolute.sh
27 changes: 27 additions & 0 deletions test/git/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,33 @@
}
}
},
"install_git_from_ppa_noble": {
"image": "ubuntu:noble",
"features": {
"git": {
"version": "latest",
"ppa": "true"
}
}
},
"install_git_from_src_resolute": {
"image": "ubuntu:resolute",
"features": {
"git": {
"version": "latest",
"ppa": "false"
}
}
},
"install_git_from_ppa_resolute": {
"image": "ubuntu:resolute",
"features": {
"git": {
"version": "latest",
"ppa": "true"
}
}
},
"install_git_from_src_bullseye": {
"image": "debian:bullseye",
"features": {
Expand Down
Loading