Skip to content

Commit

Permalink
common-utils: add bash-completion (#1048)
Browse files Browse the repository at this point in the history
* 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 <skhandale@microsoft.com>
  • Loading branch information
dmytrokyrychuk and samruddhikhandale authored Jul 29, 2024
1 parent 5f4d201 commit 1751858
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/common-utils/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -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.",
Expand Down
12 changes: 12 additions & 0 deletions src/common-utils/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -170,6 +171,7 @@ install_redhat_packages() {
if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
package_list="${package_list} \
gawk \
bash-completion \
openssh-clients \
gnupg2 \
iproute \
Expand Down Expand Up @@ -254,6 +256,7 @@ install_alpine_packages() {
if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
apk add --no-cache \
openssh-client \
bash-completion \
gnupg \
procps \
lsof \
Expand Down Expand Up @@ -343,13 +346,22 @@ 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
echo "Linux distro ${ID} not supported."
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")
Expand Down

0 comments on commit 1751858

Please sign in to comment.