diff options
Diffstat (limited to 'scripts/build/source_debian')
-rwxr-xr-x | scripts/build/source_debian | 48 |
1 files changed, 30 insertions, 18 deletions
diff --git a/scripts/build/source_debian b/scripts/build/source_debian index ee0984400..2ba647362 100755 --- a/scripts/build/source_debian +++ b/scripts/build/source_debian @@ -131,19 +131,9 @@ case "${LB_MODE}" in ;; esac -MISSING="" -while read -r PACKAGE -do - if ! Chroot chroot "apt-get ${APT_OPTIONS} --download-only source ${PACKAGE}" - then - MISSING="${MISSING} ${PACKAGE}" - fi -done < source-selection.txt -rm -f source-selection.txt +mkdir -p chroot/source.pkgs -if [ -n "${MISSING}" ] -then - cat > source/missing-source.txt << EOF +cat > chroot/missing-source.txt << EOF This file contains the list of binary packages that are installed on the "live" system (to which this source disc is a companion) for which a corresponding source package is not included on this disc. This may be because the binary @@ -152,14 +142,34 @@ the source package available was not the same as that of the binary. EOF - for PACKAGE in ${MISSING} - do - Chroot chroot "dpkg -l ${PACKAGE}" | tail -n1 >> source/missing-source.txt - done +cat > chroot/source-download.sh << EOF +#!/bin/sh +cd source.pkgs +PACKAGE="\${1}" +if ! apt-get ${APT_OPTIONS} --download-only source \${PACKAGE} +then + dpkg -l \${PACKAGE} | tail -n1 >> ../missing-source.txt + touch ../missing-source-some +fi +EOF + +while read -r PACKAGE +do + Chroot chroot "sh source-download.sh ${PACKAGE}" || true +done < source-selection.txt +rm -f source-selection.txt +rm -f chroot/source-download.sh + +if [ -e chroot/missing-source-some ] +then + mv chroot/missing-source.txt source/missing-source.txt + rm -f chroot/missing-source-some +else + rm -f chroot/missing-source.txt fi # Sort sources -for DSC in chroot/*.dsc +for DSC in chroot/source.pkgs/*.dsc do SOURCE="$(sed -n 's|^Source: ||p' ${DSC} 2>/dev/null || :)" # The sed may fail if multiple dsc files exist for same source, as the @@ -180,9 +190,11 @@ do mkdir -p source/debian/"${LETTER}"/"${SOURCE}" # Move files - mv chroot/"${SOURCE}"_* source/debian/"${LETTER}"/"${SOURCE}" + mv chroot/source.pkgs/"${SOURCE}"_* source/debian/"${LETTER}"/"${SOURCE}" done +rmdir --ignore-fail-on-non-empty chroot/source.pkgs + # Reverting apt sources again if [ -e chroot/etc/apt/sources.list.d/progress-linux.list.orig ] then |