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" |
cut --delimiter "=" --fields "2"
)"
sh_apt_clean() {
rwx_apt_clean() {
apt-get \
clean
}
sh_apt_conf_write() {
rwx_apt_conf_write() {
printf "\
Acquire::AllowInsecureRepositories False;
Acquire::AllowWeakRepositories False;
@ -22,55 +22,55 @@ Dpkg::Progress True;
" >"/etc/apt/apt.conf.d/apt.conf"
}
sh_apt_install_backports() {
sh_apt_install_target "${SH_DEBIAN_CODENAME}-backports" "${@}"
rwx_apt_install_backports() {
rwx_apt_install_target "${RWX_DEBIAN_CODENAME}-backports" "${@}"
}
sh_apt_install_release() {
sh_apt_install_target "${SH_DEBIAN_CODENAME}" "${@}"
rwx_apt_install_release() {
rwx_apt_install_target "${RWX_DEBIAN_CODENAME}" "${@}"
}
sh_apt_install_target() {
rwx_apt_install_target() {
local target="${1}"
shift
local package
for package in "${@}"; do
sh_log_info
sh_log_info "${package}${target}"
rwx_log "" \
"${package}${target}"
apt-get \
install \
--assume-yes \
--target-release "${target}" \
"${package}"
sh_apt_clean
rwx_apt_clean
done
}
sh_apt_sources_write() {
rwx_apt_sources_write() {
printf "%s" "\
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 \
${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 \
${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 \
${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"
}
sh_apt_update() {
rwx_apt_update() {
apt-get \
update
}
sh_apt_upgrade() {
rwx_apt_upgrade() {
apt-get \
upgrade \
--assume-yes
sh_apt_clean
rwx_apt_clean
}
sh_debian_frontend_disable() {
rwx_debian_frontend_disable() {
export DEBIAN_FRONTEND="noninteractive"
}