From 175185811e716c1f3b92caea7ae2b3389aba9134 Mon Sep 17 00:00:00 2001 From: Dmytro Kyrychuk Date: Mon, 29 Jul 2024 20:54:13 +0300 Subject: [PATCH] common-utils: add bash-completion (#1048) * common-utils: add bash-completion Resolve #1043 * update centos7 .repo files to reference vault.centos.org instead of mirrorlist.centos.org Copied from src/git/install.sh --------- Co-authored-by: Samruddhi Khandale --- src/common-utils/devcontainer-feature.json | 2 +- src/common-utils/main.sh | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/common-utils/devcontainer-feature.json b/src/common-utils/devcontainer-feature.json index dc62272ad..a253bfb05 100644 --- a/src/common-utils/devcontainer-feature.json +++ b/src/common-utils/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "common-utils", - "version": "2.4.4", + "version": "2.4.5", "name": "Common Utilities", "documentationURL": "https://github.com/devcontainers/features/tree/main/src/common-utils", "description": "Installs a set of common command line utilities, Oh My Zsh!, and sets up a non-root user.", diff --git a/src/common-utils/main.sh b/src/common-utils/main.sh index 5d7592cfc..8f82dcdf9 100644 --- a/src/common-utils/main.sh +++ b/src/common-utils/main.sh @@ -32,6 +32,7 @@ install_debian_packages() { if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then package_list="${package_list} \ apt-utils \ + bash-completion \ openssh-client \ gnupg2 \ dirmngr \ @@ -170,6 +171,7 @@ install_redhat_packages() { if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then package_list="${package_list} \ gawk \ + bash-completion \ openssh-clients \ gnupg2 \ iproute \ @@ -254,6 +256,7 @@ install_alpine_packages() { if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then apk add --no-cache \ openssh-client \ + bash-completion \ gnupg \ procps \ lsof \ @@ -343,6 +346,7 @@ if [ "${ID}" = "debian" ] || [ "${ID_LIKE}" = "debian" ]; then ADJUSTED_ID="debian" elif [[ "${ID}" = "rhel" || "${ID}" = "fedora" || "${ID}" = "mariner" || "${ID_LIKE}" = *"rhel"* || "${ID_LIKE}" = *"fedora"* || "${ID_LIKE}" = *"mariner"* ]]; then ADJUSTED_ID="rhel" + VERSION_CODENAME="${ID}${VERSION_ID}" elif [ "${ID}" = "alpine" ]; then ADJUSTED_ID="alpine" else @@ -350,6 +354,14 @@ else exit 1 fi +if [ "${ADJUSTED_ID}" = "rhel" ] && [ "${VERSION_CODENAME-}" = "centos7" ]; then + # As of 1 July 2024, mirrorlist.centos.org no longer exists. + # Update the repo files to reference vault.centos.org. + sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo + sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo + sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo +fi + # Install packages for appropriate OS case "${ADJUSTED_ID}" in "debian")