This commit is contained in:
Marc Beninca 2024-11-29 19:04:20 +01:00
parent e811d73563
commit 897a228614
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -1,14 +1,14 @@
SH_DEBIAN_CODENAME="$( RWX_DEBIAN_CODENAME="$(
grep "VERSION_CODENAME" "/etc/os-release" | grep "VERSION_CODENAME" "/etc/os-release" |
cut --delimiter "=" --fields "2" cut --delimiter "=" --fields "2"
)" )"
sh_apt_clean() { rwx_apt_clean() {
apt-get \ apt-get \
clean clean
} }
sh_apt_conf_write() { rwx_apt_conf_write() {
printf "\ printf "\
Acquire::AllowInsecureRepositories False; Acquire::AllowInsecureRepositories False;
Acquire::AllowWeakRepositories False; Acquire::AllowWeakRepositories False;
@ -22,55 +22,55 @@ Dpkg::Progress True;
" >"/etc/apt/apt.conf.d/apt.conf" " >"/etc/apt/apt.conf.d/apt.conf"
} }
sh_apt_install_backports() { rwx_apt_install_backports() {
sh_apt_install_target "${SH_DEBIAN_CODENAME}-backports" "${@}" rwx_apt_install_target "${RWX_DEBIAN_CODENAME}-backports" "${@}"
} }
sh_apt_install_release() { rwx_apt_install_release() {
sh_apt_install_target "${SH_DEBIAN_CODENAME}" "${@}" rwx_apt_install_target "${RWX_DEBIAN_CODENAME}" "${@}"
} }
sh_apt_install_target() { rwx_apt_install_target() {
local target="${1}" local target="${1}"
shift shift
local package local package
for package in "${@}"; do for package in "${@}"; do
sh_log_info rwx_log "" \
sh_log_info "${package}${target}" "${package}${target}"
apt-get \ apt-get \
install \ install \
--assume-yes \ --assume-yes \
--target-release "${target}" \ --target-release "${target}" \
"${package}" "${package}"
sh_apt_clean rwx_apt_clean
done done
} }
sh_apt_sources_write() { rwx_apt_sources_write() {
printf "%s" "\ printf "%s" "\
deb https://deb.debian.org/debian \ deb https://deb.debian.org/debian \
${SH_DEBIAN_CODENAME} main non-free-firmware contrib non-free ${RWX_DEBIAN_CODENAME} main non-free-firmware contrib non-free
deb https://deb.debian.org/debian \ deb https://deb.debian.org/debian \
${SH_DEBIAN_CODENAME}-backports main non-free-firmware contrib non-free ${RWX_DEBIAN_CODENAME}-backports main non-free-firmware contrib non-free
deb https://deb.debian.org/debian \ deb https://deb.debian.org/debian \
${SH_DEBIAN_CODENAME}-updates main non-free-firmware contrib non-free ${RWX_DEBIAN_CODENAME}-updates main non-free-firmware contrib non-free
deb https://deb.debian.org/debian-security \ deb https://deb.debian.org/debian-security \
${SH_DEBIAN_CODENAME}-security main non-free-firmware contrib non-free ${RWX_DEBIAN_CODENAME}-security main non-free-firmware contrib non-free
" >"/etc/apt/sources.list" " >"/etc/apt/sources.list"
} }
sh_apt_update() { rwx_apt_update() {
apt-get \ apt-get \
update update
} }
sh_apt_upgrade() { rwx_apt_upgrade() {
apt-get \ apt-get \
upgrade \ upgrade \
--assume-yes --assume-yes
sh_apt_clean rwx_apt_clean
} }
sh_debian_frontend_disable() { rwx_debian_frontend_disable() {
export DEBIAN_FRONTEND="noninteractive" export DEBIAN_FRONTEND="noninteractive"
} }