V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 39s
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 39s
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -22,58 +22,60 @@ guard_sourcing
|
||||
check_pkgs() {
|
||||
apt-get update -y > /dev/null 2>&1
|
||||
|
||||
# TODO: Only activate in case CISS.debian.live.builder does not include the following packages as per default.
|
||||
### Define HashMap: command -> package
|
||||
# shellcheck disable=SC2154
|
||||
declare -A hmp_command_packages=(
|
||||
[apt-transport-https]=apt-transport-https
|
||||
[bzip2]=bzip2
|
||||
[ca-certificates]=ca-certificates
|
||||
[curl]=curl
|
||||
[expect]=expect
|
||||
[fdisk]=fdisk
|
||||
[gdisk]=gdisk
|
||||
[git]=git
|
||||
[gpg]=gnupg
|
||||
[lsb_release]=lsb-release
|
||||
[mkfs.btrfs]=btrfs-progs
|
||||
[mkfs.ext4]=e2fsprogs
|
||||
[mkfs.fat]=dosfstools
|
||||
[mkswap]=util-linux
|
||||
[mkfs.xfs]=xfsprogs
|
||||
[parted]=parted
|
||||
[pwgen]=pwgen
|
||||
[tar]=tar
|
||||
[wget]=wget
|
||||
[whois]=whois
|
||||
[xz]=xz-utils
|
||||
[yq]=yq
|
||||
)
|
||||
#declare -A hmp_command_packages=(
|
||||
# [apt-transport-https]=apt-transport-https
|
||||
# [bzip2]=bzip2
|
||||
# [ca-certificates]=ca-certificates
|
||||
# [curl]=curl
|
||||
# [expect]=expect
|
||||
# [fdisk]=fdisk
|
||||
# [gdisk]=gdisk
|
||||
# [git]=git
|
||||
# [gpg]=gnupg
|
||||
# [lsb_release]=lsb-release
|
||||
# [mkfs.btrfs]=btrfs-progs
|
||||
# [mkfs.ext4]=e2fsprogs
|
||||
# [mkfs.fat]=dosfstools
|
||||
# [mkswap]=util-linux
|
||||
# [mkfs.xfs]=xfsprogs
|
||||
# [parted]=parted
|
||||
# [pwgen]=pwgen
|
||||
# [tar]=tar
|
||||
# [wget]=wget
|
||||
# [whois]=whois
|
||||
# [xz]=xz-utils
|
||||
# [yq]=yq
|
||||
#)
|
||||
|
||||
### Iterate over HashMap
|
||||
declare var_cmd var_pkg
|
||||
for var_cmd in "${!hmp_command_packages[@]}"; do
|
||||
var_pkg="${hmp_command_packages[${var_cmd}]}"
|
||||
if ! command -v "${var_cmd}" &>/dev/null; then
|
||||
do_log "info" "true" "Installing ${var_pkg} ..."
|
||||
apt-get install -y --no-install-recommends "${var_pkg}"
|
||||
do_log "info" "true" "Installing ${var_pkg} done."
|
||||
else
|
||||
do_log "info" "true" "${var_cmd} already installed."
|
||||
fi
|
||||
done
|
||||
#declare var_cmd var_pkg
|
||||
#for var_cmd in "${!hmp_command_packages[@]}"; do
|
||||
# var_pkg="${hmp_command_packages[${var_cmd}]}"
|
||||
# if ! command -v "${var_cmd}" &>/dev/null; then
|
||||
# apt-get install -y --no-install-recommends "${var_pkg}"
|
||||
# do_log "info" "file_only" "Installing ${var_pkg} done."
|
||||
# else
|
||||
# do_log "info" "file_only" "${var_cmd} already installed."
|
||||
# fi
|
||||
#done
|
||||
|
||||
if [[ -z "$(command -v debootstrap || true)" ]]; then
|
||||
if grep -RqsE '^[[:space:]]*deb .*backports' /etc/apt/sources.list /etc/apt/sources.list.d; then
|
||||
# shellcheck disable=SC2155
|
||||
declare codename=$(lsb_release -sc)
|
||||
apt-get install -y -t "${codename}-backports" debootstrap
|
||||
else
|
||||
apt-get install -y debootstrap
|
||||
fi
|
||||
fi
|
||||
#if [[ -z "$(command -v debootstrap || true)" ]]; then
|
||||
# if grep -RqsE '^[[:space:]]*deb .*backports' /etc/apt/sources.list /etc/apt/sources.list.d; then
|
||||
# # shellcheck disable=SC2155
|
||||
# declare codename=$(lsb_release -sc)
|
||||
# apt-get install -y -t "${codename}-backports" debootstrap
|
||||
# else
|
||||
# apt-get install -y debootstrap
|
||||
# fi
|
||||
#fi
|
||||
|
||||
if [[ -z "$(command -v dialog || true)" ]]; then
|
||||
if ! "${VAR_AUTO_INSTALL}"; then apt-get install -y --no-install-recommends dialog; fi
|
||||
fi
|
||||
#if [[ -z "$(command -v dialog || true)" ]]; then
|
||||
# if ! "${VAR_AUTO_INSTALL}"; then apt-get install -y --no-install-recommends dialog; fi
|
||||
#fi
|
||||
|
||||
return 0
|
||||
}
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
|
||||
Reference in New Issue
Block a user