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
|
|
|
|
|
2023-01-04 17:56:52 -08:00
|
|
|
# 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
|
|
|
|
2023-01-24 20:36:59 -08:00
|
|
|
{{ includeTemplate "universal/logg-before" }}
|
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
|
|
|
|
2023-01-04 17:56:52 -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
|
|
|
|
2023-01-04 18:15:16 -08:00
|
|
|
### Detect package manager
|
2022-12-25 01:27:42 -08:00
|
|
|
if command -v dnf > /dev/null; then
|
2023-01-04 18:15:16 -08:00
|
|
|
PKG_MANAGER='dnf'
|
2022-12-25 01:27:42 -08:00
|
|
|
else
|
2023-01-04 18:15:16 -08:00
|
|
|
PKG_MANAGER='yum'
|
|
|
|
fi
|
|
|
|
|
|
|
|
### Print dependency list
|
|
|
|
logg 'Installing common dependencies using `'"$PKG_MANAGER"'`'
|
|
|
|
logg info 'Dependencies: {{ $packages | sortAlpha | uniq | join " " -}}'
|
2022-12-25 01:27:42 -08:00
|
|
|
|
2023-01-04 18:15:16 -08:00
|
|
|
### 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
|
2022-12-25 01:27:42 -08:00
|
|
|
logg info 'Installing `'"$PACKAGE"'`'
|
2023-01-04 18:15:16 -08:00
|
|
|
sudo "$PKG_MANAGER" install -y "$PACKAGE" || EXIT_CODE=$?
|
2022-12-25 01:27:42 -08:00
|
|
|
if [ -n "$EXIT_CODE" ]; then
|
2023-01-04 18:15:16 -08:00
|
|
|
logg error 'Error installing `'"$PACKAGE"'` via `'"$PKG_MANAGER"'`'
|
2022-12-25 01:27:42 -08:00
|
|
|
logg info 'Proceeding with installation..'
|
|
|
|
unset EXIT_CODE
|
|
|
|
fi
|
2023-01-04 18:15:16 -08:00
|
|
|
fi
|
|
|
|
done
|