diff options
author | Daniel Baumann <daniel.baumann@open-infrastructure.net> | 2024-08-29 09:38:30 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@open-infrastructure.net> | 2024-08-29 11:21:49 +0000 |
commit | 46851c1dd1ec771dea886eaf92bc25e739babb6f (patch) | |
tree | ec3ed403b29aaf644aac4cd927ec0fad60b8be04 /share/build-scripts/debconf.d/0003-debconf | |
parent | Adding example preseeding for local archives. (diff) | |
download | compute-tools-46851c1dd1ec771dea886eaf92bc25e739babb6f.tar.xz compute-tools-46851c1dd1ec771dea886eaf92bc25e739babb6f.zip |
Switching from apt list files to sources files.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to '')
-rwxr-xr-x | share/build-scripts/debconf.d/0003-debconf | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/share/build-scripts/debconf.d/0003-debconf b/share/build-scripts/debconf.d/0003-debconf index e12e25e..bd171c1 100755 --- a/share/build-scripts/debconf.d/0003-debconf +++ b/share/build-scripts/debconf.d/0003-debconf @@ -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,9 +700,17 @@ 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" fi +cat > "${DEBCONF_TMPDIR}/apt/${LIST}" << EOF +Types: deb +URIs: ${MIRROR} +Suites: ${SUITES} +Components: ${AREAS} +PDiffs: no +EOF + PREFERENCES_PACKAGE="" PREFERENCES_PIN="" PREFERENCES_PIN_PRIORITY="" @@ -715,7 +731,7 @@ Local_archives () if [ -n "${PREFERENCES_PACKAGE}" ] || [ -n "${PREFERENCES_PIN}" ] || [ -n "${PREFERENCES_PIN_PRIORITY}" ] then -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} |