[PATCH] Don't download packages for on-disk archive that are already installed into the chroot
Please accept this patch which updates the binary_local-packageslists helper to not download and install packages into the on-disk archive if they're already installed in the chroot (aka livefs). This is accomplished by using a copy of chroot/var/lib/dpkg/status instead of temporarily using a new, blank chroot/var/lib/dpkg/status.
The rationale for this change is that specifying a single package to be installed into the on-disk archive
can result in hundreds of megabytes of packages being downloaded and
put in the image. This is because binary_local-packageslists uses apt to
fetch the packages and since currently a blank
chroot/var/lib/dpkg/status is used, apt will download all sorts of packages
to meet package dependencies. With the common use case for including packages in the on-disk archive being able to install packages after installation or during a live session without having to access a remote debian archive, including tons of packages that won't even get touched is a huge waste of time and dramatically inflates the size of the image.
Thus, the main benefits of this change is that images taking advantage of this feature will be substantially smaller and won't take as long to build.
Cody A.W. Somerville
Custom Engineering Solutions Group
Canonical OEM Services
Phone: +1 781 850 2087
Cell: +1 613 401 5141
Fax: +1 613 687 7368
=== modified file 'helpers/binary_local-packageslists'
--- helpers/binary_local-packageslists 2010-03-04 12:43:09 +0000
+++ helpers/binary_local-packageslists 2010-05-20 02:56:51 +0000
@@ -49,8 +49,7 @@
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
+ cp chroot/var/lib/dpkg/status chroot/var/lib/dpkg/status.real
for PACKAGESLIST in config/binary_local-packageslists/*
@@ -97,7 +96,7 @@
rm -rf chroot/binary.deb
- mv chroot/var/lib/dpkg/status.tmp chroot/var/lib/dpkg/status
+ mv chroot/var/lib/dpkg/status.real chroot/var/lib/dpkg/status
# Removing depends