diff options
author | jnqnfe <jnqnfe@gmail.com> | 2015-02-05 03:33:14 +0000 |
---|---|---|
committer | Luca Boccassi <bluca@debian.org> | 2020-03-05 21:08:53 +0000 |
commit | ac4ba405df4c5642d94f69f537144f03f5ed170a (patch) | |
tree | 8c8b4904722f9b14ebddaad1b105033222c0754a | |
parent | cac44b28d5699c4e6733310b1f8b4968e09a2854 (diff) | |
download | vyos-live-build-ac4ba405df4c5642d94f69f537144f03f5ed170a.tar.gz vyos-live-build-ac4ba405df4c5642d94f69f537144f03f5ed170a.zip |
archives: deduplicate apt sourcelist file construction
Geez :O
Gbp-Dch: Short
Closes: #952889
-rwxr-xr-x | functions/sourcelist.sh | 161 | ||||
-rwxr-xr-x | scripts/build/bootstrap_archives | 122 | ||||
-rwxr-xr-x | scripts/build/chroot_archives | 236 |
3 files changed, 164 insertions, 355 deletions
diff --git a/functions/sourcelist.sh b/functions/sourcelist.sh new file mode 100755 index 000000000..69d157033 --- /dev/null +++ b/functions/sourcelist.sh @@ -0,0 +1,161 @@ +#!/bin/sh + +## live-build(7) - System Build Scripts +## Copyright (C) 2006-2014 Daniel Baumann <mail@daniel-baumann.ch> +## +## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING. +## This is free software, and you are welcome to redistribute it +## under certain conditions; see COPYING for details. + + +Create_apt_sources_list () +{ + local PARENT_MIRROR + local MIRROR + local PARENT_MIRROR_SECURITY + local MIRROR_SECURITY + local PARENT_DISTRIBUTION + local DISTRIBUTION + + case "${1}" in + chroot) + PARENT_MIRROR=${LB_PARENT_MIRROR_CHROOT} + MIRROR=${LB_MIRROR_CHROOT} + PARENT_MIRROR_SECURITY=${LB_PARENT_MIRROR_CHROOT_SECURITY} + MIRROR_SECURITY=${LB_MIRROR_CHROOT_SECURITY} + PARENT_DISTRIBUTION=${LB_PARENT_DISTRIBUTION_CHROOT} + DISTRIBUTION=${LB_DISTRIBUTION_CHROOT} + ;; + binary) + PARENT_MIRROR=${LB_PARENT_MIRROR_BINARY} + MIRROR=${LB_MIRROR_BINARY} + PARENT_MIRROR_SECURITY=${LB_PARENT_MIRROR_BINARY_SECURITY} + MIRROR_SECURITY=${LB_MIRROR_BINARY_SECURITY} + PARENT_DISTRIBUTION=${LB_PARENT_DISTRIBUTION_BINARY} + DISTRIBUTION=${LB_DISTRIBUTION_BINARY} + ;; + *) + Echo_error "Invalid mode '${1}' specified for source list creation!" + exit 1 + ;; + esac + + local ADD_SOURCES=false + if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ]; then + ADD_SOURCES=true + fi + + local PARENT_FILE + case "${LB_DERIVATIVE}" in + true) + PARENT_FILE="sources.list.d/debian.list" + ;; + + false) + PARENT_FILE="sources.list" + ;; + esac + + local LIST_FILE="chroot/etc/apt/sources.list.d/${LB_MODE}.list" + local PARENT_LIST_FILE="chroot/etc/apt/${PARENT_FILE}" + + local _DISTRIBUTION + if [ "${LB_DERIVATIVE}" = "true" ]; then + _DISTRIBUTION="$(echo ${DISTRIBUTION} | sed -e 's|-backports||')" + fi + + # Clear out existing lists + rm -f ${PARENT_LIST_FILE} ${LIST_FILE} + + # Set general repo + echo "deb ${PARENT_MIRROR} ${PARENT_DISTRIBUTION} ${LB_PARENT_ARCHIVE_AREAS}" >> ${PARENT_LIST_FILE} + + if $ADD_SOURCES; then + echo "deb-src ${PARENT_MIRROR} ${PARENT_DISTRIBUTION} ${LB_PARENT_ARCHIVE_AREAS}" >> "${PARENT_LIST_FILE}" + fi + + if [ "${LB_DERIVATIVE}" = "true" ]; then + echo "deb ${MIRROR} ${_DISTRIBUTION} ${LB_ARCHIVE_AREAS}" >> "${LIST_FILE}" + + if $ADD_SOURCES; then + echo "deb-src ${MIRROR} ${_DISTRIBUTION} ${LB_ARCHIVE_AREAS}" >> "${LIST_FILE}" + fi + fi + + # Set security repo + if [ "${LB_SECURITY}" = "true" ]; then + case "${LB_MODE}" in + debian|progress-linux) + case "${PARENT_DISTRIBUTION}" in + sid) + # do nothing + ;; + + *) + echo "deb ${PARENT_MIRROR_SECURITY} ${PARENT_DISTRIBUTION}/updates ${LB_PARENT_ARCHIVE_AREAS}" >> "${PARENT_LIST_FILE}" + + if $ADD_SOURCES; then + echo "deb-src ${PARENT_MIRROR_SECURITY} ${PARENT_DISTRIBUTION}/updates ${LB_PARENT_ARCHIVE_AREAS}" >> "${PARENT_LIST_FILE}" + fi + ;; + esac + + if [ "${LB_MODE}" = progress-linux ]; then + echo "deb ${MIRROR_SECURITY} ${_DISTRIBUTION}-security ${LB_ARCHIVE_AREAS}" >> "${LIST_FILE}" + + if $ADD_SOURCES; then + echo "deb-src ${MIRROR_SECURITY} ${_DISTRIBUTION}-security ${LB_ARCHIVE_AREAS}" >> "${LIST_FILE}" + fi + else + if [ "${LB_DERIVATIVE}" = "true" ]; then + echo "deb ${MIRROR_SECURITY} ${_DISTRIBUTION}/updates ${LB_ARCHIVE_AREAS}" >> "${LIST_FILE}" + + if $ADD_SOURCES; then + echo "deb-src ${MIRROR_SECURITY} ${_DISTRIBUTION}/updates ${LB_ARCHIVE_AREAS}" >> "${LIST_FILE}" + fi + fi + fi + ;; + esac + fi + + # Set updates repo + if [ "${LB_UPDATES}" = "true" ]; then + echo "deb ${PARENT_MIRROR} ${PARENT_DISTRIBUTION}-updates ${LB_PARENT_ARCHIVE_AREAS}" >> "${PARENT_LIST_FILE}" + + if $ADD_SOURCES; then + echo "deb-src ${PARENT_MIRROR} ${PARENT_DISTRIBUTION}-updates ${LB_PARENT_ARCHIVE_AREAS}" >> "${PARENT_LIST_FILE}" + fi + + if [ "${LB_DERIVATIVE}" = "true" ]; then + echo "deb ${MIRROR} ${_DISTRIBUTION}-updates ${LB_ARCHIVE_AREAS}" >> "${LIST_FILE}" + + if $ADD_SOURCES; then + echo "deb-src ${MIRROR} ${_DISTRIBUTION}-updates ${LB_ARCHIVE_AREAS}" >> "${LIST_FILE}" + fi + fi + fi + + # Set backports repo + if [ "${LB_BACKPORTS}" = "true" ]; then + case "${LB_MODE}" in + debian) + if [ "${PARENT_DISTRIBUTION}" != "sid" ]; then + echo "deb ${PARENT_MIRROR} ${PARENT_DISTRIBUTION}-backports ${LB_PARENT_ARCHIVE_AREAS}" >> "${PARENT_LIST_FILE}" + + if $ADD_SOURCES; then + echo "deb-src ${PARENT_MIRROR} ${PARENT_DISTRIBUTION}-backports ${LB_PARENT_ARCHIVE_AREAS}" >> "${PARENT_LIST_FILE}" + fi + fi + ;; + esac + + if [ "${LB_DERIVATIVE}" = "true" ]; then + echo "deb ${MIRROR} ${_DISTRIBUTION}-backports ${LB_ARCHIVE_AREAS}" >> "${LIST_FILE}" + + if $ADD_SOURCES; then + echo "deb-src ${MIRROR} ${_DISTRIBUTION}-backports ${LB_ARCHIVE_AREAS}" >> "${LIST_FILE}" + fi + fi + fi +} diff --git a/scripts/build/bootstrap_archives b/scripts/build/bootstrap_archives index 3abf9bbf5..1c1d3e1db 100755 --- a/scripts/build/bootstrap_archives +++ b/scripts/build/bootstrap_archives @@ -34,16 +34,6 @@ Set_defaults # Requiring stage file Require_stagefile .build/config .build/bootstrap -case "${LB_DERIVATIVE}" in - true) - _PARENT_FILE="sources.list.d/debian.list" - ;; - - false) - _PARENT_FILE="sources.list" - ;; -esac - Echo_message "Configuring file /etc/apt/sources.list" # Checking stage file @@ -65,117 +55,7 @@ then fi # Configure custom sources.list -cat > chroot/etc/apt/${_PARENT_FILE} << EOF -deb ${LB_PARENT_MIRROR_CHROOT} ${LB_PARENT_DISTRIBUTION_CHROOT} ${LB_PARENT_ARCHIVE_AREAS} -EOF - -if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ] -then - echo "deb-src ${LB_PARENT_MIRROR_CHROOT} ${LB_PARENT_DISTRIBUTION_CHROOT} ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} -fi - -if [ "${LB_DERIVATIVE}" = "true" ] -then - rm -f chroot/etc/apt/sources.list.d/${LB_MODE}.list - - _DISTRIBUTION="$(echo ${LB_DISTRIBUTION_CHROOT} | sed -e 's|-backports||')" - - echo "deb ${LB_MIRROR_CHROOT} ${_DISTRIBUTION} ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list - - if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ] - then - echo "deb-src ${LB_MIRROR_CHROOT} ${_DISTRIBUTION} ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list - fi -fi - -if [ "${LB_SECURITY}" = "true" ] -then - case "${LB_MODE}" in - debian|progress-linux) - case "${LB_PARENT_DISTRIBUTION_CHROOT}" in - sid) - - ;; - - *) - echo "deb ${LB_PARENT_MIRROR_CHROOT_SECURITY} ${LB_PARENT_DISTRIBUTION_CHROOT}/updates ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} - - if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ] - then - echo "deb-src ${LB_PARENT_MIRROR_CHROOT_SECURITY} ${LB_PARENT_DISTRIBUTION_CHROOT}/updates ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} - fi - ;; - esac - - if [ "${LB_MODE}" = progress-linux ] - then - echo "deb ${LB_MIRROR_CHROOT_SECURITY} ${_DISTRIBUTION}-security ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list - - if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ] - then - echo "deb-src ${LB_MIRROR_CHROOT_SECURITY} ${_DISTRIBUTION}-security ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list - fi - else - if [ "${LB_DERIVATIVE}" = "true" ] - then - echo "deb ${LB_MIRROR_CHROOT_SECURITY} ${_DISTRIBUTION}/updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list - - if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ] - then - echo "deb-src ${LB_MIRROR_CHROOT_SECURITY} ${_DISTRIBUTION}/updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list - fi - fi - fi - ;; - esac -fi - -if [ "${LB_UPDATES}" = "true" ] -then - echo "deb ${LB_PARENT_MIRROR_CHROOT} ${LB_PARENT_DISTRIBUTION_CHROOT}-updates ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} - - if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ] - then - echo "deb-src ${LB_PARENT_MIRROR_CHROOT} ${LB_PARENT_DISTRIBUTION_CHROOT}-updates ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} - fi - - if [ "${LB_DERIVATIVE}" = "true" ] - then - echo "deb ${LB_MIRROR_CHROOT} ${_DISTRIBUTION}-updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list - - if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ] - then - echo "deb-src ${LB_MIRROR_CHROOT} ${_DISTRIBUTION}-updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list - fi - fi -fi - -if [ "${LB_BACKPORTS}" = "true" ] -then - case "${LB_MODE}" in - debian) - if [ "${LB_PARENT_DISTRIBUTION_CHROOT}" != "sid" ] - then - echo "deb ${LB_PARENT_MIRROR_CHROOT} ${LB_PARENT_DISTRIBUTION_CHROOT}-backports ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} - - if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ] - then - echo "deb-src ${LB_PARENT_MIRROR_CHROOT} ${LB_PARENT_DISTRIBUTION_CHROOT}-backports ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} - fi - fi - ;; - esac - - if [ "${LB_DERIVATIVE}" = "true" ] - then - echo "deb ${LB_MIRROR_CHROOT} ${_DISTRIBUTION}-backports ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list - - if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ] - then - echo "deb-src ${LB_MIRROR_CHROOT} ${_DISTRIBUTION}-backports ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list - fi - fi -fi +Create_apt_sources_list chroot # Adding local apt sources (chroot) for FILE in config/archives/*.list config/archives/*.list.chroot diff --git a/scripts/build/chroot_archives b/scripts/build/chroot_archives index 0c21d9b5f..8fa82276f 100755 --- a/scripts/build/chroot_archives +++ b/scripts/build/chroot_archives @@ -34,16 +34,6 @@ Set_defaults # Requiring stage file Require_stagefile .build/config .build/bootstrap -case "${LB_DERIVATIVE}" in - true) - _PARENT_FILE="sources.list.d/debian.list" - ;; - - false) - _PARENT_FILE="sources.list" - ;; -esac - case "${1}" in install) Echo_message "Configuring file /etc/apt/sources.list" @@ -67,118 +57,7 @@ case "${1}" in fi # Configure custom sources.list - -cat > chroot/etc/apt/${_PARENT_FILE} << EOF -deb ${LB_PARENT_MIRROR_CHROOT} ${LB_PARENT_DISTRIBUTION_CHROOT} ${LB_PARENT_ARCHIVE_AREAS} -EOF - - if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ] - then - echo "deb-src ${LB_PARENT_MIRROR_CHROOT} ${LB_PARENT_DISTRIBUTION_CHROOT} ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} - fi - - if [ "${LB_DERIVATIVE}" = "true" ] - then - rm -f chroot/etc/apt/sources.list.d/${LB_MODE}.list - - _DISTRIBUTION="$(echo ${LB_DISTRIBUTION_CHROOT} | sed -e 's|-backports||')" - - echo "deb ${LB_MIRROR_CHROOT} ${_DISTRIBUTION} ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list - - if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ] - then - echo "deb-src ${LB_MIRROR_CHROOT} ${_DISTRIBUTION} ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list - fi - fi - - if [ "${LB_SECURITY}" = "true" ] - then - case "${LB_MODE}" in - debian|progress-linux) - case "${LB_PARENT_DISTRIBUTION_CHROOT}" in - sid) - - ;; - - *) - echo "deb ${LB_PARENT_MIRROR_CHROOT_SECURITY} ${LB_PARENT_DISTRIBUTION_CHROOT}/updates ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} - - if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ] - then - echo "deb-src ${LB_PARENT_MIRROR_CHROOT_SECURITY} ${LB_PARENT_DISTRIBUTION_CHROOT}/updates ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} - fi - ;; - esac - - if [ "${LB_MODE}" = progress-linux ] - then - echo "deb ${LB_MIRROR_CHROOT_SECURITY} ${_DISTRIBUTION}-security ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list - - if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ] - then - echo "deb-src ${LB_MIRROR_CHROOT_SECURITY} ${_DISTRIBUTION}-security ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list - fi - else - if [ "${LB_DERIVATIVE}" = "true" ] - then - echo "deb ${LB_MIRROR_CHROOT_SECURITY} ${_DISTRIBUTION}/updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list - - if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ] - then - echo "deb-src ${LB_MIRROR_CHROOT_SECURITY} ${_DISTRIBUTION}/updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list - fi - fi - fi - ;; - esac - fi - - if [ "${LB_UPDATES}" = "true" ] - then - echo "deb ${LB_PARENT_MIRROR_CHROOT} ${LB_PARENT_DISTRIBUTION_CHROOT}-updates ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} - - if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ] - then - echo "deb-src ${LB_PARENT_MIRROR_CHROOT} ${LB_PARENT_DISTRIBUTION_CHROOT}-updates ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} - fi - - if [ "${LB_DERIVATIVE}" = "true" ] - then - echo "deb ${LB_MIRROR_CHROOT} ${_DISTRIBUTION}-updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list - - if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ] - then - echo "deb-src ${LB_MIRROR_CHROOT} ${_DISTRIBUTION}-updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list - fi - fi - fi - - if [ "${LB_BACKPORTS}" = "true" ] - then - case "${LB_MODE}" in - debian) - if [ "${LB_PARENT_DISTRIBUTION_CHROOT}" != "sid" ] - then - echo "deb ${LB_PARENT_MIRROR_CHROOT} ${LB_PARENT_DISTRIBUTION_CHROOT}-backports ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} - - if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ] - then - echo "deb-src ${LB_PARENT_MIRROR_CHROOT} ${LB_PARENT_DISTRIBUTION_CHROOT}-backports ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} - fi - fi - ;; - esac - - if [ "${LB_DERIVATIVE}" = "true" ] - then - echo "deb ${LB_MIRROR_CHROOT} ${_DISTRIBUTION}-backports ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list - - if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ] - then - echo "deb-src ${LB_MIRROR_CHROOT} ${_DISTRIBUTION}-backports ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list - fi - fi - fi + Create_apt_sources_list chroot # Adding local apt sources (chroot) for FILE in config/archives/*.list config/archives/*.list.chroot @@ -463,118 +342,7 @@ EOF mkdir -p chroot/var/lib/apt/lists/partial # Configure custom sources.list - -cat > chroot/etc/apt/${_PARENT_FILE} << EOF -deb ${LB_PARENT_MIRROR_BINARY} ${LB_PARENT_DISTRIBUTION_BINARY} ${LB_PARENT_ARCHIVE_AREAS} -EOF - - if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ] - then - echo "deb-src ${LB_PARENT_MIRROR_BINARY} ${LB_PARENT_DISTRIBUTION_BINARY} ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} - fi - - if [ "${LB_DERIVATIVE}" = "true" ] - then - rm -f chroot/etc/apt/sources.list.d/${LB_MODE}.list - - _DISTRIBUTION="$(echo ${LB_DISTRIBUTION_BINARY} | sed -e 's|-backports||')" - - echo "deb ${LB_MIRROR_BINARY} ${_DISTRIBUTION} ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list - - if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ] - then - echo "deb-src ${LB_MIRROR_BINARY} ${_DISTRIBUTION} ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list - fi - fi - - if [ "${LB_SECURITY}" = "true" ] - then - case "${LB_MODE}" in - debian|progress-linux) - case "${LB_PARENT_DISTRIBUTION_BINARY}" in - sid) - - ;; - - *) - echo "deb ${LB_PARENT_MIRROR_BINARY_SECURITY} ${LB_PARENT_DISTRIBUTION_BINARY}/updates ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} - - if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ] - then - echo "deb-src ${LB_PARENT_MIRROR_BINARY_SECURITY} ${LB_PARENT_DISTRIBUTION_BINARY}/updates ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} - fi - ;; - esac - - if [ "${LB_MODE}" = progress-linux ] - then - echo "deb ${LB_MIRROR_BINARY_SECURITY} ${_DISTRIBUTION}-security ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list - - if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ] - then - echo "deb-src ${LB_MIRROR_BINARY_SECURITY} ${_DISTRIBUTION}-security ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list - fi - else - if [ "${LB_DERIVATIVE}" = "true" ] - then - echo "deb ${LB_MIRROR_BINARY_SECURITY} ${_DISTRIBUTION}/updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list - - if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ] - then - echo "deb-src ${LB_MIRROR_BINARY_SECURITY} ${_DISTRIBUTION}/updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list - fi - fi - fi - ;; - esac - fi - - if [ "${LB_UPDATES}" = "true" ] - then - echo "deb ${LB_PARENT_MIRROR_BINARY} ${LB_PARENT_DISTRIBUTION_BINARY}-updates ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} - - if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ] - then - echo "deb-src ${LB_PARENT_MIRROR_BINARY} ${LB_PARENT_DISTRIBUTION_BINARY}-updates ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} - fi - - if [ "${LB_DERIVATIVE}" = "true" ] - then - echo "deb ${LB_MIRROR_BINARY} ${_DISTRIBUTION}-updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list - - if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ] - then - echo "deb-src ${LB_MIRROR_BINARY} ${_DISTRIBUTION}-updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list - fi - fi - fi - - if [ "${LB_BACKPORTS}" = "true" ] - then - case "${LB_MODE}" in - debian) - if [ "${LB_PARENT_DISTRIBUTION_BINARY}" != "sid" ] - then - echo "deb ${LB_PARENT_MIRROR_BINARY} ${LB_PARENT_DISTRIBUTION_BINARY}-backports ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} - - if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ] - then - echo "deb-src ${LB_PARENT_MIRROR_BINARY} ${LB_PARENT_DISTRIBUTION_BINARY}-backports ${LB_PARENT_ARCHIVE_AREAS}" >> chroot/etc/apt/${_PARENT_FILE} - fi - fi - ;; - esac - - if [ "${LB_DERIVATIVE}" = "true" ] - then - echo "deb ${LB_MIRROR_BINARY} ${_DISTRIBUTION}-backports ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list - - if [ "${_PASS}" = "source" ] || [ "${LB_APT_SOURCE_ARCHIVES}" = "true" ] - then - echo "deb-src ${LB_MIRROR_BINARY} ${_DISTRIBUTION}-backports ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list - fi - fi - fi + Create_apt_sources_list binary # Removing chroot-only apt sources for FILE in config/archives/*.list.chroot |