aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamruddhi Khandale <skhandale@microsoft.com>2022-12-14 01:09:16 +0300
committerGitHub <noreply@github.com>2022-12-14 01:09:16 +0300
commit7fa90110d762797cc0b1c2fe8fcc028c9b813d56 (patch)
treef466cd7d4b6ae326f0740829506b8ee837c35daa
parentbaf47e22b0c3dc5b418ac57aae2e750d14bbc9a3 (diff)
Git: Build from source with USE_LIBPCRE (#331)
-rw-r--r--src/git/devcontainer-feature.json2
-rwxr-xr-xsrc/git/install.sh4
-rw-r--r--test/git/install_git_from_src.sh4
3 files changed, 8 insertions, 2 deletions
diff --git a/src/git/devcontainer-feature.json b/src/git/devcontainer-feature.json
index ef2b856..a8ea798 100644
--- a/src/git/devcontainer-feature.json
+++ b/src/git/devcontainer-feature.json
@@ -1,6 +1,6 @@
{
"id": "git",
- "version": "1.0.5",
+ "version": "1.1.0",
"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 153b4e1..7ffa01e 100755
--- a/src/git/install.sh
+++ b/src/git/install.sh
@@ -147,11 +147,13 @@ if [ "$(echo "${GIT_VERSION}" | grep -o '\.' | wc -l)" != "2" ]; then
fi
fi
+check_packages libpcre2-posix2 libpcre2-dev
+
echo "Downloading source for ${GIT_VERSION}..."
curl -sL https://github.com/git/git/archive/v${GIT_VERSION}.tar.gz | tar -xzC /tmp 2>&1
echo "Building..."
cd /tmp/git-${GIT_VERSION}
-make -s prefix=/usr/local all && make -s prefix=/usr/local install 2>&1
+make -s USE_LIBPCRE=YesPlease prefix=/usr/local all && make -s USE_LIBPCRE=YesPlease prefix=/usr/local install 2>&1
rm -rf /tmp/git-${GIT_VERSION}
rm -rf /var/lib/apt/lists/*
echo "Done!"
diff --git a/test/git/install_git_from_src.sh b/test/git/install_git_from_src.sh
index 226278a..4bdcf30 100644
--- a/test/git/install_git_from_src.sh
+++ b/test/git/install_git_from_src.sh
@@ -8,5 +8,9 @@ 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