diff options
author | Samruddhi Khandale <skhandale@microsoft.com> | 2022-12-17 01:21:05 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-17 01:21:05 +0300 |
commit | e46c73de74942438e079564405c5c4b0291a4aae (patch) | |
tree | ca502fc9404e4b378e5339e92c17397df7bb4ec1 | |
parent | a3dc31d31fec8b52c63b756d1df17b602e141b9b (diff) |
Git - Bug Fix: Feature fails with "ppa:false" for bionic & jammy (#339)
-rw-r--r-- | src/git/devcontainer-feature.json | 2 | ||||
-rwxr-xr-x | src/git/install.sh | 10 | ||||
-rw-r--r-- | test/git/install_git_from_src_bionic.sh | 16 | ||||
-rw-r--r-- | test/git/install_git_from_src_jammy.sh | 16 | ||||
-rw-r--r-- | test/git/scenarios.json | 18 |
5 files changed, 60 insertions, 2 deletions
diff --git a/src/git/devcontainer-feature.json b/src/git/devcontainer-feature.json index a8ea798..bc57675 100644 --- a/src/git/devcontainer-feature.json +++ b/src/git/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "git", - "version": "1.1.0", + "version": "1.1.1", "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.", diff --git a/src/git/install.sh b/src/git/install.sh index 7ffa01e..2463cc9 100755 --- a/src/git/install.sh +++ b/src/git/install.sh @@ -147,7 +147,15 @@ if [ "$(echo "${GIT_VERSION}" | grep -o '\.' | wc -l)" != "2" ]; then fi fi -check_packages libpcre2-posix2 libpcre2-dev +check_packages libpcre2-dev + +if [ "${VERSION_CODENAME}" = "focal" ]; then + check_packages libpcre2-posix2 +elif [ "${VERSION_CODENAME}" = "bionic" ]; then + check_packages libpcre2-posix0 +else + check_packages libpcre2-posix3 +fi echo "Downloading source for ${GIT_VERSION}..." curl -sL https://github.com/git/git/archive/v${GIT_VERSION}.tar.gz | tar -xzC /tmp 2>&1 diff --git a/test/git/install_git_from_src_bionic.sh b/test/git/install_git_from_src_bionic.sh new file mode 100644 index 0000000..4bdcf30 --- /dev/null +++ b/test/git/install_git_from_src_bionic.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +check "version" git --version +check "gettext" dpkg-query -l gettext + +cd /tmp && git clone https://github.com/devcontainers/feature-starter.git +cd feature-starter +check "perl" bash -c "git -c grep.patternType=perl grep -q 'a.+b'" + +# Report result +reportResults diff --git a/test/git/install_git_from_src_jammy.sh b/test/git/install_git_from_src_jammy.sh new file mode 100644 index 0000000..4bdcf30 --- /dev/null +++ b/test/git/install_git_from_src_jammy.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +check "version" git --version +check "gettext" dpkg-query -l gettext + +cd /tmp && git clone https://github.com/devcontainers/feature-starter.git +cd feature-starter +check "perl" bash -c "git -c grep.patternType=perl grep -q 'a.+b'" + +# Report result +reportResults diff --git a/test/git/scenarios.json b/test/git/scenarios.json index a57bea7..90aa7e3 100644 --- a/test/git/scenarios.json +++ b/test/git/scenarios.json @@ -7,5 +7,23 @@ "ppa": "false" } } + }, + "install_git_from_src_jammy": { + "image": "ubuntu:jammy", + "features": { + "git": { + "version": "latest", + "ppa": "false" + } + } + }, + "install_git_from_src_bionic": { + "image": "ubuntu:bionic", + "features": { + "git": { + "version": "latest", + "ppa": "false" + } + } } } |