summaryrefslogtreecommitdiffstats
path: root/share/build-scripts/debconf.d/0003-debconf
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xshare/build-scripts/debconf.d/0003-debconf58
1 files changed, 48 insertions, 10 deletions
diff --git a/share/build-scripts/debconf.d/0003-debconf b/share/build-scripts/debconf.d/0003-debconf
index e12e25e..b5b252b 100755
--- a/share/build-scripts/debconf.d/0003-debconf
+++ b/share/build-scripts/debconf.d/0003-debconf
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright (C) 2014-2022 Daniel Baumann <daniel.baumann@open-infrastructure.net>
+# Copyright (C) 2014-2024 Daniel Baumann <daniel.baumann@open-infrastructure.net>
#
# SPDX-License-Identifier: GPL-3.0+
#
@@ -664,12 +664,16 @@ Local_archives ()
do
mkdir -p "${DEBCONF_TMPDIR}/apt"
- REPOSITORY="${RET#deb }"
+ REPOSITORY="$(echo "${RET}" | sed -e 's|^deb ||')"
- LIST="archive${NUMBER}.list"
+ MIRROR="$(echo ${REPOSITORY} | cut -d' ' -f1)"
+ SUITES="$(echo ${REPOSITORY} | cut -d' ' -f2)"
+ AREAS="$(echo ${REPOSITORY} | cut -d' ' -f3-)"
+
+ LIST="archive${NUMBER}.sources"
if db_get container/archive${NUMBER}/list
then
- LIST="$(basename ${RET} .list).list"
+ LIST="$(basename ${RET} .sources).sources"
fi
COMMENT=""
@@ -677,14 +681,18 @@ Local_archives ()
then
COMMENT="${RET}"
- echo "# ${COMMENT}" > "${DEBCONF_TMPDIR}/apt/${LIST}"
- fi
+cat > "${DEBCONF_TMPDIR}/apt/${LIST}" << EOF
+# ${COMMENT}
- echo "deb ${REPOSITORY}" >> "${DEBCONF_TMPDIR}/apt/${LIST}"
+EOF
+
+ fi
if db_get container/archive${NUMBER}/source && [ "$RET" = true ]
then
- echo "deb-src ${REPOSITORY}" >> "${DEBCONF_TMPDIR}/apt/${LIST}"
+ TYPES="deb deb-src"
+ else
+ TYPES="deb"
fi
KEY=""
@@ -692,7 +700,28 @@ Local_archives ()
then
KEY="${RET}"
- wget -q "${KEY}" -O "${DEBCONF_TMPDIR}/apt/$(basename ${LIST} .list).key"
+ wget -q "${KEY}" -O "${DEBCONF_TMPDIR}/apt/$(basename ${LIST} .sources).key"
+
+ SIGNED="/etc/apt/keyrings/$(basename ${LIST} .sources).key"
+ else
+ SIGNED=""
+ fi
+
+cat > "${DEBCONF_TMPDIR}/apt/${LIST}" << EOF
+Types: deb
+URIs: ${MIRROR}
+Suites: ${SUITES}
+Components: ${AREAS}
+PDiffs: no
+EOF
+
+ if [ -n "${SIGNED}" ]
+ then
+
+cat >> "${DEBCONF_TMPDIR}/apt/${LIST}" << EOF
+Signed-By: ${SIGNED}
+EOF
+
fi
PREFERENCES_PACKAGE=""
@@ -714,8 +743,17 @@ Local_archives ()
if [ -n "${PREFERENCES_PACKAGE}" ] || [ -n "${PREFERENCES_PIN}" ] || [ -n "${PREFERENCES_PIN_PRIORITY}" ]
then
+ if [ -n "${COMMENT}" ]
+ then
+
+cat > "${DEBCONF_TMPDIR}/apt/$(basename ${LIST} .sources).pref" << EOF
+# ${COMMENT}
+
+EOF
+
+ fi
-cat > "${DEBCONF_TMPDIR}/apt/$(basename ${LIST} .list).pref" << EOF
+cat >> "${DEBCONF_TMPDIR}/apt/$(basename ${LIST} .sources).pref" << EOF
Package: ${PREFERENCES_PACKAGE}
Pin: ${PREFERENCES_PIN}
Pin-Priority: ${PREFERENCES_PIN_PRIORITY}