install.fairie/home/.chezmoiscripts/centos/run_onchange_before_10-install-centos-dependencies.tmpl

38 lines
1.4 KiB
Cheetah
Raw Normal View History

Update dotfiles/.local/share/chezmoi/home/.chezmoiscripts/darwin/run_onchange_before_10_install-darwin-dependencies.tmpl, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/fedora/run_onchange_before_10-install-fedora-dependencies, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/centos/run_onchange_before_10-install-centos-dependencies, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/debian/run_onchange_before_10-install-debian-dependencies, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/ubuntu/run_onchange_before_11-install-packages, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/opensuse/run_onchange_before_11-install-opensuse-packages, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/freebsd/run_onchange_before_11-install-freebsd-packages, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/fedora/run_onchange_before_11-install-fedora-packages, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/debian/run_onchange_before_11-install-debian-packages, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/darwin/run_onchange_before_11-install-darwin-packages, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/centos/run_onchange_before_10-install-centos-packages, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/archlinux/run_onchange_before_11-install-archlinux-packages, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/windows/run_onchange_before_11-install-windows-packages Deleted dotfiles/.local/share/chezmoi/home/run_update, dotfiles/.local/share/chezmoi/home/run_once_provision
2022-11-24 07:34:09 -08:00
#!/usr/bin/env bash
# universal/common-dependencies hash: {{ include (joinPath ".chezmoitemplates" "universal" "common-dependencies") | sha256sum }}
# centos/common-dependencies hash: {{ include (joinPath ".chezmoitemplates" "centos" "common-dependencies") | sha256sum }}
Update .local/share/chezmoi/home/.chezmoiscripts/darwin/run_onchange_after_set-wallpaper.tmpl, .local/share/chezmoi/home/.chezmoiscripts/universal/run_once_before_1-decrypt-age-key.tmpl, .local/share/chezmoi/home/.chezmoiscripts/universal/run_onchange_after_10_install-aqua-packages.sh.tmpl, .local/share/chezmoi/home/.chezmoiscripts/ubuntu/run_onchange_before_10_install-ubuntu-dependencies.tmpl, .local/share/chezmoi/home/.chezmoiscripts/opensuse/run_onchange_before_11-install-opensuse-software.tmpl, .local/share/chezmoi/home/.chezmoiscripts/freebsd/run_onchange_before_11-install-freebsd-packages.tmpl, .local/share/chezmoi/home/.chezmoiscripts/fedora/run_onchange_before_10-install-fedora-dependencies.tmpl, .local/share/chezmoi/home/.chezmoiscripts/debian/run_onchange_before_10-install-debian-dependencies.tmpl, .local/share/chezmoi/home/.chezmoiscripts/darwin/run_onchange_before_10_install-darwin-dependencies.tmpl, .local/share/chezmoi/home/.chezmoiscripts/centos/run_onchange_before_10-install-centos-dependencies.tmpl, .local/share/chezmoi/home/.chezmoiscripts/archlinux/run_onchange_before_10_install-archlinux-dependencies.tmpl, .local/share/chezmoi/home/.chezmoiscripts/universal/run_onchange_after_50-crontab.tmpl, .local/share/chezmoi/home/.chezmoiscripts/universal/run_onchange_after_99_bootstrap-zsh-plugins.tmpl, .local/share/chezmoi/home/.chezmoiscripts/universal/run_onchange_after_80-bash-completions.tmpl, .local/share/chezmoi/home/.chezmoiscripts/universal/run_onchange_before_5-install-homebrew.tmpl, .local/share/chezmoi/home/.chezmoiscripts/windows/run_onchange_before_11-install-windows-packages.tmpl
2022-12-01 22:36:57 -08:00
Update 19 files - /home/.chezmoiscripts/universal/run_onchange_after_11-symlink-ansible-roles.tmpl - /home/.chezmoiscripts/universal/run_before_1-decrypt-age-key.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_12-install-packages.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_14_install-aqua-packages.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_18-install-sdkman.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_50-crontab.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_80-bash-completions.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_99_bootstrap-zsh-plugins.tmpl - /home/.chezmoiscripts/universal/run_onchange_before_91-configure-gpg.tmpl - /home/.chezmoiscripts/ubuntu/run_onchange_before_10_install-ubuntu-dependencies.tmpl - /home/.chezmoiscripts/opensuse/run_onchange_before_11-install-opensuse-software.tmpl - /home/.chezmoiscripts/freebsd/run_onchange_before_11-install-freebsd-packages.tmpl - /home/.chezmoiscripts/fedora/run_onchange_before_10-install-fedora-dependencies.tmpl - /home/.chezmoiscripts/debian/run_onchange_before_10-install-debian-dependencies.tmpl - /home/.chezmoiscripts/darwin/run_onchange_before_10_install-darwin-dependencies.tmpl - /home/.chezmoiscripts/centos/run_onchange_before_10-install-centos-dependencies.tmpl - /home/.chezmoiscripts/archlinux/run_onchange_before_10_install-archlinux-dependencies.tmpl - /home/.chezmoiscripts/_universal/run_onchange_before_5-install-homebrew.tmpl - /home/.chezmoiscripts/_universal/run_onchange_before_8-install-zx.tmpl
2022-12-25 00:30:40 -08:00
{{ includeTemplate "universal/logg" }}
Update dotfiles/.local/share/chezmoi/home/.chezmoiscripts/darwin/run_onchange_before_10_install-darwin-dependencies.tmpl, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/fedora/run_onchange_before_10-install-fedora-dependencies, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/centos/run_onchange_before_10-install-centos-dependencies, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/debian/run_onchange_before_10-install-debian-dependencies, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/ubuntu/run_onchange_before_11-install-packages, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/opensuse/run_onchange_before_11-install-opensuse-packages, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/freebsd/run_onchange_before_11-install-freebsd-packages, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/fedora/run_onchange_before_11-install-fedora-packages, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/debian/run_onchange_before_11-install-debian-packages, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/darwin/run_onchange_before_11-install-darwin-packages, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/centos/run_onchange_before_10-install-centos-packages, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/archlinux/run_onchange_before_11-install-archlinux-packages, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/windows/run_onchange_before_11-install-windows-packages Deleted dotfiles/.local/share/chezmoi/home/run_update, dotfiles/.local/share/chezmoi/home/run_once_provision
2022-11-24 07:34:09 -08:00
{{- $packages := splitList " " (includeTemplate "universal/common-dependencies" .) -}}
{{- $additionalPackages := splitList " " (includeTemplate "centos/common-dependencies" .) -}}
{{- $packages = concat $packages $additionalPackages -}}
Update dotfiles/.local/share/chezmoi/home/.chezmoiscripts/darwin/run_onchange_before_10_install-darwin-dependencies.tmpl, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/fedora/run_onchange_before_10-install-fedora-dependencies, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/centos/run_onchange_before_10-install-centos-dependencies, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/debian/run_onchange_before_10-install-debian-dependencies, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/ubuntu/run_onchange_before_11-install-packages, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/opensuse/run_onchange_before_11-install-opensuse-packages, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/freebsd/run_onchange_before_11-install-freebsd-packages, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/fedora/run_onchange_before_11-install-fedora-packages, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/debian/run_onchange_before_11-install-debian-packages, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/darwin/run_onchange_before_11-install-darwin-packages, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/centos/run_onchange_before_10-install-centos-packages, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/archlinux/run_onchange_before_11-install-archlinux-packages, dotfiles/.local/share/chezmoi/home/.chezmoiscripts/windows/run_onchange_before_11-install-windows-packages Deleted dotfiles/.local/share/chezmoi/home/run_update, dotfiles/.local/share/chezmoi/home/run_once_provision
2022-11-24 07:34:09 -08:00
### Detect package manager
if command -v dnf > /dev/null; then
PKG_MANAGER='dnf'
else
PKG_MANAGER='yum'
fi
### Print dependency list
logg 'Installing common dependencies using `'"$PKG_MANAGER"'`'
logg info 'Dependencies: {{ $packages | sortAlpha | uniq | join " " -}}'
### Install packages if they are not already present
for PACKAGE in {{ $packages | sortAlpha | uniq | join " " -}}; do
logg info 'Checking for presence of `'"$PACKAGE"'`'
if rpm -qa | grep "$PACKAGE" > /dev/null; then
logg info 'The '"$PACKAGE"' package is already installed'
else
logg info 'Installing `'"$PACKAGE"'`'
sudo "$PKG_MANAGER" install -y "$PACKAGE" || EXIT_CODE=$?
if [ -n "$EXIT_CODE" ]; then
logg error 'Error installing `'"$PACKAGE"'` via `'"$PKG_MANAGER"'`'
logg info 'Proceeding with installation..'
unset EXIT_CODE
fi
fi
done