V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m54s
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m54s
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -36,8 +36,12 @@ guard_sourcing
|
||||
#######################################
|
||||
generate_sources822() {
|
||||
### Declare Arrays, HashMaps, and Variables.
|
||||
declare -a ary_components=() ary_types=()
|
||||
declare var_arch="" var_codename="" var_deb_src="" var_dir="" var_hostname="" var_hostsecure="" var_url="" var_surl=""
|
||||
declare -a ary_components=() ary_types=()
|
||||
declare var_arch="" var_codename="" var_deb_src="" var_dir="" var_hostname="" var_hostsecure="" var_url="" var_surl=""
|
||||
declare var_target="${TARGET}"
|
||||
|
||||
### Check for TARGET / RECOVERY.
|
||||
[[ "${VAR_RUN_RECOVERY}" == "true" ]] && var_target="${RECOVERY}"
|
||||
|
||||
# shellcheck disable=SC2154 # "${architecture}"
|
||||
var_arch="${architecture,,}"
|
||||
@@ -79,9 +83,9 @@ generate_sources822() {
|
||||
|
||||
|
||||
### Main Repository
|
||||
insert_header "${TARGET}/etc/apt/sources.list.d/trixie.sources"
|
||||
insert_comments "${TARGET}/etc/apt/sources.list.d/trixie.sources"
|
||||
cat << EOF >> "${TARGET}/etc/apt/sources.list.d/trixie.sources"
|
||||
insert_header "${var_target}/etc/apt/sources.list.d/trixie.sources"
|
||||
insert_comments "${var_target}/etc/apt/sources.list.d/trixie.sources"
|
||||
cat << EOF >> "${var_target}/etc/apt/sources.list.d/trixie.sources"
|
||||
#------------------------------------------------------------------------------------------------------------------------------#
|
||||
# OFFICIAL DEBIAN REPOS #
|
||||
#------------------------------------------------------------------------------------------------------------------------------#
|
||||
@@ -98,9 +102,9 @@ EOF
|
||||
|
||||
### Security Repository
|
||||
if [[ "${apt_updates_security,,}" == "true" ]]; then
|
||||
insert_header "${TARGET}/etc/apt/sources.list.d/trixie-security.sources"
|
||||
insert_comments "${TARGET}/etc/apt/sources.list.d/trixie-security.sources"
|
||||
cat << EOF >> "${TARGET}/etc/apt/sources.list.d/trixie-security.sources"
|
||||
insert_header "${var_target}/etc/apt/sources.list.d/trixie-security.sources"
|
||||
insert_comments "${var_target}/etc/apt/sources.list.d/trixie-security.sources"
|
||||
cat << EOF >> "${var_target}/etc/apt/sources.list.d/trixie-security.sources"
|
||||
#------------------------------------------------------------------------------------------------------------------------------#
|
||||
# OFFICIAL DEBIAN REPOS #
|
||||
#------------------------------------------------------------------------------------------------------------------------------#
|
||||
@@ -117,9 +121,9 @@ EOF
|
||||
|
||||
### Updates Repository
|
||||
if [[ "${apt_updates_release,,}" == "true" ]]; then
|
||||
insert_header "${TARGET}/etc/apt/sources.list.d/trixie-updates.sources"
|
||||
insert_comments "${TARGET}/etc/apt/sources.list.d/trixie-updates.sources"
|
||||
cat << EOF >> "${TARGET}/etc/apt/sources.list.d/trixie-updates.sources"
|
||||
insert_header "${var_target}/etc/apt/sources.list.d/trixie-updates.sources"
|
||||
insert_comments "${var_target}/etc/apt/sources.list.d/trixie-updates.sources"
|
||||
cat << EOF >> "${var_target}/etc/apt/sources.list.d/trixie-updates.sources"
|
||||
#------------------------------------------------------------------------------------------------------------------------------#
|
||||
# OFFICIAL DEBIAN REPOS #
|
||||
#------------------------------------------------------------------------------------------------------------------------------#
|
||||
@@ -137,9 +141,9 @@ EOF
|
||||
|
||||
### Backports Repository
|
||||
if [[ "${apt_updates_backports,,}" == "true" ]]; then
|
||||
insert_header "${TARGET}/etc/apt/sources.list.d/trixie-backports.sources"
|
||||
insert_comments "${TARGET}/etc/apt/sources.list.d/trixie-backports.sources"
|
||||
cat << EOF >> "${TARGET}/etc/apt/sources.list.d/trixie-backports.sources"
|
||||
insert_header "${var_target}/etc/apt/sources.list.d/trixie-backports.sources"
|
||||
insert_comments "${var_target}/etc/apt/sources.list.d/trixie-backports.sources"
|
||||
cat << EOF >> "${var_target}/etc/apt/sources.list.d/trixie-backports.sources"
|
||||
#------------------------------------------------------------------------------------------------------------------------------#
|
||||
# OFFICIAL DEBIAN REPOS #
|
||||
#------------------------------------------------------------------------------------------------------------------------------#
|
||||
@@ -156,30 +160,33 @@ EOF
|
||||
fi
|
||||
|
||||
|
||||
if [[ -f "${TARGET}/etc/apt/sources.list" ]]; then
|
||||
rm -f "${TARGET}/etc/apt/sources.list"
|
||||
if [[ -f "${var_target}/etc/apt/sources.list" ]]; then
|
||||
rm -f "${var_target}/etc/apt/sources.list"
|
||||
fi
|
||||
|
||||
|
||||
insert_header "${TARGET}/etc/apt/apt.conf.d/90-no-pdiffs"
|
||||
insert_comments "${TARGET}/etc/apt/apt.conf.d/90-no-pdiffs"
|
||||
cat << 'EOF' >> "${TARGET}/etc/apt/apt.conf.d/90-no-pdiffs"
|
||||
insert_header "${var_target}/etc/apt/apt.conf.d/90-no-pdiffs"
|
||||
insert_comments "${var_target}/etc/apt/apt.conf.d/90-no-pdiffs"
|
||||
cat << 'EOF' >> "${var_target}/etc/apt/apt.conf.d/90-no-pdiffs"
|
||||
Acquire::PDiffs "false";
|
||||
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=conf
|
||||
EOF
|
||||
sed -i -E 's|^([[:space:]]*)#+|\1//|' "${TARGET}/etc/apt/apt.conf.d/90-no-pdiffs"
|
||||
sed -i -E 's|^([[:space:]]*)#+|\1//|' "${var_target}/etc/apt/apt.conf.d/90-no-pdiffs"
|
||||
|
||||
|
||||
insert_header "${TARGET}/etc/apt/apt.conf.d/91-acquire"
|
||||
insert_comments "${TARGET}/etc/apt/apt.conf.d/91-acquire"
|
||||
cat << 'EOF' >> "${TARGET}/etc/apt/apt.conf.d/91-acquire"
|
||||
insert_header "${var_target}/etc/apt/apt.conf.d/91-acquire"
|
||||
insert_comments "${var_target}/etc/apt/apt.conf.d/91-acquire"
|
||||
cat << 'EOF' >> "${var_target}/etc/apt/apt.conf.d/91-acquire"
|
||||
Acquire::Retries "3";
|
||||
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=conf
|
||||
EOF
|
||||
sed -i -E 's|^([[:space:]]*)#+|\1//|' "${TARGET}/etc/apt/apt.conf.d/91-acquire"
|
||||
sed -i -E 's|^([[:space:]]*)#+|\1//|' "${var_target}/etc/apt/apt.conf.d/91-acquire"
|
||||
|
||||
guard_dir && return 0
|
||||
}
|
||||
### Prevents accidental 'unset -f'.
|
||||
# shellcheck disable=SC2034
|
||||
readonly -f generate_sources822
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
|
||||
Reference in New Issue
Block a user