Split the binary and source mirror defaults

(This was orignally reveiwed in the wrong place:
http://codereview.appspot.com/193057/show)

Many local mirrors (such as mine) only contain mirrors
of the binary packages, sufficient to create a debootstrap
chroot. Source packages, the sum of which, can be quite large and
are not typically mirrored locally. This patch allows one
to create a chroot with overrides to the desired mirrors, e.g.,

./make_chroot.sh --replace --mirror http://mirror.rtg.net/ubuntu

In this example all of the binaries come from my local mirror, all source
packages come from $DEFAULT_DEV_MIRROR.

./make_chroot.sh --replace --mirror_src http://archive.ubuntu.com/ubuntu

Here the source packages are pulled from the Ubuntu archive whereas the
binaries come from $DEFAULT_DEV_MIRROR.

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>

Review URL: http://codereview.chromium.org/545169
This commit is contained in:
Tim Gardner 2010-01-22 09:46:32 -07:00
parent 45319e9ad0
commit 1bd60cdedf

View File

@ -29,6 +29,8 @@ DEFINE_string suite "$DEFAULT_DEV_SUITE" \
"Ubuntu suite to use to create the development chroot."
DEFINE_string mirror "$DEFAULT_DEV_MIRROR" \
"Ubuntu mirror to use to create the development chroot."
DEFINE_string mirror_src "$DEFAULT_DEV_MIRROR" \
"Ubuntu mirror to use to apt-get package sources."
DEFINE_string chroot "$DEFAULT_CHROOT_DIR" \
"Destination dir for the chroot environment."
DEFINE_string pkglist "$DEFAULT_PKGLIST" \
@ -141,7 +143,7 @@ bash_chroot "echo deb $FLAGS_mirror $FLAGS_suite \
# Enable sources for upstream packages. Currently, kernel source is checked in
# and all other sources are pulled via DEPS files.
bash_chroot "echo deb-src $FLAGS_mirror $FLAGS_suite \
bash_chroot "echo deb-src $FLAGS_mirror_src $FLAGS_suite \
main restricted multiverse universe >> /etc/apt/sources.list"
# Set /etc/debian_chroot so '(chroot)' shows up in shell prompts