diff --git a/functions/chroot.sh b/functions/chroot.sh index 0b54a3925..5d4108708 100755 --- a/functions/chroot.sh +++ b/functions/chroot.sh @@ -47,3 +47,9 @@ Chroot_has_package() { fi return 1 } + +Chroot_package_list() { + CHROOT="${1:-chroot}"; shift + + dpkg-query --admindir=${CHROOT}/var/lib/dpkg -W -f'${Package}\n' +} diff --git a/scripts/build/installer_debian-installer b/scripts/build/installer_debian-installer index ec931fa68..3a477a8f1 100755 --- a/scripts/build/installer_debian-installer +++ b/scripts/build/installer_debian-installer @@ -311,9 +311,6 @@ then # Downloading additional packages mkdir -p chroot/binary.deb/archives/partial - mv chroot/var/lib/dpkg/status chroot/var/lib/dpkg/status.tmp - touch chroot/var/lib/dpkg/status - case "${LB_ARCHITECTURES}" in amd64) DI_REQ_PACKAGES="lilo grub-pc" @@ -401,7 +398,7 @@ then fi # Set apt command prefix - _LB_APT_COMMAND="apt-get ${APT_OPTIONS} -o Dir::Cache=/binary.deb -o APT::Install-Recommends=false --download-only" + _LB_APT_COMMAND="apt-get ${APT_OPTIONS} -o Dir::Cache=/binary.deb -o Dir::State::status=/dev/null -o APT::Install-Recommends=false --download-only" if [ "${LB_DEBIAN_INSTALLER}" = "live" ] then @@ -417,7 +414,7 @@ then # Drop the packages already installed that d-i doesn't explicitely need _REMAINING_PACKAGES="$(echo ${DI_FIRMWARE_PACKAGES} ${DI_REQ_PACKAGES} | sed -e 's# #|#g')" - _REMAINING_PACKAGES="$(sed -n -e 's|Package: ||p' chroot/var/lib/dpkg/status.tmp | grep -E -v "^(${_REMAINING_PACKAGES})\$")" + _REMAINING_PACKAGES="$(Chroot_package_list chroot | grep -E -v "^(${_REMAINING_PACKAGES})\$")" for _PACKAGE in ${_REMAINING_PACKAGES} do @@ -428,9 +425,6 @@ then Chroot chroot ${_LB_APT_COMMAND} install ${DI_PACKAGES} ${DI_FIRMWARE_PACKAGES} fi - # Revert dpkg status file - mv chroot/var/lib/dpkg/status.tmp chroot/var/lib/dpkg/status - mv chroot/binary.deb ./ for _ARCHIVE_AREA in $(echo ${LB_PARENT_ARCHIVE_AREAS} ${LB_ARCHIVE_AREAS})