Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Arch support for common-utils #791

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
55 changes: 55 additions & 0 deletions src/common-utils/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,53 @@ install_alpine_packages() {
PACKAGES_ALREADY_INSTALLED="true"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we bump the minor version for this Feature?

}

# Arch Linux packages
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

install_arch_packages() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
pacman -Sy --noconfirm --noprogressbar \
openssh \
gnupg \
procps \
lsof \
htop \
net-tools \
psmisc \
curl \
wget \
rsync \
ca-certificates \
unzip \
zip \
nano \
vim \
less \
jq \
gcc \
tzdata \
zlib \
sudo \
coreutils \
sed \
grep \
which \
ncdu \
shadow \
strace

# Install git if not already installed (may be more recent than distro version)
if ! type git > /dev/null 2>&1; then
pacman -Sy --noconfirm --noprogressbar git
fi
fi

# Install zsh if needed
if [ "${INSTALL_ZSH}" = "true" ] && ! type zsh > /dev/null 2>&1; then
pacman -Sy --noconfirm --noprogressbar zsh
fi

PACKAGES_ALREADY_INSTALLED="true"
}

# ******************
# ** Main section **
# ******************
Expand Down Expand Up @@ -341,6 +388,8 @@ elif [[ "${ID}" = "rhel" || "${ID}" = "fedora" || "${ID}" = "mariner" || "${ID_L
ADJUSTED_ID="rhel"
elif [ "${ID}" = "alpine" ]; then
ADJUSTED_ID="alpine"
elif [ "${ID}" = "arch" ]; then
ADJUSTED_ID="arch"
else
echo "Linux distro ${ID} not supported."
exit 1
Expand All @@ -357,6 +406,9 @@ case "${ADJUSTED_ID}" in
"alpine")
install_alpine_packages
;;
"arch")
install_arch_packages
;;
esac

# If in automatic mode, determine if a user already exists, if not use vscode
Expand Down Expand Up @@ -458,6 +510,9 @@ if [ "${RC_SNIPPET_ALREADY_ADDED}" != "true" ]; then
# /etc/bash/bashrc does not exist in alpine 3.14 & 3.15
mkdir -p /etc/bash
;;
"arch")
global_rc_path="/etc/bash.bashrc"
;;
esac
cat "${FEATURE_DIR}/scripts/rc_snippet.sh" >> ${global_rc_path}
cat "${FEATURE_DIR}/scripts/bash_theme_snippet.sh" >> "${user_home}/.bashrc"
Expand Down
Loading