From 3c48eb2a5abc3de504f9a5f96a959a06afbf1100 Mon Sep 17 00:00:00 2001
From: Daniel Baumann <daniel@debian.org>
Date: Wed, 3 Sep 2008 21:56:56 +0200
Subject: Fixing a chicken-egg problem with package indices when using
 minimal/stripped list *and* including local-packages.

---
 helpers/lh_chroot_sources | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/helpers/lh_chroot_sources b/helpers/lh_chroot_sources
index 24fe495..f7c4238 100755
--- a/helpers/lh_chroot_sources
+++ b/helpers/lh_chroot_sources
@@ -103,6 +103,15 @@ case "${1}" in
 
 			if Find_files chroot/root/local-packages/*.deb
 			then
+				# If we bootstrapped a minimal chroot, we need
+				# to install apt-utils before we have have
+				# completed all the indices.
+				case "${LH_PACKAGES_LISTS}" in
+					stripped|minimal)
+						Chroot "apt-get update"
+						;;
+				esac
+
 				# Restoring cache
 				Restore_cache cache/packages_chroot
 
-- 
cgit v1.0