#!/bin/bash

## Copyright (C) 2012 - 2025 ENCRYPTED SUPPORT LLC <adrelanos@whonix.org>
## See the file COPYING for copying conditions.

set -o errexit
set -o nounset
set -o pipefail
set -o errtrace
shopt -s inherit_errexit
shopt -s shift_verbose

# shellcheck source=../../../helper-scripts/usr/libexec/helper-scripts/strings.bsh
source /usr/libexec/helper-scripts/strings.bsh

default_if_empty POLICYRCD "/usr/share/helper-scripts/policy-rc.d"
default_if_empty DEBIAN_FRONTEND "noninteractive"
default_if_empty DEBIAN_PRIORITY "critical"
default_if_empty DEBCONF_NOWARNINGS "yes"
default_if_empty APT_LISTCHANGES_FRONTEND "text"
default_if_empty NEEDRESTART_MODE "l"

export POLICYRCD DEBIAN_FRONTEND DEBIAN_PRIORITY DEBCONF_NOWARNINGS APT_LISTCHANGES_FRONTEND NEEDRESTART_MODE

## Why we are not using the 'apt-get' option '--yes'?
## See 'man/apt-get-noninteractive.8.ronn' or 'man apt-get-noninteractive'.
apt-get -o Dpkg::Options::="--force-confask,confnew,confmiss" "$@"
