diff --git a/scripts/build/chroot_firmware b/scripts/build/chroot_firmware index 4a65d552a..7fdd7605d 100755 --- a/scripts/build/chroot_firmware +++ b/scripts/build/chroot_firmware @@ -79,9 +79,25 @@ Firmware_List_From_Contents "${LB_PARENT_MIRROR_CHROOT}" "${LB_PARENT_DISTRIBUTI if [ "${LB_DERIVATIVE}" = "true" ] then - # FIXME: account for the fact that PARENT_DISTRIBUTION and DISTRIBUTION might be the same (to not have overlapping cache files for contents). + # Avoid downloading things twice if distributions are identical + DERIVATIVE_ARCHIVE_AREAS="" + if [ "${LB_DISTRIBUTION_CHROOT}" != "${LB_PARENT_DISTRIBUTION_CHROOT}" ] + then + DERIVATIVE_ARCHIVE_AREAS="${LB_ARCHIVE_AREAS}" + else + for _ARCHIVE_AREA in ${LB_ARCHIVE_AREAS} + do + if ! In_list ${_ARCHIVE_AREA} "${LB_PARENT_ARCHIVE_AREAS}" + then + DERIVATIVE_ARCHIVE_AREAS="${DERIVATIVE_ARCHIVE_AREAS} ${_ARCHIVE_AREA}" + fi + done + fi - Firmware_List_From_Contents "${LB_MIRROR_CHROOT}" "${LB_DISTRIBUTION_CHROOT}" "${LB_ARCHIVE_AREAS}" + if [ ! -z "${DERIVATIVE_ARCHIVE_AREAS}" ] + then + Firmware_List_From_Contents "${LB_MIRROR_CHROOT}" "${LB_DISTRIBUTION_CHROOT}" "${DERIVATIVE_ARCHIVE_AREAS}" + fi fi # Drop section and keep package names only diff --git a/scripts/build/installer_debian-installer b/scripts/build/installer_debian-installer index 67573f2e6..64375e85c 100755 --- a/scripts/build/installer_debian-installer +++ b/scripts/build/installer_debian-installer @@ -367,9 +367,25 @@ then if [ "${LB_DERIVATIVE}" = "true" ] then - # FIXME: account for the fact that PARENT_DISTRIBUTION and DISTRIBUTION might be the same (to not have overlapping cache files for contents). + # Avoid downloading things twice if distributions are identical + DERIVATIVE_ARCHIVE_AREAS="" + if [ "${LB_DISTRIBUTION_CHROOT}" != "${LB_PARENT_DISTRIBUTION_CHROOT}" ] + then + DERIVATIVE_ARCHIVE_AREAS="${LB_ARCHIVE_AREAS}" + else + for _ARCHIVE_AREA in ${LB_ARCHIVE_AREAS} + do + if ! In_list ${_ARCHIVE_AREA} "${LB_PARENT_ARCHIVE_AREAS}" + then + DERIVATIVE_ARCHIVE_AREAS="${DERIVATIVE_ARCHIVE_AREAS} ${DERIVATIVE_ARCHIVE_AREAS}" + fi + done + fi - Firmware_List_From_Contents "${LB_MIRROR_CHROOT}" "${LB_DISTRIBUTION_CHROOT}" "${LB_ARCHIVE_AREAS}" + if [ ! -z "${DERIVATIVE_ARCHIVE_AREAS}" ] + then + Firmware_List_From_Contents "${LB_MIRROR_CHROOT}" "${LB_DISTRIBUTION_CHROOT}" "${DERIVATIVE_ARCHIVE_AREAS}" + fi fi # Drop section and keep package names only