diff options
author | Lyndon Brown <jnqnfe@gmail.com> | 2020-02-25 02:33:50 +0000 |
---|---|---|
committer | Raphaƫl Hertzog <hertzog@debian.org> | 2020-03-09 10:54:23 +0000 |
commit | e5d006cbc080f25fdaaf1345b00cc226ede53cf2 (patch) | |
tree | 17836952e0a0bba0aa7957774a3dfce35a4ff1b8 /functions/sourcelist.sh | |
parent | 7ee59d408ed7681908966a5b2fb28e8f98116d31 (diff) | |
download | vyos-live-build-e5d006cbc080f25fdaaf1345b00cc226ede53cf2.tar.gz vyos-live-build-e5d006cbc080f25fdaaf1345b00cc226ede53cf2.zip |
archives: tidy deb-src exclusion
instead of conditionally writing deb-src lines, it is **much** neater if
we use sed to optionally removed them at the end.
Gbp-Dch: Short
Closes: #952928
Diffstat (limited to 'functions/sourcelist.sh')
-rwxr-xr-x | functions/sourcelist.sh | 56 |
1 files changed, 16 insertions, 40 deletions
diff --git a/functions/sourcelist.sh b/functions/sourcelist.sh index 69d157033..b11f00373 100755 --- a/functions/sourcelist.sh +++ b/functions/sourcelist.sh @@ -40,11 +40,6 @@ Create_apt_sources_list () ;; 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) @@ -69,17 +64,11 @@ Create_apt_sources_list () # 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 + echo "deb-src ${PARENT_MIRROR} ${PARENT_DISTRIBUTION} ${LB_PARENT_ARCHIVE_AREAS}" >> "${PARENT_LIST_FILE}" 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 + echo "deb-src ${MIRROR} ${_DISTRIBUTION} ${LB_ARCHIVE_AREAS}" >> "${LIST_FILE}" fi # Set security repo @@ -93,26 +82,17 @@ Create_apt_sources_list () *) 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 + echo "deb-src ${PARENT_MIRROR_SECURITY} ${PARENT_DISTRIBUTION}/updates ${LB_PARENT_ARCHIVE_AREAS}" >> "${PARENT_LIST_FILE}" ;; 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 + echo "deb-src ${MIRROR_SECURITY} ${_DISTRIBUTION}-security ${LB_ARCHIVE_AREAS}" >> "${LIST_FILE}" 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 + echo "deb-src ${MIRROR_SECURITY} ${_DISTRIBUTION}/updates ${LB_ARCHIVE_AREAS}" >> "${LIST_FILE}" fi fi ;; @@ -122,17 +102,11 @@ Create_apt_sources_list () # 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 + echo "deb-src ${PARENT_MIRROR} ${PARENT_DISTRIBUTION}-updates ${LB_PARENT_ARCHIVE_AREAS}" >> "${PARENT_LIST_FILE}" 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 + echo "deb-src ${MIRROR} ${_DISTRIBUTION}-updates ${LB_ARCHIVE_AREAS}" >> "${LIST_FILE}" fi fi @@ -142,20 +116,22 @@ Create_apt_sources_list () 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 + echo "deb-src ${PARENT_MIRROR} ${PARENT_DISTRIBUTION}-backports ${LB_PARENT_ARCHIVE_AREAS}" >> "${PARENT_LIST_FILE}" fi ;; esac if [ "${LB_DERIVATIVE}" = "true" ]; then echo "deb ${MIRROR} ${_DISTRIBUTION}-backports ${LB_ARCHIVE_AREAS}" >> "${LIST_FILE}" + echo "deb-src ${MIRROR} ${_DISTRIBUTION}-backports ${LB_ARCHIVE_AREAS}" >> "${LIST_FILE}" + fi + fi - if $ADD_SOURCES; then - echo "deb-src ${MIRROR} ${_DISTRIBUTION}-backports ${LB_ARCHIVE_AREAS}" >> "${LIST_FILE}" - fi + # Disable deb-src entries? + if [ "${_PASS}" != "source" ] && [ "${LB_APT_SOURCE_ARCHIVES}" != "true" ]; then + sed -i "/^deb-src /d" "${PARENT_LIST_FILE}" + if [ "${LB_DERIVATIVE}" = "true" ]; then + sed -i "/^deb-src /d" "${LIST_FILE}" fi fi } |