changeset 1275:a4cb2ed0a551

Move sources/native-builds to sources/control-images, so the naming is consistent.
author Rob Landley <rob@landley.net>
date Sun, 07 Nov 2010 15:55:26 -0600
parents b41dbea3ba14
children a3abaabac98e
files sources/control-images/bootstrap-skeleton/control-image-wrapper.sh sources/control-images/bootstrap-skeleton/files/build-one-package.sh sources/control-images/bootstrap-skeleton/files/functions.sh sources/control-images/bootstrap-skeleton/files/init sources/control-images/bootstrap-skeleton/files/run-build-stages.sh sources/control-images/busybox-test.sh sources/control-images/gentoo-bootstrap/README sources/control-images/gentoo-bootstrap/download.sh sources/control-images/gentoo-bootstrap/make-control-image.sh sources/control-images/gentoo-bootstrap/mnt/build/bash.sh sources/control-images/gentoo-bootstrap/mnt/build/file.sh sources/control-images/gentoo-bootstrap/mnt/build/ncurses.sh sources/control-images/gentoo-bootstrap/mnt/build/patch.sh sources/control-images/gentoo-bootstrap/mnt/build/portage.sh sources/control-images/gentoo-bootstrap/mnt/build/python.sh sources/control-images/gentoo-bootstrap/mnt/build/rsync.sh sources/control-images/gentoo-bootstrap/mnt/build/zlib.sh sources/control-images/gentoo-bootstrap/mnt/files/emerge_wrapper.sh sources/control-images/gentoo-bootstrap/mnt/files/etc/portage/profile/package.provided sources/control-images/gentoo-bootstrap/mnt/package-list sources/control-images/gentoo-bootstrap/patches/portage-2.1.8.3.patch sources/control-images/hello-world.sh sources/control-images/lfs-bootstrap/download.sh sources/control-images/lfs-bootstrap/make-control-image.sh sources/control-images/lfs-bootstrap/mnt/build/bash.sh sources/control-images/lfs-bootstrap/mnt/build/bison.sh sources/control-images/lfs-bootstrap/mnt/build/coreutils.sh sources/control-images/lfs-bootstrap/mnt/build/e2fsprogs.sh sources/control-images/lfs-bootstrap/mnt/build/gdbm.sh sources/control-images/lfs-bootstrap/mnt/build/gmp.sh sources/control-images/lfs-bootstrap/mnt/build/grep.sh sources/control-images/lfs-bootstrap/mnt/build/iana-etc.sh sources/control-images/lfs-bootstrap/mnt/build/inetutils.sh sources/control-images/lfs-bootstrap/mnt/build/libtool.sh sources/control-images/lfs-bootstrap/mnt/build/m4.sh sources/control-images/lfs-bootstrap/mnt/build/mpc.sh sources/control-images/lfs-bootstrap/mnt/build/mpfr.sh sources/control-images/lfs-bootstrap/mnt/build/ncurses.sh sources/control-images/lfs-bootstrap/mnt/build/pkg-config.sh sources/control-images/lfs-bootstrap/mnt/build/procps.sh sources/control-images/lfs-bootstrap/mnt/build/readline.sh sources/control-images/lfs-bootstrap/mnt/build/sed.sh sources/control-images/lfs-bootstrap/mnt/build/setup.nosrc sources/control-images/lfs-bootstrap/mnt/build/util-linux-ng.sh sources/control-images/lfs-bootstrap/mnt/build/zlib.sh sources/control-images/lfs-bootstrap/mnt/package-list sources/control-images/static-tools-patches/strace-arm-eabi.patch sources/control-images/static-tools-patches/strace-fixnet.patch sources/control-images/static-tools.sh sources/native-builds/bootstrap-skeleton/control-image-wrapper.sh sources/native-builds/bootstrap-skeleton/files/build-one-package.sh sources/native-builds/bootstrap-skeleton/files/functions.sh sources/native-builds/bootstrap-skeleton/files/init sources/native-builds/bootstrap-skeleton/files/run-build-stages.sh sources/native-builds/busybox-test.sh sources/native-builds/gentoo-bootstrap/README sources/native-builds/gentoo-bootstrap/download.sh sources/native-builds/gentoo-bootstrap/make-control-image.sh sources/native-builds/gentoo-bootstrap/mnt/build/bash.sh sources/native-builds/gentoo-bootstrap/mnt/build/file.sh sources/native-builds/gentoo-bootstrap/mnt/build/ncurses.sh sources/native-builds/gentoo-bootstrap/mnt/build/patch.sh sources/native-builds/gentoo-bootstrap/mnt/build/portage.sh sources/native-builds/gentoo-bootstrap/mnt/build/python.sh sources/native-builds/gentoo-bootstrap/mnt/build/rsync.sh sources/native-builds/gentoo-bootstrap/mnt/build/zlib.sh sources/native-builds/gentoo-bootstrap/mnt/files/emerge_wrapper.sh sources/native-builds/gentoo-bootstrap/mnt/files/etc/portage/profile/package.provided sources/native-builds/gentoo-bootstrap/mnt/package-list sources/native-builds/gentoo-bootstrap/patches/portage-2.1.8.3.patch sources/native-builds/hello-world.sh sources/native-builds/lfs-bootstrap/download.sh sources/native-builds/lfs-bootstrap/make-control-image.sh sources/native-builds/lfs-bootstrap/mnt/build/bash.sh sources/native-builds/lfs-bootstrap/mnt/build/bison.sh sources/native-builds/lfs-bootstrap/mnt/build/coreutils.sh sources/native-builds/lfs-bootstrap/mnt/build/e2fsprogs.sh sources/native-builds/lfs-bootstrap/mnt/build/gdbm.sh sources/native-builds/lfs-bootstrap/mnt/build/gmp.sh sources/native-builds/lfs-bootstrap/mnt/build/grep.sh sources/native-builds/lfs-bootstrap/mnt/build/iana-etc.sh sources/native-builds/lfs-bootstrap/mnt/build/inetutils.sh sources/native-builds/lfs-bootstrap/mnt/build/libtool.sh sources/native-builds/lfs-bootstrap/mnt/build/m4.sh sources/native-builds/lfs-bootstrap/mnt/build/mpc.sh sources/native-builds/lfs-bootstrap/mnt/build/mpfr.sh sources/native-builds/lfs-bootstrap/mnt/build/ncurses.sh sources/native-builds/lfs-bootstrap/mnt/build/pkg-config.sh sources/native-builds/lfs-bootstrap/mnt/build/procps.sh sources/native-builds/lfs-bootstrap/mnt/build/readline.sh sources/native-builds/lfs-bootstrap/mnt/build/sed.sh sources/native-builds/lfs-bootstrap/mnt/build/setup.nosrc sources/native-builds/lfs-bootstrap/mnt/build/util-linux-ng.sh sources/native-builds/lfs-bootstrap/mnt/build/zlib.sh sources/native-builds/lfs-bootstrap/mnt/package-list sources/native-builds/static-tools-patches/strace-arm-eabi.patch sources/native-builds/static-tools-patches/strace-fixnet.patch sources/native-builds/static-tools.sh
diffstat 98 files changed, 2179 insertions(+), 2179 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/bootstrap-skeleton/control-image-wrapper.sh	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,57 @@
+#!/bin/bash
+
+# Control image generator infrastructure.
+
+source sources/include.sh || exit 1
+
+# Did caller specify the name of a control image to generate?  Explicit
+# /dev/null means none.
+
+[ $# -ne 1 ] && echo "usage: $0 FILENAME" >&2 && exit 1
+[ "$1" != "/dev/null" ] && [ -e "$1" ] && echo "$1" exists && exit 0
+
+# Find path to our working directory.
+
+MYDIR="$(readlink -f "$(dirname "$(which "$0")")")"
+IMAGENAME="${MYDIR/*\//}"
+
+# Use our own directories for downloaded source tarballs and patches.
+# (We may have the same packages as the aboriginal build, but use different
+# versions, and we don't want our cleanup_oldfiles to overlap.)
+
+PATCHDIR="$MYDIR/patches"
+SRCDIR="$SRCDIR/control-images/$IMAGENAME" && mkdir -p "$SRCDIR" || dienow
+
+# Include package cache in the control image, so the target system image can
+# build from this source.
+
+WORK="$BUILD/control-images/$IMAGENAME" &&
+blank_tempdir "$WORK" &&
+SRCTREE="$WORK/packages" &&
+mkdir "$SRCTREE" &&
+
+# Copy common infrastructure to target
+
+cp "$MYDIR"/../bootstrap-skeleton/files/* "$WORK" || exit 1
+if [ -e "$MYDIR/mnt" ]
+then
+  cp -a "$MYDIR/mnt/." "$WORK" || exit 1
+fi
+
+# Populate packages directory
+
+echo "=== $IMAGENAME: Download/extract source code"
+
+EXTRACT_ALL=1
+
+source "$MYDIR"/download.sh || exit 1
+
+cleanup_oldfiles
+
+# Create sqaushfs image
+
+if [ "$1" != "/dev/null" ]
+then
+  cd "$TOP" &&
+  mksquashfs "$WORK" "$1" -noappend -all-root || dienow
+fi
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/bootstrap-skeleton/files/build-one-package.sh	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,67 @@
+#!/bin/sh
+
+source /mnt/functions.sh || exit 1
+
+# build $1 using manifest file $2
+
+# Is it already installed?
+
+if [ ! -z "$2" ] && [ -z "$FORCE" ] && grep -q "$1" "$2"
+then
+  echo "$1 already installed"
+  exit 0
+fi
+
+set_titlebar "$1"
+
+if [ -d "/mnt/packages/$1" ]
+then
+
+  # Snapshot source
+
+  cd /home &&
+  rm -rf "/home/$1" &&
+  cp -sfR "/mnt/packages/$1" "$1" &&
+  cd "$1" || exit 1
+
+  # Lobotomize config.guess so it won't complain about unknown target types.
+  # 99% of packages do not care, but autoconf throws a temper tantrum if
+  # the version of autoconf that created this back when the package shipped
+  # didn't know what a microblaze or hexagon was.  Repeat after me:
+  #   "Autoconf is useless"
+
+  for guess in $(find . -name config.guess)
+  do
+    rm "$guess" &&
+    echo -e "#!/bin/sh\ngcc -dumpmachine" > "$guess" || exit 1
+  done
+  EXT=sh
+else
+  EXT=nosrc
+fi
+
+# Call package build script
+
+if ! time "/mnt/build/${1}.$EXT"
+then
+  echo "$1" died >&2
+  exit 1
+fi
+
+# Add file to manifest, removing previous version (if any).
+
+if [ ! -z "$2" ]
+then
+  sed -i -e "/$1/d" "$2" &&
+  echo "$1" >> "$2" || exit 1
+fi
+
+if [ -d "/mnt/packages/$1" ]
+then
+
+  # Delete copy of source if build succeeded
+
+  cd /home &&
+  rm -rf "$1" &&
+  sync || exit 1
+fi
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/bootstrap-skeleton/files/functions.sh	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,40 @@
+#!/bin/echo This file is sourced not run
+
+upload_result()
+{
+  ftpput $FTP_SERVER -P $FTP_PORT "$1-$HOST" "$1"
+}
+
+set_titlebar()
+{
+  echo -en "\033]2;($HOST) $1\007"
+  echo === "$1"
+}
+
+dotprogress()
+{
+  while read i; do echo -n .; done; echo
+}
+
+do_in_chroot()
+{
+  # Copy root filesystem into a new chroot directory and restart in there.
+
+  CHROOT="$1"
+  shift
+
+  set_titlebar "Setup chroot"
+  mkdir "$CHROOT"
+  cp -a /mnt/files/. "$CHROOT"
+  find / -xdev | cpio -m -v -p "$CHROOT" | dotprogress
+  for i in mnt proc sys dev; do mount --bind /$i "$CHROOT"/$i; done
+
+  echo Chroot
+  chroot "$CHROOT" "$@"
+  RC=$?
+
+  echo Chroot cleanup
+  for i in mnt proc sys dev; do umount "$CHROOT"/$i; done
+
+  return $RC
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/bootstrap-skeleton/files/init	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+# Start running here, and hand off to run-build-stages.sh in chroot.
+
+. /mnt/functions.sh
+
+[ -z "$NATIVE_BUILD" ] && NATIVE_BUILD=chroot
+
+# Always chroot, because even if root filesystem is writeable it's hard to
+# tell tar to skip /proc and /sys and such without unmounting bits of the
+# host environment.
+
+do_in_chroot /home/"$NATIVE_BUILD" /mnt/run-build-stages.sh
+
+if [ $? -eq 0 ]
+then
+  set_titlebar "upload tarball"
+  tar czvf "$NATIVE_BUILD".tar.gz "$NATIVE_BUILD" | dotprogress &&
+  upload_result "$NATIVE_BUILD".tar.gz
+fi
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/bootstrap-skeleton/files/run-build-stages.sh	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# Run each of the individual package build files, in order.
+
+[ -z "$FILTER" ] || FILTER="/$FILTER/d"
+for i in $(sed -r -e "$FILTER" -e "s@#.*@@" /mnt/package-list)
+do
+  /mnt/build-one-package.sh "$i" || exit 1
+done
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/busybox-test.sh	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+# Run the busybox test suite.
+
+source sources/include.sh || exit 1
+
+[ $# -ne 1 ] && echo "usage: $0 FILENAME" >&2 && exit 1
+[ -e "$1" ] && echo "$1" exists && exit 0
+
+WORK="$BUILD/control-images/busybox-test" && blank_tempdir "$WORK"
+
+# Don't download busybox, it's got to already be there in standard sources.
+
+setupfor busybox
+cd "$TOP"
+
+cat > "$WORK"/init << 'EOF' || dienow
+#!/bin/bash
+
+echo === $HOST Run busybox test suite
+
+cp -sfR /mnt/busybox busybox && cd busybox &&
+make defconfig &&
+ln -s /bin/busybox busybox &&
+cd testsuite &&
+./runtest &&
+cd .. &&
+rm -rf busybox || exit 1
+
+sync
+
+EOF
+
+chmod +x "$WORK"/init || dienow
+
+mksquashfs "$WORK" "$1" -noappend -all-root
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/gentoo-bootstrap/README	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,16 @@
+Extend minimal native build environment into a seed for Gentoo Catalyst.
+
+This doesn't quite create an official Gentoo Stage 1.  We use busybox instead
+of gnu tools, we're uClibc-based instead of glibc-based, and we use our
+existing toolchain (with distcc acceleration) instead of asking portage
+to build one.  That said, this should be enough to run Catalyst and produce
+official Stage 1, Stage 2, and Stage 3 images.
+
+GFS used:
+
+  setup-base-packages.sh
+    strace, Python, ncurses, bash, tar, patch, findutils, file, pax-utils,
+    shadow
+  setup-portage.sh
+    /etc/passwd (root and portage), /etc/group (root and portage)
+    portage
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/gentoo-bootstrap/download.sh	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,34 @@
+# Download all the source tarballs we haven't got up-to-date copies of.
+
+URL=http://zlib.net/zlib-1.2.5.tar.bz2 \
+SHA1=543fa9abff0442edca308772d6cef85557677e02 \
+maybe_fork "download || dienow"
+
+URL=http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.7.tar.gz \
+SHA1=8233ee56ed84ae05421e4e6d6db6c1fe72ee6797 \
+maybe_fork "download || dienow"
+
+URL=http://python.org/ftp/python/2.6.5/Python-2.6.5.tar.bz2 \
+SHA1=24c94f5428a8c94c9d0b316e3019fee721fdb5d1 \
+RENAME='s/P/p/' \
+maybe_fork "download || dienow"
+
+URL=http://ftp.gnu.org/gnu/bash/bash-3.2.tar.gz \
+SHA1=fe6466c7ee98061e044dae0347ca5d1a8eab4a0d \
+maybe_fork "download || dienow"
+
+URL=http://www.samba.org/ftp/rsync/src/rsync-3.0.7.tar.gz \
+SHA1=63426a1bc71991d93159cd522521fbacdafb7a61 \
+maybe_fork "download || dienow"
+
+URL=http://ftp.gnu.org/gnu/patch/patch-2.5.9.tar.gz \
+SHA1=9a69f7191576549255f046487da420989d2834a6 \
+maybe_fork "download || dienow"
+
+URL=ftp://ftp.astron.com/pub/file/file-5.03.tar.gz \
+SHA1=f659a4e1fa96fbdc99c924ea8e2dc07319f046c1 \
+maybe_fork "download || dienow"
+
+URL=http://dev.gentoo.org/~zmedico/portage/archives/portage-2.1.8.tar.bz2 \
+SHA1=390c97f3783af2d9e52482747ead3681655ea9c3 \
+maybe_fork "download || dienow"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/gentoo-bootstrap/make-control-image.sh	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,1 @@
+../bootstrap-skeleton/control-image-wrapper.sh
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/gentoo-bootstrap/mnt/build/bash.sh	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+# Portage uses bash ~= regex matches, which were introduced in bash 3.
+
+./configure --enable-cond-regexp --disable-nls --prefix=/usr &&
+make -j $CPUS &&
+make install
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/gentoo-bootstrap/mnt/build/file.sh	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+./configure --prefix=/usr &&
+make -j $CPUS &&
+make install
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/gentoo-bootstrap/mnt/build/ncurses.sh	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+./configure --without-cxx-binding --with-shared &&
+make -j $CPUS &&
+make install
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/gentoo-bootstrap/mnt/build/patch.sh	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+# Need a patch with --dry-run to make portage happy
+
+./configure --prefix=/usr &&
+make -j $CPUS &&
+make install
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/gentoo-bootstrap/mnt/build/portage.sh	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+# Portage isn't really designed to be portable, so this script contains
+# the "make install" stage that portage really should have within itself.
+
+# Install portage user/group, and libraries.
+
+echo portage:x:250:250:portage:/var/tmp/portage:/bin/false >> /etc/passwd &&
+echo portage::250:portage >> /etc/group &&
+mkdir -p /usr/lib/portage &&
+cp -a bin pym /usr/lib/portage/ &&
+
+# Add portage python modules to the python search path.
+
+echo /usr/lib/portage/pym > /usr/lib/python2.6/site-packages/gentoo.pth ||
+  exit 1
+
+# Install portage binaries into bin and sbin
+
+for i in archive-conf dispatch-conf emaint emerge-webrsync env-update \
+         etc-update fixpackages quickpkg regenworld
+do
+  ln /usr/lib/portage/bin/$i /usr/sbin/$i || exit 1
+done
+
+for i in  ebuild egencache emerge portageq repoman
+do
+  ln /usr/lib/portage/bin/$i /usr/bin/$i || exit 1
+done
+
+# Install portage man pages
+
+cp cnf/make.globals /etc/ &&
+cp man/*.1 /usr/man/man1 &&
+cp man/*.5 /usr/man/man5 &&
+
+mkdir -p /var/log /etc/portage/profile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/gentoo-bootstrap/mnt/build/python.sh	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+./configure --prefix=/usr &&
+make -j $CPUS &&
+make install
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/gentoo-bootstrap/mnt/build/rsync.sh	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+./configure --prefix=/usr &&
+# Break link and touch file, otherwise ./configure tries to recreate it
+# which requires perl.
+cat proto.h-tstamp > proto.h.new &&
+mv -f proto.h.new proto.h-tstamp &&
+make -j $CPUS &&
+make install
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/gentoo-bootstrap/mnt/build/zlib.sh	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# 1.2.5 accidentally shipped the Makefile, then configure tries to
+# modify it in place, which fails if the filesystem is read only.
+# The fix is to remove it before configuring.
+
+rm Makefile && 
+./configure --prefix=/usr &&
+make -j $CPUS &&
+make install
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/gentoo-bootstrap/mnt/files/emerge_wrapper.sh	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+if [ "$1" != "--sync" ]
+then
+  echo 'No portage tree, run "emerge --sync".' >&2
+  exit 1
+fi
+
+if [ "$(id -u)" -ne 0 ]
+then
+  echo "You are not root." >&2
+  exit 1
+fi
+
+echo "Downloading portage tree..."
+mkdir -p /var/log /usr/portage &&
+cd /usr &&
+#wget http://127.0.0.1/aboriginal/mirror/portage-latest.tar.bz2 -O - | \
+wget http://gentoo.osuosl.org/snapshots/portage-latest.tar.bz2 -O - | \
+  tar xjC /usr
+if [ ! -d portage ]
+then
+  echo "Failed to download portage-latest tarball." >&2
+  exit 1
+fi
+
+if ! emerge.real --sync
+then
+  echo "Sync failed"
+  exit 1
+fi
+
+cd $(dirname $(readlink -f $(which emerge.real)))
+mv emerge.real emerge
+
+echo "Portage tree initialized"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/gentoo-bootstrap/mnt/files/etc/portage/profile/package.provided	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,43 @@
+# Base aboriginal system
+
+sys-devel/gcc-4.2.1
+sys-devel/binutils-2.17
+sys-devel/make-3.81
+sys-libs/uclibc-0.9.31
+sys-kernel/linux-headers-2.6.35
+sys-apps/busybox-1.17.2
+
+# Stuff busybox provides
+
+app-arch/gzip-1.0
+sys-apps/sed-1.0
+sys-apps/findutils-1.0
+sys-apps/diffutils-1.0
+app-editors/vim-1.0
+sys-apps/gawk-1.0
+app-arch/tar-1.0
+app-arch/bzip2-1.0
+app-arch/cpio-1.0
+sys-process/procps-1.0
+sys-apps/which-1.0
+sys-apps/net-tools-1.0
+sys-apps/sysvinit-1.0
+sys-apps/util-linux-1.0
+sys-apps/coreutils-1.0
+sys-apps/less-1.0
+sys-apps/grep-1.0      
+sys-apps/shadow-1.0    
+sys-apps/module-init-tools-1.0
+net-misc/wget-1.0
+app-arch/xz-utils-1.0
+
+# Upgrades for seed
+
+sys-apps/portage-2.1.8.3
+dev-lang/python-2.6.5
+sys-libs/zlib-1.2.5
+sys-libs/ncurses-5.7
+app-shells/bash-3.2
+net-misc/rsync-3.0.7
+sys-devel/patch-2.5.9
+sys-apps/file-5.03
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/gentoo-bootstrap/mnt/package-list	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,1 @@
+zlib ncurses python bash rsync patch file portage
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/gentoo-bootstrap/patches/portage-2.1.8.3.patch	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,1155 @@
+Index: ChangeLog
+===================================================================
+--- a/ChangeLog	(revision 15731)
++++ b/ChangeLog	(revision 15814)
+@@ -1,3 +1,178 @@
++2010-03-10 00:31  zmedico
++
++	* [r15814] pym/_emerge/depgraph.py: Only try to merge portage asap
++	  when the new version is different. (trunk r15813)
++
++2010-03-09 21:27  zmedico
++
++	* [r15812] pym/_emerge/Scheduler.py, pym/_emerge/depgraph.py: Only
++	  create implicit libc deps when the version changes. (trunk
++	  r15810)
++
++2010-03-09 21:25  zmedico
++
++	* [r15811] pym/_emerge/Scheduler.py, pym/_emerge/depgraph.py:
++	  Disable implicit libc deps for ROOT != "/" since it's probably
++	  not needed. (trunk r15809)
++
++2010-03-09 20:21  zmedico
++
++	* [r15808] pym/_emerge/depgraph.py: Merge libc asap for all roots
++	  instead of just ROOT="/". (trunk r15804)
++
++2010-03-09 20:21  zmedico
++
++	* [r15807] pym/_emerge/sync/old_tree_timestamp.py: Add periods.
++	  (trunk r15803)
++
++2010-03-09 20:20  zmedico
++
++	* [r15806] pym/_emerge/sync/old_tree_timestamp.py: Use ewarn output
++	  style to add some color. (trunk r15802)
++
++2010-03-09 20:20  zmedico
++
++	* [r15805] man/portage.5: * Remove outdated profiles.desc sentence
++	  about "1 profile allowed per stable/dev/KEYWORD". Thanks to
++	  Torsten Veller <tove@g.o> for reporting.
++	  
++	  * Add 'exp' to valid profiles.desc status values, and update the
++	  example. (trunk r15795)
++
++2010-03-09 08:11  zmedico
++
++	* [r15794] pym/portage/mail.py: Import 'email' and 'smtlib' locally
++	  since python ebuilds remove the 'email' module when built with
++	  USE=build. (trunk r15793)
++
++2010-03-09 05:04  zmedico
++
++	* [r15792] pym/_emerge/Scheduler.py: Add --debug output for the
++	  scheduler digraph. (trunk r15790)
++
++2010-03-09 05:04  zmedico
++
++	* [r15791] pym/_emerge/Scheduler.py: If _implicit_libc_deps() finds
++	  both a new-style virtual and an old-style PROVIDE virtual, use
++	  the new-style virtual. (trunk r15789)
++
++2010-03-09 04:31  zmedico
++
++	* [r15788] pym/_emerge/actions.py: Add support for displaying
++	  profile listed in make.profile/parent when make.profile is not a
++	  symlink. The first parent with a path inside $PORTDIR is
++	  displayed. (trunk r15787)
++
++2010-03-09 03:59  zmedico
++
++	* [r15786] pym/_emerge/Scheduler.py: Fix typo in parenthesis from
++	  previous commit. (trunk r15784)
++
++2010-03-09 03:58  zmedico
++
++	* [r15785] pym/_emerge/Scheduler.py: Bug #303567 - Create implicit
++	  dependencies on libc, in order to ensure that libc is installed
++	  as early as possible. (trunk r15783)
++
++2010-03-09 02:42  zmedico
++
++	* [r15782] pym/portage/dbapi/vartree.py,
++	  pym/portage/proxy/lazyimport.py: When portage upgrades or
++	  downgrades itself, preload lazily referenced portage submodules
++	  into memory so that imports won't fail later. (trunk r15778)
++
++2010-03-09 02:42  zmedico
++
++	* [r15781] man/emerge.1, pym/_emerge/help.py: Move --update from
++	  the actions to the options section. (trunk r15777)
++
++2010-03-09 02:42  zmedico
++
++	* [r15780] man/emerge.1, pym/_emerge/help.py: Clean up/sync docs
++	  for emerge --sync, and add a note about PORTAGE_SYNC_STALE.
++	  (trunk r15776)
++
++2010-03-09 02:42  zmedico
++
++	* [r15779] man/emerge.1: Escape hyphens. (trunk r15775)
++
++2010-03-08 09:40  zmedico
++
++	* [r15772] pym/_emerge/sync/__init__.py: Add copyright header.
++	  (trunk r15771)
++
++2010-03-08 09:10  zmedico
++
++	* [r15770] pym/_emerge/actions.py: Disable PORTAGE_SYNC_STALE
++	  warnings when --usepkgonly is enabled. (trunk r15769)
++
++2010-03-08 09:05  zmedico
++
++	* [r15768] pym/portage/package/ebuild/config.py: Exclude
++	  PORTAGE_SYNC_STALE from the ebuild environment. (trunk r15767)
++
++2010-03-08 08:57  zmedico
++
++	* [r15766] pym/_emerge/depgraph.py: Bug #307409 - Force --verbose
++	  mode when displaying circular deps. (trunk r15765)
++
++2010-03-08 08:47  zmedico
++
++	* [r15764] pym/portage/mail.py: Bug #291331 - Force ascii encoding
++	  in send_mail() in order to avoid UnicodeEncodeError from
++	  smtplib.sendmail with python3. (trunk r15759)
++
++2010-03-08 08:47  zmedico
++
++	* [r15763] pym/_emerge/sync/old_tree_timestamp.py: Show --sync in
++	  messages, to help avoid confusion. (trunk r15758)
++
++2010-03-08 08:47  zmedico
++
++	* [r15762] man/make.conf.5: Note that PORTAGE_SYNC_STALE=0 will
++	  disable warnings. (trunk r15757)
++
++2010-03-08 08:47  zmedico
++
++	* [r15761] cnf/make.globals, man/make.conf.5,
++	  pym/_emerge/actions.py, pym/_emerge/sync: Produce a warning
++	  message if the timestamp of the portage tree is more than 30 days
++	  old, and make it adjustable via the PORTAGE_SYNC_STALE variable.
++	  Thanks to Ned Ludd <solar@g.o> for the most of this code. (trunk
++	  r15756)
++
++2010-03-08 08:46  zmedico
++
++	* [r15760] pym/portage/package/ebuild/doebuild.py: Bug #308415 -
++	  Fix broken uri parameter passed to fetch () for some cases when
++	  using ebuild(1). (trunk r15755)
++
++2010-03-04 11:23  zmedico
++
++	* [r15749] pym/portage/package/ebuild/getmaskingstatus.py: Bug
++	  #307723 - Define basestring for python3. (trunk r15745)
++
++2010-03-04 11:23  zmedico
++
++	* [r15748] pym/portage/package/ebuild/doebuild.py,
++	  pym/portage/package/ebuild/fetch.py: Fix imports
++	  doebuild_environment and prepare_build_dirs imports to import
++	  from the real location instead of importing proxies. (trunk
++	  r15744)
++
++2010-03-04 11:22  zmedico
++
++	* [r15747] pym/portage/package/ebuild/fetch.py: Bug #307707 - Fix
++	  fetch() to use the correct spawn function when calling nofetch.
++	  (trunk r15743)
++
++2010-03-04 11:22  zmedico
++
++	* [r15746] man/color.map.5, pym/_emerge/depgraph.py,
++	  pym/portage/output.py: Add new colors for binary packages in the
++	  merge list. Thanks to Sebastian Luther (few) for this patch.
++	  (trunk r15739)
++
+ 2010-03-03 06:27  zmedico
+ 
+ 	* [r15731] NEWS: Add news about splitting the top-level
+Index: cnf/make.globals
+===================================================================
+--- a/cnf/make.globals	(revision 15731)
++++ b/cnf/make.globals	(revision 15814)
+@@ -1,6 +1,6 @@
+ # Copyright 1999-2006 Gentoo Foundation
+ # Distributed under the terms of the GNU General Public License v2
+-# $Id: make.globals 15254 2010-01-29 18:49:10Z zmedico $
++# $Id: make.globals 15761 2010-03-08 08:47:02Z zmedico $
+ # System-wide defaults for the Portage system
+ 
+ #            *****************************
+@@ -80,6 +80,10 @@
+ 
+ PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
+ 
++# The number of days after the last `emerge --sync` that a warning
++# message should be produced.
++PORTAGE_SYNC_STALE="30"
++
+ # Minimal CONFIG_PROTECT
+ CONFIG_PROTECT="/etc"
+ CONFIG_PROTECT_MASK="/etc/env.d"
+Index: man/color.map.5
+===================================================================
+--- a/man/color.map.5	(revision 15731)
++++ b/man/color.map.5	(revision 15814)
+@@ -50,6 +50,15 @@
+ \fBPKG_MERGE_WORLD\fR = \fI"green"\fR
+ Defines color used for world packages planned to be merged.
+ .TP
++\fBPKG_BINARY_MERGE\fR = \fI"darkgreen"\fR
++Defines color used for packages planned to be merged using a binary package.
++.TP
++\fBPKG_BINARY_MERGE_SYSTEM\fR = \fI"darkgreen"\fR
++Defines color used for system packages planned to be merged using a binary package.
++.TP
++\fBPKG_BINARY_MERGE_WORLD\fR = \fI"green"\fR
++Defines color used for world packages planned to be merged using a binary package.
++.TP
+ \fBPKG_NOMERGE\fR = \fI"darkblue"\fR
+ Defines color used for packages not planned to be merged.
+ .TP
+Index: man/emerge.1
+===================================================================
+--- a/man/emerge.1	(revision 15731)
++++ b/man/emerge.1	(revision 15814)
+@@ -195,7 +195,7 @@
+ name starts with "kde"; \fBemerge \-\-search "%gcc$"\fR searches for any 
+ package that ends with "gcc"; \fBemerge \-\-search "office"\fR searches for 
+ any package that contains the word "office".  If you want to include the 
+-category into the search string, prepend an @: \fBemerge --search 
++category into the search string, prepend an @: \fBemerge \-\-search 
+ "%@^dev-java.*jdk"\fR. If you want to search the package descriptions as well, 
+ use the \fB\-\-searchdesc\fR action.
+ .TP
+@@ -205,11 +205,26 @@
+ matched as regular expressions.
+ .TP
+ .BR \-\-sync
+-Initiates a portage tree update with one of the rsync.gentoo.org
+-mirrors.  \fBNote that any changes you have made to the portage
+-tree will be erased\fR.  Except for special circumstances, 
+-this uses \fBrsync\fR to do the update.  See \fBmake.conf\fR(5)'s 
+-description of PORTDIR_OVERLAY for a method to avoid deletions.
++This updates the portage tree that is located in the
++directory that the PORTDIR variable refers to (default
++location is /usr/portage). The SYNC variable specifies
++the remote URI from which files will be synchronized.
++The \fBPORTAGE_SYNC_STALE\fR variable configures
++warnings that are shown when emerge \-\-sync has not
++been executed recently.
++
++\fBWARNING:\fR
++The emerge \-\-sync action will modify and/or delete
++files located inside the directory that the PORTDIR
++variable refers to (default location is /usr/portage).
++For more information, see the PORTDIR documentation in
++the make.conf(5) man page.
++
++\fBNOTE:\fR
++The \fBemerge\-webrsync\fR program will download the entire
++portage tree as a tarball, which is much faster than emerge
++\-\-sync for first time syncs.
++
+ .TP
+ .BR "\-\-unmerge " (\fB\-C\fR)
+ \fBWARNING: This action can remove important packages!\fR Removes
+@@ -219,13 +234,6 @@
+ \fIebuilds\fR. For a dependency aware version of \fB\-\-unmerge\fR,
+ use \fB\-\-depclean\fR or \fB\-\-prune\fR.
+ .TP
+-.BR "\-\-update " (\fB\-u\fR)
+-Updates packages to the best version available, which may not always be the 
+-highest version number due to masking for testing and development.
+-Package atoms
+-specified on the command line are greedy, meaning that unspecific atoms may
+-match multiple installed versions of slotted packages.
+-.TP
+ .BR "\-\-version " (\fB\-V\fR)
+ Displays the version number of \fBemerge\fR.
+ .SH "OPTIONS"
+@@ -536,6 +544,13 @@
+ constraint is removed, hopefully leading to a more
+ readable dependency tree.
+ .TP
++.BR "\-\-update " (\fB\-u\fR)
++Updates packages to the best version available, which may
++not always be the  highest version number due to masking
++for testing and development. Package atoms specified on
++the command line are greedy, meaning that unspecific
++atoms may match multiple versions of slotted packages.
++.TP
+ .BR "\-\-use\-ebuild\-visibility[=n]"
+ Use unbuilt ebuild metadata for visibility
+ checks on built packages.
+Index: man/make.conf.5
+===================================================================
+--- a/man/make.conf.5	(revision 15731)
++++ b/man/make.conf.5	(revision 15814)
+@@ -639,6 +639,12 @@
+ .br
+ Defaults to 3.
+ .TP
++\fBPORTAGE_SYNC_STALE\fR = \fI[NUMBER]\fR
++Defines the number of days after the last `emerge \-\-sync` that a warning
++message should be produced. A value of 0 will disable warnings.
++.br
++Defaults to 30.
++.TP
+ \fBPORTAGE_TMPDIR\fR = \fI[path]\fR
+ Defines the location of the temporary build directories.
+ .br
+Index: man/portage.5
+===================================================================
+--- a/man/portage.5	(revision 15731)
++++ b/man/portage.5	(revision 15814)
+@@ -751,23 +751,22 @@
+ .TP
+ .BR profiles.desc
+ List all the current stable and development profiles.  If a profile is listed 
+-here, then it will be checked by repoman.  At the moment, only 1 profile is 
+-allowed per stable/dev/KEYWORD; the last one found is the last one used.
+-
++here, then it will be checked by repoman.
+ .I Format:
+ .nf
+ \- comments begin with # (no inline comments)
+ \- one profile list per line in format: arch dir status
+ \- arch must be listed in arch.list
+ \- dir is relative to profiles.desc
+-\- status must be 'stable' or 'dev'
++\- status must be 'stable', 'dev', or 'exp'
+ .fi
+ 
+ .I Example:
+ .nf
+-alpha default-linux/alpha/2004.3 stable
+-m68k  default-linux/m68k         dev
+-x86   default-linux/x86/2004.3   stable
++alpha        default/linux/alpha/10.0    stable
++m68k         default/linux/m68k/10.0     dev
++x86          default/linux/x86/10.0      stable
++x86-linux    prefix/linux/x86            exp
+ .fi
+ .TP
+ .BR repo_name
+Index: pym/_emerge/actions.py
+===================================================================
+--- a/pym/_emerge/actions.py	(revision 15731)
++++ b/pym/_emerge/actions.py	(revision 15814)
+@@ -1,6 +1,6 @@
+ # Copyright 1999-2009 Gentoo Foundation
+ # Distributed under the terms of the GNU General Public License v2
+-# $Id: actions.py 15687 2010-03-02 21:07:53Z zmedico $
++# $Id: actions.py 15788 2010-03-09 04:31:13Z zmedico $
+ 
+ from __future__ import print_function
+ 
+@@ -53,6 +53,7 @@
+ from _emerge.search import search
+ from _emerge.SetArg import SetArg
+ from _emerge.show_invalid_depstring_notice import show_invalid_depstring_notice
++from _emerge.sync.old_tree_timestamp import old_tree_timestamp_warn
+ from _emerge.unmerge import unmerge
+ from _emerge.UnmergeDepPriority import UnmergeDepPriority
+ from _emerge.UseFlagDisplay import UseFlagDisplay
+@@ -64,6 +65,9 @@
+ def action_build(settings, trees, mtimedb,
+ 	myopts, myaction, myfiles, spinner):
+ 
++	if '--usepkgonly' not in myopts:
++		old_tree_timestamp_warn(settings['PORTDIR'], settings)
++
+ 	# validate the state of the resume data
+ 	# so that we can make assumptions later.
+ 	for k in ("resume", "resume_backup"):
+@@ -2249,19 +2253,38 @@
+ 	writemsg_level("".join("%s\n" % l for l in msg),
+ 		level=logging.ERROR, noiselevel=-1)
+ 
++def relative_profile_path(portdir, abs_profile):
++	realpath = os.path.realpath(abs_profile)
++	basepath   = os.path.realpath(os.path.join(portdir, "profiles"))
++	if realpath.startswith(basepath):
++		profilever = realpath[1 + len(basepath):]
++	else:
++		profilever = None
++	return profilever
++
+ def getportageversion(portdir, target_root, profile, chost, vardb):
+-	profilever = "unavailable"
++	profilever = None
+ 	if profile:
+-		realpath = os.path.realpath(profile)
+-		basepath   = os.path.realpath(os.path.join(portdir, "profiles"))
+-		if realpath.startswith(basepath):
+-			profilever = realpath[1 + len(basepath):]
+-		else:
++		profilever = relative_profile_path(portdir, profile)
++		if profilever is None:
+ 			try:
+-				profilever = "!" + os.readlink(profile)
+-			except (OSError):
++				for parent in portage.grabfile(
++					os.path.join(profile, 'parent')):
++					profilever = relative_profile_path(portdir,
++						os.path.join(profile, parent))
++					if profilever is not None:
++						break
++			except portage.exception.PortageException:
+ 				pass
+-		del realpath, basepath
++
++			if profilever is None:
++				try:
++					profilever = "!" + os.readlink(profile)
++				except (OSError):
++					pass
++
++	if profilever is None:
++		profilever = "unavailable"
+ 
+ 	libcver=[]
+ 	libclist  = vardb.match("virtual/libc")
+Index: pym/_emerge/depgraph.py
+===================================================================
+--- a/pym/_emerge/depgraph.py	(revision 15731)
++++ b/pym/_emerge/depgraph.py	(revision 15814)
+@@ -1,6 +1,6 @@
+ # Copyright 1999-2009 Gentoo Foundation
+ # Distributed under the terms of the GNU General Public License v2
+-# $Id: depgraph.py 15711 2010-03-02 21:14:20Z zmedico $
++# $Id: depgraph.py 15814 2010-03-10 00:31:43Z zmedico $
+ 
+ from __future__ import print_function
+ 
+@@ -3341,7 +3341,9 @@
+ 		if replacement_portage == running_portage:
+ 			replacement_portage = None
+ 
+-		if replacement_portage is not None:
++		if replacement_portage is not None and \
++			(running_portage is None or \
++			(running_portage.cpv != replacement_portage.cpv)):
+ 			# update from running_portage to replacement_portage asap
+ 			asap_nodes.append(replacement_portage)
+ 
+@@ -3363,12 +3365,16 @@
+ 
+ 		# Merge libc asap, in order to account for implicit
+ 		# dependencies. See bug #303567.
+-		libc_pkg = self._dynamic_config.mydbapi[running_root].match_pkgs(
+-			portage.const.LIBC_PACKAGE_ATOM)
+-		if libc_pkg:
+-			libc_pkg = libc_pkg[0]
+-			if libc_pkg.operation == 'merge':
+-				asap_nodes.append(libc_pkg)
++		for root in (running_root,):
++			libc_pkg = self._dynamic_config.mydbapi[root].match_pkgs(
++				portage.const.LIBC_PACKAGE_ATOM)
++			if libc_pkg:
++				libc_pkg = libc_pkg[0]
++				if libc_pkg.operation == 'merge':
++					# Only add a dep when the version changes.
++					if not libc_pkg.root_config.trees[
++						'vartree'].dbapi.cpv_exists(libc_pkg.cpv):
++						asap_nodes.append(libc_pkg)
+ 
+ 		def gather_deps(ignore_priority, mergeable_nodes,
+ 			selected_nodes, node):
+@@ -3904,7 +3910,7 @@
+ 			tempgraph.remove(node)
+ 		display_order.reverse()
+ 		self._frozen_config.myopts.pop("--quiet", None)
+-		self._frozen_config.myopts.pop("--verbose", None)
++		self._frozen_config.myopts["--verbose"] = True
+ 		self._frozen_config.myopts["--tree"] = True
+ 		portage.writemsg("\n\n", noiselevel=-1)
+ 		self.display(display_order)
+@@ -4500,12 +4506,20 @@
+ 
+ 				def pkgprint(pkg_str):
+ 					if pkg_merge:
+-						if pkg_system:
+-							return colorize("PKG_MERGE_SYSTEM", pkg_str)
+-						elif pkg_world:
+-							return colorize("PKG_MERGE_WORLD", pkg_str)
++						if built:
++							if pkg_system:
++								return colorize("PKG_BINARY_MERGE_SYSTEM", pkg_str)
++							elif pkg_world:
++								return colorize("PKG_BINARY_MERGE_WORLD", pkg_str)
++							else:
++								return colorize("PKG_BINARY_MERGE", pkg_str)
+ 						else:
+-							return colorize("PKG_MERGE", pkg_str)
++							if pkg_system:
++								return colorize("PKG_MERGE_SYSTEM", pkg_str)
++							elif pkg_world:
++								return colorize("PKG_MERGE_WORLD", pkg_str)
++							else:
++								return colorize("PKG_MERGE", pkg_str)
+ 					elif pkg_status == "uninstall":
+ 						return colorize("PKG_UNINSTALL", pkg_str)
+ 					else:
+Index: pym/_emerge/help.py
+===================================================================
+--- a/pym/_emerge/help.py	(revision 15731)
++++ b/pym/_emerge/help.py	(revision 15814)
+@@ -1,6 +1,6 @@
+ # Copyright 1999-2009 Gentoo Foundation
+ # Distributed under the terms of the GNU General Public License v2
+-# $Id: help.py 15687 2010-03-02 21:07:53Z zmedico $
++# $Id: help.py 15781 2010-03-09 02:42:23Z zmedico $
+ 
+ from __future__ import print_function
+ 
+@@ -195,18 +195,31 @@
+ 		print("                emerge -S 'perl.*module'")
+ 		print()
+ 		print("       "+green("--sync"))
+-		print("              Tells emerge to update the Portage tree as specified in")
+-		print("              The SYNC variable found in /etc/make.conf.  By default, SYNC instructs")
+-		print("              emerge to perform an rsync-style update with rsync.gentoo.org.")
++		desc = "This updates the portage tree that is located in the " + \
++			"directory that the PORTDIR variable refers to (default " + \
++			"location is /usr/portage). The SYNC variable specifies " + \
++			"the remote URI from which files will be synchronized. " + \
++			"The PORTAGE_SYNC_STALE variable configures " + \
++			"warnings that are shown when emerge --sync has not " + \
++			"been executed recently."
++		for line in wrap(desc, desc_width):
++			print(desc_indent + line)
+ 		print()
+-		print("              'emerge-webrsync' exists as a helper app to emerge --sync, providing a")
+-		print("              method to receive the entire portage tree as a tarball that can be")
+-		print("              extracted and used. First time syncs would benefit greatly from this.")
++		print(desc_indent + turquoise("WARNING:"))
++		desc = "The emerge --sync action will modify and/or delete " + \
++			"files located inside the directory that the PORTDIR " + \
++			"variable refers to (default location is /usr/portage). " + \
++			"For more information, see the PORTDIR documentation in " + \
++			"the make.conf(5) man page."
++		for line in wrap(desc, desc_width):
++			print(desc_indent + line)
+ 		print()
+-		print("              "+turquoise("WARNING:"))
+-		print("              If using our rsync server, emerge will clean out all files that do not")
+-		print("              exist on it, including ones that you may have created. The exceptions")
+-		print("              to this are the distfiles, local and packages directories.")
++		print(desc_indent + green("NOTE:"))
++		desc = "The emerge-webrsync program will download the entire " + \
++			"portage tree as a tarball, which is much faster than emerge " + \
++			"--sync for first time syncs."
++		for line in wrap(desc, desc_width):
++			print(desc_indent + line)
+ 		print()
+ 		print("       "+green("--unmerge")+" ("+green("-C")+" short option)")
+ 		print("              "+turquoise("WARNING: This action can remove important packages!"))
+@@ -216,13 +229,6 @@
+ 		print("              ebuilds. For a dependency aware version of --unmerge, use")
+ 		print("              --depclean or --prune.")
+ 		print()
+-		print("       "+green("--update")+" ("+green("-u")+" short option)")
+-		print("              Updates packages to the best version available, which may not")
+-		print("              always be the highest version number due to masking for testing")
+-		print("              and development. Package atoms specified on the command")
+-		print("              line are greedy, meaning that unspecific atoms may match multiple")
+-		print("              installed versions of slotted packages.")
+-		print()
+ 		print("       "+green("--version")+" ("+green("-V")+" short option)")
+ 		print("              Displays the currently installed version of portage along with")
+ 		print("              other information useful for quick reference on a system. See")
+@@ -591,6 +597,15 @@
+ 		for line in wrap(desc, desc_width):
+ 			print(desc_indent + line)
+ 		print()
++		print("       "+green("--update")+" ("+green("-u")+" short option)")
++		desc = "Updates packages to the best version available, which may " + \
++			"not always be the  highest version number due to masking " + \
++			"for testing and development. Package atoms specified on " + \
++			"the command line are greedy, meaning that unspecific " + \
++			"atoms may match multiple versions of slotted packages."
++		for line in wrap(desc, desc_width):
++			print(desc_indent + line)
++		print()
+ 		print("       " + green("--use-ebuild-visibility") + "[=%s]" % turquoise("n"))
+ 		desc = "Use unbuilt ebuild metadata for visibility " + \
+ 			"checks on built packages."
+Index: pym/_emerge/Scheduler.py
+===================================================================
+--- a/pym/_emerge/Scheduler.py	(revision 15731)
++++ b/pym/_emerge/Scheduler.py	(revision 15814)
+@@ -1,6 +1,6 @@
+ # Copyright 1999-2009 Gentoo Foundation
+ # Distributed under the terms of the GNU General Public License v2
+-# $Id: Scheduler.py 15708 2010-03-02 21:13:39Z zmedico $
++# $Id: Scheduler.py 15812 2010-03-09 21:27:32Z zmedico $
+ 
+ from __future__ import print_function
+ 
+@@ -18,6 +18,7 @@
+ from portage import _unicode_decode
+ from portage import _unicode_encode
+ from portage.cache.mappings import slot_dict_class
++from portage.const import LIBC_PACKAGE_ATOM
+ from portage.elog.messages import eerror
+ from portage.output import colorize, create_color_func, darkgreen, red
+ bad = create_color_func("BAD")
+@@ -351,6 +352,11 @@
+ 		self._find_system_deps()
+ 		self._prune_digraph()
+ 		self._prevent_builddir_collisions()
++		self._implicit_libc_deps()
++		if '--debug' in self.myopts:
++			writemsg("\nscheduler digraph:\n\n", noiselevel=-1)
++			self._digraph.debug_print()
++			writemsg("\n", noiselevel=-1)
+ 
+ 	def _find_system_deps(self):
+ 		"""
+@@ -412,6 +418,69 @@
+ 					priority=DepPriority(buildtime=True))
+ 			cpv_map[pkg.cpv].append(pkg)
+ 
++	def _implicit_libc_deps(self):
++		"""
++		Create implicit dependencies on libc, in order to ensure that libc
++		is installed as early as possible (see bug #303567). If the merge
++		list contains both a new-style virtual and an old-style PROVIDE
++		virtual, the new-style virtual is used.
++		"""
++		implicit_libc_roots = set([self._running_root.root])
++		libc_set = InternalPackageSet([LIBC_PACKAGE_ATOM])
++		norm_libc_pkgs = {}
++		virt_libc_pkgs = {}
++		for pkg in self._mergelist:
++			if not isinstance(pkg, Package):
++				# a satisfied blocker
++				continue
++			if pkg.installed:
++				continue
++			if pkg.root in implicit_libc_roots and \
++				pkg.operation == 'merge':
++				if libc_set.findAtomForPackage(pkg):
++					if pkg.category == 'virtual':
++						d = virt_libc_pkgs
++					else:
++						d = norm_libc_pkgs
++					if pkg.root in d:
++						raise AssertionError(
++							"found 2 libc matches: %s and %s" % \
++							(d[pkg.root], pkg))
++					d[pkg.root] = pkg
++
++		# Prefer new-style virtuals over old-style PROVIDE virtuals.
++		libc_pkg_map = norm_libc_pkgs.copy()
++		libc_pkg_map.update(virt_libc_pkgs)
++
++		# Only add a dep when the version changes.
++		for libc_pkg in list(libc_pkg_map.values()):
++			if libc_pkg.root_config.trees['vartree'].dbapi.cpv_exists(
++				libc_pkg.cpv):
++				del libc_pkg_map[pkg.root]
++
++		if not libc_pkg_map:
++			return
++
++		libc_pkgs = set(libc_pkg_map.values())
++		earlier_libc_pkgs = set()
++
++		for pkg in self._mergelist:
++			if not isinstance(pkg, Package):
++				# a satisfied blocker
++				continue
++			if pkg.installed:
++				continue
++			if pkg.root in implicit_libc_roots and \
++				pkg.operation == 'merge':
++				if pkg in libc_pkgs:
++					earlier_libc_pkgs.add(pkg)
++				else:
++					my_libc = libc_pkg_map.get(pkg.root)
++					if my_libc is not None and \
++						my_libc in earlier_libc_pkgs:
++						self._digraph.add(my_libc, pkg,
++							priority=DepPriority(buildtime=True))
++
+ 	class _pkg_failure(portage.exception.PortageException):
+ 		"""
+ 		An instance of this class is raised by unmerge() when
+Index: pym/_emerge/sync/__init__.py
+===================================================================
+--- a/pym/_emerge/sync/__init__.py	(revision 15731)
++++ b/pym/_emerge/sync/__init__.py	(revision 15814)
+@@ -0,0 +1,3 @@
++# Copyright 2010 Gentoo Foundation
++# Distributed under the terms of the GNU General Public License v2
++# $Id: __init__.py 15772 2010-03-08 09:40:46Z zmedico $
+Index: pym/_emerge/sync/old_tree_timestamp.py
+===================================================================
+--- a/pym/_emerge/sync/old_tree_timestamp.py	(revision 15731)
++++ b/pym/_emerge/sync/old_tree_timestamp.py	(revision 15814)
+@@ -0,0 +1,99 @@
++# Copyright 2010 Gentoo Foundation
++# Distributed under the terms of the GNU General Public License v2
++# $Id: old_tree_timestamp.py 15807 2010-03-09 20:21:05Z zmedico $
++
++import locale
++import logging
++import time
++
++from portage import os
++from portage.exception import PortageException
++from portage.localization import _
++from portage.output import EOutput
++from portage.util import grabfile, writemsg_level
++
++def have_english_locale():
++	lang, enc = locale.getdefaultlocale()
++	if lang is not None:
++		lang = lang.lower()
++		lang = lang.split('_', 1)[0]
++	return lang is None or lang in ('c', 'en')
++
++def whenago(seconds):
++	sec = int(seconds)
++	mins = 0
++	days = 0
++	hrs = 0
++	years = 0
++	out = []
++
++	if sec > 60:
++		mins = sec / 60
++		sec = sec % 60
++	if mins > 60:
++		hrs = mins / 60
++		mins = mins % 60
++	if hrs > 24:
++		days = hrs / 24
++		hrs = hrs % 24
++	if days > 365:
++		years = days / 365
++		days = days % 365
++
++	if years:
++		out.append(str(years)+"y ")
++	if days:
++		out.append(str(days)+"d ")
++	if hrs:
++		out.append(str(hrs)+"h ")
++	if mins:
++		out.append(str(mins)+"m ")
++	if sec:
++		out.append(str(sec)+"s ")
++
++	return "".join(out).strip()
++
++def old_tree_timestamp_warn(portdir, settings):
++	unixtime = time.time()
++	default_warnsync = 30
++
++	timestamp_file = os.path.join(portdir, "metadata/timestamp.x")
++	try:
++		lastsync = grabfile(timestamp_file)
++	except PortageException:
++		return False
++
++	if not lastsync:
++		return False
++
++	lastsync = lastsync[0].split()
++	if not lastsync:
++		return False
++
++	try:
++		lastsync = int(lastsync[0])
++	except ValueError:
++		return False
++
++	var_name = 'PORTAGE_SYNC_STALE'
++	try:
++		warnsync = float(settings.get(var_name, default_warnsync))
++	except ValueError:
++		writemsg_level("!!! %s contains non-numeric value: %s\n" % \
++			(var_name, settings[var_name]),
++			level=logging.ERROR, noiselevel=-1)
++		return False
++
++	if warnsync <= 0:
++		return False
++
++	if (unixtime - 86400 * warnsync) > lastsync:
++		out = EOutput()
++		if have_english_locale():
++			out.ewarn("Last emerge --sync was %s ago." % \
++				whenago(unixtime - lastsync))
++		else:
++			out.ewarn(_("Last emerge --sync was %s.") % \
++				time.strftime('%c', time.localtime(lastsync)))
++		return True
++	return False
+Index: pym/portage/dbapi/vartree.py
+===================================================================
+--- a/pym/portage/dbapi/vartree.py	(revision 15731)
++++ b/pym/portage/dbapi/vartree.py	(revision 15814)
+@@ -1,6 +1,6 @@
+ # Copyright 1998-2009 Gentoo Foundation
+ # Distributed under the terms of the GNU General Public License v2
+-# $Id: vartree.py 15727 2010-03-03 01:27:27Z zmedico $
++# $Id: vartree.py 15782 2010-03-09 02:42:40Z zmedico $
+ 
+ __all__ = [
+ 	"vardbapi", "vartree", "dblink"] + \
+@@ -3181,6 +3181,9 @@
+ 		if self.myroot == "/" and \
+ 			match_from_list(PORTAGE_PACKAGE_ATOM, [self.mycpv]) and \
+ 			not self.vartree.dbapi.cpv_exists(self.mycpv):
++			# Load lazily referenced portage submodules into memory,
++			# so imports won't fail during portage upgrade/downgrade.
++			portage.proxy.lazyimport._preload_portage_submodules()
+ 			settings = self.settings
+ 			base_path_orig = os.path.dirname(settings["PORTAGE_BIN_PATH"])
+ 			from tempfile import mkdtemp
+Index: pym/portage/mail.py
+===================================================================
+--- a/pym/portage/mail.py	(revision 15731)
++++ b/pym/portage/mail.py	(revision 15814)
+@@ -1,36 +1,43 @@
+ # portage.py -- core Portage functionality
+ # Copyright 1998-2004 Gentoo Foundation
+ # Distributed under the terms of the GNU General Public License v2
+-# $Id: mail.py 14860 2009-11-21 04:04:37Z zmedico $
++# $Id: mail.py 15794 2010-03-09 08:11:46Z zmedico $
++
++# Since python ebuilds remove the 'email' module when USE=build
++# is enabled, use a local import so that
++# portage.proxy.lazyimport._preload_portage_submodules()
++# can load this module even though the 'email' module is missing.
++# The elog mail modules won't work, but at least an ImportError
++# won't cause portage to crash during stage builds. Since the
++# 'smtlib' module imports the 'email' module, that's imported
++# locally as well.
+ 
+-from email.mime.text import MIMEText
+-from email.mime.multipart import MIMEMultipart as MultipartMessage
+-from email.mime.base import MIMEBase as BaseMessage
+-from email.header import Header
+-import smtplib
+ import socket
+ import sys
+ import time
+ 
+ from portage import os
+ from portage import _encodings
+-from portage import _unicode_encode
++from portage import _unicode_decode, _unicode_encode
+ from portage.localization import _
+ import portage
+ 
+ if sys.hexversion >= 0x3000000:
+ 	basestring = str
+ 
+-if sys.hexversion >= 0x3000000:
+-	def TextMessage(_text):
+-		mimetext = MIMEText(_text)
++def TextMessage(_text):
++	from email.mime.text import MIMEText
++	mimetext = MIMEText(_text)
++	if sys.hexversion >= 0x3000000:
+ 		mimetext.set_charset("UTF-8")
+-		return mimetext
+-else:
+-	TextMessage = MIMEText
++	return mimetext
+ 
+ def create_message(sender, recipient, subject, body, attachments=None):
+ 
++	from email.header import Header
++	from email.mime.base import MIMEBase as BaseMessage
++	from email.mime.multipart import MIMEMultipart as MultipartMessage
++
+ 	if sys.hexversion < 0x3000000:
+ 		sender = _unicode_encode(sender,
+ 			encoding=_encodings['content'], errors='strict')
+@@ -69,6 +76,9 @@
+ 	return mymessage
+ 
+ def send_mail(mysettings, message):
++
++	import smtplib
++
+ 	mymailhost = "localhost"
+ 	mymailport = 25
+ 	mymailuser = ""
+@@ -135,7 +145,17 @@
+ 				myconn = smtplib.SMTP(mymailhost, mymailport)
+ 			if mymailuser != "" and mymailpasswd != "":
+ 				myconn.login(mymailuser, mymailpasswd)
+-			myconn.sendmail(myfrom, myrecipient, message.as_string())
++
++			message_str = message.as_string()
++			if sys.hexversion >= 0x3000000:
++				# Force ascii encoding in order to avoid UnicodeEncodeError
++				# from smtplib.sendmail with python3 (bug #291331).
++				message_str = _unicode_encode(message_str,
++					encoding='ascii', errors='backslashreplace')
++				message_str = _unicode_decode(message_str,
++					encoding='ascii', errors='replace')
++
++			myconn.sendmail(myfrom, myrecipient, message_str)
+ 			myconn.quit()
+ 		except smtplib.SMTPException as e:
+ 			raise portage.exception.PortageException(_("!!! An error occured while trying to send logmail:\n")+str(e))
+Index: pym/portage/output.py
+===================================================================
+--- a/pym/portage/output.py	(revision 15731)
++++ b/pym/portage/output.py	(revision 15814)
+@@ -1,6 +1,6 @@
+ # Copyright 1998-2009 Gentoo Foundation
+ # Distributed under the terms of the GNU General Public License v2
+-# $Id: output.py 15245 2010-01-29 18:47:30Z zmedico $
++# $Id: output.py 15746 2010-03-04 11:22:15Z zmedico $
+ 
+ __docformat__ = "epytext"
+ 
+@@ -139,6 +139,9 @@
+ _styles["PKG_MERGE"]               = ( "darkgreen", )
+ _styles["PKG_MERGE_SYSTEM"]        = ( "darkgreen", )
+ _styles["PKG_MERGE_WORLD"]         = ( "green", )
++_styles["PKG_BINARY_MERGE"]        = ( "darkgreen", )
++_styles["PKG_BINARY_MERGE_SYSTEM"] = ( "darkgreen", )
++_styles["PKG_BINARY_MERGE_WORLD"]  = ( "green", )
+ _styles["PKG_UNINSTALL"]           = ( "red", )
+ _styles["PKG_NOMERGE"]             = ( "darkblue", )
+ _styles["PKG_NOMERGE_SYSTEM"]      = ( "darkblue", )
+Index: pym/portage/package/ebuild/config.py
+===================================================================
+--- a/pym/portage/package/ebuild/config.py	(revision 15731)
++++ b/pym/portage/package/ebuild/config.py	(revision 15814)
+@@ -1,6 +1,6 @@
+ # Copyright 2010 Gentoo Foundation
+ # Distributed under the terms of the GNU General Public License v2
+-# $Id: config.py 15705 2010-03-02 21:11:02Z zmedico $
++# $Id: config.py 15768 2010-03-08 09:05:13Z zmedico $
+ 
+ __all__ = [
+ 	'autouse', 'best_from_dict', 'check_config_instance', 'config',
+@@ -274,7 +274,8 @@
+ 		"PORTAGE_REPO_DUPLICATE_WARN",
+ 		"PORTAGE_RO_DISTDIRS",
+ 		"PORTAGE_RSYNC_EXTRA_OPTS", "PORTAGE_RSYNC_OPTS",
+-		"PORTAGE_RSYNC_RETRIES", "PORTAGE_USE", "PORT_LOGDIR",
++		"PORTAGE_RSYNC_RETRIES", "PORTAGE_SYNC_STALE",
++		"PORTAGE_USE", "PORT_LOGDIR",
+ 		"QUICKPKG_DEFAULT_OPTS",
+ 		"RESUMECOMMAND", "RESUMECOMMAND_HTTP", "RESUMECOMMAND_HTTP",
+ 		"RESUMECOMMAND_SFTP", "SYNC", "USE_EXPAND_HIDDEN", "USE_ORDER",
+Index: pym/portage/package/ebuild/doebuild.py
+===================================================================
+--- a/pym/portage/package/ebuild/doebuild.py	(revision 15731)
++++ b/pym/portage/package/ebuild/doebuild.py	(revision 15814)
+@@ -1,6 +1,6 @@
+ # Copyright 2010 Gentoo Foundation
+ # Distributed under the terms of the GNU General Public License v2
+-# $Id: doebuild.py 15713 2010-03-02 21:14:43Z zmedico $
++# $Id: doebuild.py 15760 2010-03-08 08:46:53Z zmedico $
+ 
+ __all__ = ['doebuild', 'doebuild_environment', 'spawn', 'spawnebuild']
+ 
+@@ -25,6 +25,7 @@
+ 	'portage.package.ebuild.config:check_config_instance',
+ 	'portage.package.ebuild.digestcheck:digestcheck',
+ 	'portage.package.ebuild.digestgen:digestgen',
++	'portage.package.ebuild.fetch:fetch',
+ 	'portage.util.ExtractKernelVersion:ExtractKernelVersion'
+ )
+ 
+@@ -47,7 +48,6 @@
+ from portage.localization import _
+ from portage.manifest import Manifest
+ from portage.output import style_to_ansi_code
+-from portage.package.ebuild.fetch import fetch
+ from portage.package.ebuild.prepare_build_dirs import prepare_build_dirs
+ from portage.util import apply_recursive_permissions, \
+ 	apply_secpass_permissions, noiselimit, normalize_path, \
+@@ -810,7 +810,8 @@
+ 			mydo not in ("digest", "manifest") and "noauto" not in features)
+ 		alist = mysettings.configdict["pkg"].get("A")
+ 		aalist = mysettings.configdict["pkg"].get("AA")
+-		if alist is None or aalist is None:
++		if alist is None or aalist is None or \
++			(not emerge_skip_distfiles and need_distfiles):
+ 			# Make sure we get the correct tree in case there are overlays.
+ 			mytree = os.path.realpath(
+ 				os.path.dirname(os.path.dirname(mysettings["O"])))
+@@ -827,25 +828,26 @@
+ 				return 1
+ 			mysettings.configdict["pkg"]["A"] = " ".join(alist)
+ 			mysettings.configdict["pkg"]["AA"] = " ".join(aalist)
++
++			if not emerge_skip_distfiles and need_distfiles:
++				if "mirror" in features or fetchall:
++					fetchme = aalist
++				else:
++					fetchme = alist
++				if not fetch(fetchme, mysettings, listonly=listonly,
++					fetchonly=fetchonly):
++					return 1
++
+ 		else:
+ 			alist = set(alist.split())
+ 			aalist = set(aalist.split())
+-		if ("mirror" in features) or fetchall:
+-			fetchme = aalist
+-			checkme = aalist
+-		else:
+-			fetchme = alist
+-			checkme = alist
+ 
+ 		if mydo == "fetch":
+ 			# Files are already checked inside fetch(),
+ 			# so do not check them again.
+ 			checkme = []
+-
+-		if not emerge_skip_distfiles and \
+-			need_distfiles and not fetch(
+-			fetchme, mysettings, listonly=listonly, fetchonly=fetchonly):
+-			return 1
++		else:
++			checkme = alist
+ 
+ 		if mydo == "fetch" and listonly:
+ 			return 0
+Index: pym/portage/package/ebuild/fetch.py
+===================================================================
+--- a/pym/portage/package/ebuild/fetch.py	(revision 15731)
++++ b/pym/portage/package/ebuild/fetch.py	(revision 15814)
+@@ -1,6 +1,6 @@
+ # Copyright 2010 Gentoo Foundation
+ # Distributed under the terms of the GNU General Public License v2
+-# $Id: fetch.py 15718 2010-03-02 21:37:48Z zmedico $
++# $Id: fetch.py 15748 2010-03-04 11:23:00Z zmedico $
+ 
+ from __future__ import print_function
+ 
+@@ -20,18 +20,26 @@
+ import portage
+ portage.proxy.lazyimport.lazyimport(globals(),
+ 	'portage.package.ebuild.config:check_config_instance,config',
++	'portage.package.ebuild.doebuild:doebuild_environment,' + \
++		'spawn@doebuild_spawn',
++	'portage.package.ebuild.prepare_build_dirs:prepare_build_dirs',
+ )
+ 
+-from portage import doebuild_environment, OrderedDict, os, prepare_build_dirs, selinux, _encodings, _shell_quote, _unicode_encode
++from portage import OrderedDict, os, selinux, _encodings, \
++	_shell_quote, _unicode_encode
+ from portage.checksum import perform_md5, verify_all
+-from portage.const import BASH_BINARY, CUSTOM_MIRRORS_FILE, EBUILD_SH_BINARY, GLOBAL_CONFIG_PATH
++from portage.const import BASH_BINARY, CUSTOM_MIRRORS_FILE, \
++	EBUILD_SH_BINARY, GLOBAL_CONFIG_PATH
+ from portage.data import portage_gid, portage_uid, secpass, userpriv_groups
+-from portage.exception import FileNotFound, OperationNotPermitted, PermissionDenied, PortageException, TryAgain
++from portage.exception import FileNotFound, OperationNotPermitted, \
++	PermissionDenied, PortageException, TryAgain
+ from portage.localization import _
+ from portage.locks import lockfile, unlockfile
+ from portage.manifest import Manifest
+ from portage.output import colorize, EOutput
+-from portage.util import apply_recursive_permissions, apply_secpass_permissions, ensure_dirs, grabdict, shlex_split, varexpand, writemsg, writemsg_level, writemsg_stdout
++from portage.util import apply_recursive_permissions, \
++	apply_secpass_permissions, ensure_dirs, grabdict, shlex_split, \
++	varexpand, writemsg, writemsg_level, writemsg_stdout
+ from portage.process import spawn
+ 
+ _userpriv_spawn_kwargs = (
+@@ -1096,7 +1104,7 @@
+ 					ebuild_phase = mysettings.get("EBUILD_PHASE")
+ 					try:
+ 						mysettings["EBUILD_PHASE"] = "nofetch"
+-						spawn(_shell_quote(EBUILD_SH_BINARY) + \
++						doebuild_spawn(_shell_quote(EBUILD_SH_BINARY) + \
+ 							" nofetch", mysettings, fd_pipes=fd_pipes)
+ 					finally:
+ 						if ebuild_phase is None:
+Index: pym/portage/package/ebuild/getmaskingstatus.py
+===================================================================
+--- a/pym/portage/package/ebuild/getmaskingstatus.py	(revision 15731)
++++ b/pym/portage/package/ebuild/getmaskingstatus.py	(revision 15814)
+@@ -1,9 +1,11 @@
+ # Copyright 2010 Gentoo Foundation
+ # Distributed under the terms of the GNU General Public License v2
+-# $Id: getmaskingstatus.py 15672 2010-03-02 21:01:19Z zmedico $
++# $Id: getmaskingstatus.py 15749 2010-03-04 11:23:09Z zmedico $
+ 
+ __all__ = ['getmaskingstatus']
+ 
++import sys
++
+ import portage
+ from portage import eapi_is_supported, _eapi_is_deprecated
+ from portage.dep import match_from_list
+@@ -11,6 +13,9 @@
+ from portage.package.ebuild.config import config
+ from portage.versions import catpkgsplit, cpv_getkey
+ 
++if sys.hexversion >= 0x3000000:
++	basestring = str
++
+ def getmaskingstatus(mycpv, settings=None, portdb=None):
+ 	if settings is None:
+ 		settings = config(clone=portage.settings)
+Index: pym/portage/proxy/lazyimport.py
+===================================================================
+--- a/pym/portage/proxy/lazyimport.py	(revision 15731)
++++ b/pym/portage/proxy/lazyimport.py	(revision 15814)
+@@ -1,6 +1,6 @@
+ # Copyright 2009 Gentoo Foundation
+ # Distributed under the terms of the GNU General Public License v2
+-# $Id: lazyimport.py 14327 2009-09-21 16:07:07Z arfrever $
++# $Id: lazyimport.py 15782 2010-03-09 02:42:40Z zmedico $
+ 
+ __all__ = ['lazyimport']
+ 
+@@ -20,6 +20,24 @@
+ _module_proxies = {}
+ _module_proxies_lock = threading.RLock()
+ 
++def _preload_portage_submodules():
++	"""
++	Load lazily referenced portage submodules into memory,
++	so imports won't fail during portage upgrade/downgrade.
++	Note that this recursively loads only the modules that
++	are lazily referenced by currently imported modules,
++	so some portage submodules may still remain unimported
++	after this function is called.
++	"""
++	while True:
++		remaining = False
++		for name in list(_module_proxies):
++			if name.startswith('portage.'):
++				remaining = True
++				_unregister_module_proxy(name)
++		if not remaining:
++			break
++
+ def _register_module_proxy(name, proxy):
+ 	_module_proxies_lock.acquire()
+ 	try:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/hello-world.sh	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+# Download all the source tarballs we haven't got up-to-date copies of.
+
+# The tarballs are downloaded into the "packages" directory, which is
+# created as needed.
+
+source sources/include.sh || exit 1
+
+[ $# -ne 1 ] && echo "usage: $0 FILENAME" >&2 && exit 1
+[ -e "$1" ] && echo "$1 exists" && exit 0
+
+# Set up working directories
+
+WORK="$BUILD/control-images/hello-world"
+blank_tempdir "$WORK"
+
+cat > "$WORK"/init << 'EOF' || dienow
+#!/bin/bash
+
+echo Started second stage init
+
+cd /home &&
+gcc -lpthread /usr/src/thread-hello2.c -o hello &&
+./hello
+
+# Upload our hello world file to the output directory (named hello-$HOST).
+# No reason, just an example.
+
+ftpput $FTP_SERVER -P $FTP_PORT hello-$HOST hello
+
+sync
+
+EOF
+
+chmod +x "$WORK"/init || dienow
+
+cd "$TOP"
+
+mksquashfs "$WORK" "$1" -noappend -all-root
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/lfs-bootstrap/download.sh	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,44 @@
+# Build Linux From Scratch 6.7 packages under target environment.
+
+# Note: this doesn't rebuild the toolchain packages (libc, binutils,
+# gcc, linux-headers), but reuses the toolchain we've got, because:
+
+# 1) Building a new toolchain is a target-dependent can of worms.
+# 2) Doing so would lose distcc acceleration.
+# 3) Building glibc under uClibc is buggy because glibc expects that a
+#    2.6 kernel will have TLS, and uClibc without NPTL doesn't.  (Yes,
+#    repeat after me, "autoconf is useless".)
+
+# Download upstream tarball
+
+URL=http://ftp.osuosl.org/pub/lfs/lfs-packages/lfs-packages-6.7.tar \
+SHA1= \
+RENAME='s/-sources//' \
+download || dienow
+
+cleanup_oldfiles
+
+# Extract the individual packages from the upstream tarball
+
+SRCDIR="$SRCTREE/lfs-packages"
+PATCHDIR="$SRCDIR"
+
+# Fixups for tarball names the Aboriginal extract scripts can't parse
+
+mv "$SRCDIR"/sysvinit-2.88{dsf,}.tar.bz2 &&
+mv "$SRCDIR"/tcl{8.5.8-src,-src-8.5.8}.tar.gz &&
+mv "$SRCDIR"/udev-{161-testfiles,testfiles-161}.tar.bz2 || exit 1
+
+# Remove damaged patches (whitespace damaged, don't apply without "fuzz").
+
+rm "$SRCDIR"/gcc-4.5.1-startfiles_fix-1.patch &&
+rm "$SRCDIR"/tar-1.23-overflow_fix-1.patch || exit 1
+
+# Break down upstream tarball
+
+for i in $(cd "$SRCDIR"; ls *.tar.*)
+do
+  extract_package $(noversion $i)
+done
+
+rm -rf "$SRCDIR"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/lfs-bootstrap/make-control-image.sh	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,1 @@
+../bootstrap-skeleton/control-image-wrapper.sh
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/lfs-bootstrap/mnt/build/bash.sh	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+./configure --prefix=/usr --bindir=/bin --htmldir=/usr/share/doc/bash \
+  --without-bash-malloc --with-installed-readline &&
+make -j $CPUS || exit 1
+
+if [ ! -z "$CHECK" ]
+then
+  chown -R nobody . &&
+  su-tools nobody -s /bin/bash -c "make tests" || exit 1
+fi
+
+make install
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/lfs-bootstrap/mnt/build/bison.sh	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+./configure --prefix=/usr &&
+echo '#define YYENABLE_NLS 1' >> lib/config.h &&
+make -j $CPUS || exit 1
+
+if [ ! -z "$CHECK" ]
+then
+  make check || exit 1
+fi
+
+make install
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/lfs-bootstrap/mnt/build/coreutils.sh	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+./configure --prefix=/usr --enable-no-install-program=kill,uptime &&
+make -j $CPUS || exit 1
+
+if [ ! -z "$CHECK" ]
+then
+  make NON_ROOT_USERNAME=nobody check-root &&
+  echo "dummy:x:1000:nobody" >> /etc/group &&
+  chown -R nobody . &&
+  su-tools nobody -s /bin/bash -c "make RUN_EXPENSIVE_TESTS=yes check" &&
+  sed -i '/^dummy:/d' /etc/group || exit 1
+fi
+
+make install &&
+mv /usr/bin/chroot /usr/sbin
+  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/lfs-bootstrap/mnt/build/e2fsprogs.sh	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+mkdir build &&
+cd build &&
+../configure --prefix=/usr --with-root-prefix="" \
+  --enable-elf-shlibs --disable-libblkid --disable-libuuid \
+  --disable-uuidd --disable-fsck --disable-tls &&
+make -j $CPUS || exit 1
+
+if [ ! -z "$CHECK" ]
+then
+  make check || exit 1
+fi
+
+make install &&
+make install-libs &&
+chmod u+w /usr/lib/{libcom_err,libe2p,libext2fs,libss}.a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/lfs-bootstrap/mnt/build/gdbm.sh	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+./configure --prefix=/usr &&
+make -j $CPUS &&
+make install &&
+make install-compat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/lfs-bootstrap/mnt/build/gmp.sh	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+# Doesn't work with uClibc++ yet.
+# [ ! -z "$(which c++)" ] && X="--enable-cxx"
+
+./configure --prefix=/usr $X --enable-mpbsd &&
+make -j $CPUS || exit 1
+
+if [ ! -z "$CHECK" ]
+then
+  make check 2>&1 | tee gmp-check-log
+  awk '/tests passed/{total+=$2} ; END{print total}' gmp-check-log
+fi
+
+make install || exit 1
+
+if [ ! -z "$DOCS" ]
+then
+  mkdir -p /usr/share/doc/gmp-5.0.1 &&
+  cp doc/isa_abi_headache doc/connfiguration doc/*.html \
+    /usr/share/doc/gmp-5.0.1
+fi
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/lfs-bootstrap/mnt/build/grep.sh	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+./configure --prefix=/usr --bindir=/bin &&
+make -j $CPUS || exit 1
+
+if [ ! -z "$CHECK" ]
+then
+  make check || exit 1
+fi
+
+make install
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/lfs-bootstrap/mnt/build/iana-etc.sh	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+make -j $CPUS &&
+make install
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/lfs-bootstrap/mnt/build/inetutils.sh	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+./configure --prefix=/usr --libexecdir=/usr/sbin --localstatedir=/var \
+  --disable-logger --disable-syslogd --disable-whois --disable-servers &&
+make -j $CPUS &&
+make install
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/lfs-bootstrap/mnt/build/libtool.sh	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+./configure --prefix=/usr &&
+make -j $CPUS || exit 1
+
+if [ ! -z "$CHECK" ]
+then
+  make check || exit 1
+fi
+
+make install
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/lfs-bootstrap/mnt/build/m4.sh	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+sed -i -e '/"m4.h"/a#include <sys/stat.h>' src/path.c &&
+./configure --prefix=/usr &&
+make || exit 1
+
+if [ ! -z "$CHECK" ]
+then
+  make check || exit 1
+fi
+
+make install
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/lfs-bootstrap/mnt/build/mpc.sh	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+./configure --prefix=/usr &&
+make -j $CPUS || exit 1
+
+if [ ! -z "$CHECK" ]
+then
+  make check || exit 1
+fi
+
+make install
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/lfs-bootstrap/mnt/build/mpfr.sh	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# TODO: The --enable-thread-safe here requires TLS
+
+./configure --prefix=/usr --docdir=/usr/share/doc/mpfr-3.0.0 &&
+make -j $CPUS || exit 1
+
+if [ ! -z "$CHECK" ]
+then
+  make check || exit 1
+fi
+
+make install || exit 1
+
+if [ ! -z "$DOCS" ]
+then
+  make html &&
+  make install-html
+fi
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/lfs-bootstrap/mnt/build/ncurses.sh	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+[ ! -z "$(which c++)" ] && X="--without-cxx --without-cxx-binding"
+
+./configure --prefix=/usr --with-shared --without-debug --enable-widec $X &&
+make -j $CPUS &&
+make install || exit 1
+
+# Make sure various packages can find ncurses no matter what weird names
+# they look for.
+
+for lib in ncurses form panel menu
+do
+    ln -sf lib${lib}w.so /usr/lib/lib${lib}.so &&
+    ln -sf lib${lib}w.a /usr/lib/lib${lib}.a || exit 1
+done
+ln -sf libncursesw.so libcursesw.so &&
+ln -sf libncurses.so /usr/lib/libcurses.so &&
+ln -sf libncursesw.a /usr/lib/libcursesw.a &&
+ln -sf libncurses.a /usr/lib/libcurses.a || exit 1
+
+if [ ! -z "$(which c++)" ]
+then
+  ln -sf libncurses++w.a /usr/lib/libncurses++.a || exit 1
+fi
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/lfs-bootstrap/mnt/build/pkg-config.sh	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+sed -i -e 's/XT])dnl/XT])[]dnl/' \
+       -e 's/\.])dnl/\.])[]dnl/' pkg.m4 &&
+./configure --prefix=/usr &&
+make -j $CPUS || exit 1
+
+if [ ! -z "$CHECK" ]
+then
+  make check || exit 1
+fi
+
+make install
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/lfs-bootstrap/mnt/build/procps.sh	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+sed -i -e 's@\*/module.mk@proc/module.mk ps/module.mk@' Makefile &&
+make -j $CPUS &&
+make install
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/lfs-bootstrap/mnt/build/readline.sh	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+sed -k '/MV.*old/d' Makefile.in &&
+sed -i '/{OLDSUFF}/c:' support/shlib-install &&
+./configure --prefix=/usr --libdir=/lib &&
+make -j $CPUS SHLIB_LIBS=-lncurses &&
+make install  || exit 1
+
+if [ ! -z "$DOCS" ]
+then
+  mkdir /usr/share/doc/readline &&
+  install -m644 doc/*.ps doc/*.pdf doc/*.html doc/*.dvi \
+    /usr/share/doc/readline
+fi
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/lfs-bootstrap/mnt/build/sed.sh	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+./configure --prefix=/usr --bindir=/bin --htmldir=/usr/share/doc/sed-4.2.1 &&
+make -j $CPUS || exit 1
+
+if [ ! -z "$DOCS" ]
+then
+  make html &&
+  make -C doc install-html || exit 1
+fi
+
+if [ ! -z "$CHECK" ]
+then
+  make check || exit 1
+fi
+
+make install
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/lfs-bootstrap/mnt/build/setup.nosrc	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,53 @@
+#!/bin/bash
+
+# Basic setup.  Create directories not in the aboriginal base system.
+
+cd / &&
+
+mkdir -p boot etc/opt opt media/floppy media/cdrom srv var/tmp &&
+chmod 0750 root &&
+chmod 1777 tmp var/tmp &&
+rm -rf /usr/local &&
+ln -sf . usr/local &&
+cd usr/share &&
+mkdir -p doc info locale man misc terminfo zoneinfo &&
+cd ../.. &&
+ln -sf share/man share/doc share/info usr &&
+cd var &&
+mkdir -p lib lock log mail run spool opt cache local &&
+cd lib &&
+mkdir -p misc locate &&
+cd ../.. &&
+
+cat > etc/passwd << "EOF" &&
+root:x:0:0:root:/root:/bin/bash
+bin:x:1:1:bin:/dev/null:/bin/false
+nobody:x:99:99:Unprivileged User:/dev/null:/bin/false
+guest:x:500:500:guest:/home/guest:/bin/sh
+EOF
+
+cat > etc/group << "EOF" &&
+root:x:0:
+bin:x:1:
+sys:x:2:
+kmem:x:3:
+tty:x:4:
+tape:x:5:
+daemon:x:6:
+floppy:x:7:
+disk:x:8:
+lp:x:9:
+dialout:x:10:
+audio:x:11:
+video:x:12:
+utmp:x:13:
+usb:x:14:
+cdrom:x:15:
+mail:x:34:
+nogroup:x:99:
+guest:x:500:
+EOF
+
+touch /var/run/utmp /var/log/btmp /var/log/lastlog /var/log/wtmp &&
+chgrp -v utmp /var/run/utmp /var/log/lastlog &&
+chmod -v 664 /var/run/utmp /var/log/lastlog
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/lfs-bootstrap/mnt/build/util-linux-ng.sh	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+sed -e 's@etc/adjtime@var/lib/hwclock/adjtime@g' \
+  -i $(grep -rl '/etc/adjtime' .) &&
+mkdir -p /var/lib/hwclock &&
+./configure --enable-arch --enable-partx --enable-write &&
+make -j $CPUS &&
+make install
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/lfs-bootstrap/mnt/build/zlib.sh	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+# zlib 1.2.5 accidentally shipped a generated file, which it then tries to
+# overwrite in-place.  This doesn't work so well on a read only filesystem.
+
+rm -f Makefile &&
+
+# Fix another bug.
+
+sed -i 's/ifdef _LARGEFILE64_SOURCE/ifndef _LARGEFILE64_SOURCE/' zlib.h &&
+
+# Otherwise, standard build
+
+./configure --prefix=/usr &&
+make -j $CPUS || exit 1
+
+if [ ! -z "$CHECK" ]
+then
+  make check || exit 1
+fi
+
+make install
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/lfs-bootstrap/mnt/package-list	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,48 @@
+setup
+zlib
+m4		#development
+gmp		#development
+mpfr		#development
+mpc		#development
+sed		#busybox
+pkg-config	#development
+ncurses
+util-linux-ng
+e2fsprogs	#busybox
+coreutils	#busybox
+gawk		#busybox
+iana-etc
+bison		#development
+procps		#busybox
+grep		#busybox
+readline	#development
+gettext		#development internationalization
+bash		#development
+libtool		#development pointless
+gdbm
+inetutils	#busybox?
+perl
+autoconf	#development
+automake	#development
+bzip2		#busybox
+diffutils	#busybox
+file
+findutils	#busybox
+flex		#development
+groff
+gzip		#busybox
+iproute2	#busybox?
+kbd		#busybox?
+less		#busybox
+make		#development
+man-db
+module-init-tools #busybox
+patch		#busybox
+psmisc		#busybox?
+shadow		#busybox
+sysklogd	#busybox
+sysvinit	#busybox
+tar		#busybox
+texinfo		#development pointless
+udev		#busybox
+vim
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/static-tools-patches/strace-arm-eabi.patch	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,11 @@
+--- a/linux/arm/syscallent.h
++++ b/linux/arm/syscallent.h
+@@ -453,7 +453,7 @@
+ 	{ 5,	TN,	sys_recvmsg,		"recvmsg"	}, /* 417 */
+ 	{ 4,	TN,	sys_accept4,		"accept4"	}, /* 418 */
+ 
+-#if SYS_ipc_subcall != 419
++#if defined(SYS_ipc_subcall) && (SYS_ipc_subcall != 419)
+  #error fix me
+ #endif
+ 	{ 4,	0,	printargs,		"ipc_subcall"	}, /* 419 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/static-tools-patches/strace-fixnet.patch	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,24 @@
+diff -ru strace/configure strace.new/configure
+--- strace/configure	2009-10-21 12:41:11.000000000 -0500
++++ strace.new/configure	2010-02-05 01:30:15.000000000 -0600
+@@ -5880,7 +5880,7 @@
+ do :
+   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#include <stddef.h>
+-#include <linux/socket.h>
++#include <sys/socket.h>
+ "
+ eval as_val=\$$as_ac_Header
+    if test "x$as_val" = x""yes; then :
+diff -ru strace/configure.ac strace.new/configure.ac
+--- strace/configure.ac	2009-10-12 14:54:43.000000000 -0500
++++ strace.new/configure.ac	2010-02-05 01:30:35.000000000 -0600
+@@ -258,7 +258,7 @@
+ ], [], [])
+ AC_CHECK_HEADERS([linux/icmp.h linux/in6.h linux/netlink.h linux/if_packet.h],
+                  [], [], [#include <stddef.h>
+-#include <linux/socket.h>])
++#include <sys/socket.h>])
+ AC_CHECK_HEADERS([asm/sigcontext.h], [], [], [#include <signal.h>])
+ AC_CHECK_TYPES([struct sigcontext_struct,
+ 		struct sigcontext],,, [#include <signal.h>])
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/control-images/static-tools.sh	Sun Nov 07 15:55:26 2010 -0600
@@ -0,0 +1,93 @@
+#!/bin/bash
+
+# Download all the source tarballs we haven't got up-to-date copies of.
+
+# The tarballs are downloaded into the "packages" directory, which is
+# created as needed.
+
+source sources/include.sh || exit 1
+
+[ $# -ne 1 ] && echo "usage: $0 FILENAME" >&2 && exit 1
+[ -e "$1" ] && echo "$1" exists && exit 0
+
+PATCHDIR="$SOURCES/native-builds/static-tools-patches"
+SRCDIR="$SRCDIR/native" && mkdir -p "$SRCDIR" || dienow
+WORK="$BUILD/control-images/static-tools" && blank_tempdir "$WORK"
+SRCTREE="$WORK"
+
+EXTRACT_ALL=1
+
+echo "=== Download source code."
+
+# Note: set SHA1= blank to skip checksum validation.
+
+URL=http://downloads.sf.net/sourceforge/strace/strace-4.5.19.tar.bz2 \
+SHA1=5554c2fd8ffae5c1e2b289b2024aa85a0889c989 \
+maybe_fork download || dienow
+
+URL=http://zlib.net/zlib-1.2.5.tar.bz2 \
+SHA1=543fa9abff0442edca308772d6cef85557677e02 \
+maybe_fork "download || dienow"
+
+URL=http://matt.ucc.asn.au/dropbear/releases/dropbear-0.52.tar.bz2 \
+SHA1=8c1745a9b64ffae79f28e25c6fe9a8b96cac86d8 \
+maybe_fork download || dienow
+
+echo === Got all source.
+
+cleanup_oldfiles
+
+cat > "$WORK"/init << 'EOF' || dienow
+#!/bin/bash
+
+upload_result()
+{
+  ftpput $FTP_SERVER -P $FTP_PORT "$1-$HOST" "$1"
+}
+
+echo Started second stage init
+
+echo === Native build static zlib
+
+cp -sfR /mnt/zlib zlib &&
+cd zlib &&
+# 
+rm -f Makefile &&
+./configure &&
+make -j $CPUS &&
+cd .. || exit 1
+
+echo === $HOST Native build static dropbear
+
+cp -sfR /mnt/dropbear dropbear &&
+cd dropbear &&
+CFLAGS="-I ../zlib -Os" LDFLAGS="--static -L ../zlib" ./configure &&
+sed -i 's@/usr/bin/dbclient@ssh@' options.h &&
+make -j $CPUS PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp" MULTI=1 SCPPROGRESS=1 &&
+strip dropbearmulti &&
+upload_result dropbearmulti &&
+cd .. &&
+rm -rf dropbear || exit 1
+
+echo === $HOST native build static strace
+
+cp -sfR /mnt/strace strace &&
+cd strace &&
+CFLAGS="--static -Os" ./configure &&
+make -j $CPUS &&
+strip strace &&
+upload_result strace &&
+cd .. &&
+rm -rf strace || dienow
+
+echo === $HOST native build rsync
+
+sync
+
+EOF
+
+chmod +x "$WORK"/init || dienow
+
+cd "$TOP"
+
+mksquashfs "$WORK" "$1" -noappend -all-root
--- a/sources/native-builds/bootstrap-skeleton/control-image-wrapper.sh	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-#!/bin/bash
-
-# Control image generator infrastructure.
-
-source sources/include.sh || exit 1
-
-# Did caller specify the name of a control image to generate?  Explicit
-# /dev/null means none.
-
-[ $# -ne 1 ] && echo "usage: $0 FILENAME" >&2 && exit 1
-[ "$1" != "/dev/null" ] && [ -e "$1" ] && echo "$1" exists && exit 0
-
-# Find path to our working directory.
-
-MYDIR="$(readlink -f "$(dirname "$(which "$0")")")"
-IMAGENAME="${MYDIR/*\//}"
-
-# Use our own directories for downloaded source tarballs and patches.
-# (We may have the same packages as the aboriginal build, but use different
-# versions, and we don't want our cleanup_oldfiles to overlap.)
-
-PATCHDIR="$MYDIR/patches"
-SRCDIR="$SRCDIR/control-images/$IMAGENAME" && mkdir -p "$SRCDIR" || dienow
-
-# Include package cache in the control image, so the target system image can
-# build from this source.
-
-WORK="$BUILD/control-images/$IMAGENAME" &&
-blank_tempdir "$WORK" &&
-SRCTREE="$WORK/packages" &&
-mkdir "$SRCTREE" &&
-
-# Copy common infrastructure to target
-
-cp "$MYDIR"/../bootstrap-skeleton/files/* "$WORK" || exit 1
-if [ -e "$MYDIR/mnt" ]
-then
-  cp -a "$MYDIR/mnt/." "$WORK" || exit 1
-fi
-
-# Populate packages directory
-
-echo "=== $IMAGENAME: Download/extract source code"
-
-EXTRACT_ALL=1
-
-source "$MYDIR"/download.sh || exit 1
-
-cleanup_oldfiles
-
-# Create sqaushfs image
-
-if [ "$1" != "/dev/null" ]
-then
-  cd "$TOP" &&
-  mksquashfs "$WORK" "$1" -noappend -all-root || dienow
-fi
--- a/sources/native-builds/bootstrap-skeleton/files/build-one-package.sh	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-#!/bin/sh
-
-source /mnt/functions.sh || exit 1
-
-# build $1 using manifest file $2
-
-# Is it already installed?
-
-if [ ! -z "$2" ] && [ -z "$FORCE" ] && grep -q "$1" "$2"
-then
-  echo "$1 already installed"
-  exit 0
-fi
-
-set_titlebar "$1"
-
-if [ -d "/mnt/packages/$1" ]
-then
-
-  # Snapshot source
-
-  cd /home &&
-  rm -rf "/home/$1" &&
-  cp -sfR "/mnt/packages/$1" "$1" &&
-  cd "$1" || exit 1
-
-  # Lobotomize config.guess so it won't complain about unknown target types.
-  # 99% of packages do not care, but autoconf throws a temper tantrum if
-  # the version of autoconf that created this back when the package shipped
-  # didn't know what a microblaze or hexagon was.  Repeat after me:
-  #   "Autoconf is useless"
-
-  for guess in $(find . -name config.guess)
-  do
-    rm "$guess" &&
-    echo -e "#!/bin/sh\ngcc -dumpmachine" > "$guess" || exit 1
-  done
-  EXT=sh
-else
-  EXT=nosrc
-fi
-
-# Call package build script
-
-if ! time "/mnt/build/${1}.$EXT"
-then
-  echo "$1" died >&2
-  exit 1
-fi
-
-# Add file to manifest, removing previous version (if any).
-
-if [ ! -z "$2" ]
-then
-  sed -i -e "/$1/d" "$2" &&
-  echo "$1" >> "$2" || exit 1
-fi
-
-if [ -d "/mnt/packages/$1" ]
-then
-
-  # Delete copy of source if build succeeded
-
-  cd /home &&
-  rm -rf "$1" &&
-  sync || exit 1
-fi
--- a/sources/native-builds/bootstrap-skeleton/files/functions.sh	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-#!/bin/echo This file is sourced not run
-
-upload_result()
-{
-  ftpput $FTP_SERVER -P $FTP_PORT "$1-$HOST" "$1"
-}
-
-set_titlebar()
-{
-  echo -en "\033]2;($HOST) $1\007"
-  echo === "$1"
-}
-
-dotprogress()
-{
-  while read i; do echo -n .; done; echo
-}
-
-do_in_chroot()
-{
-  # Copy root filesystem into a new chroot directory and restart in there.
-
-  CHROOT="$1"
-  shift
-
-  set_titlebar "Setup chroot"
-  mkdir "$CHROOT"
-  cp -a /mnt/files/. "$CHROOT"
-  find / -xdev | cpio -m -v -p "$CHROOT" | dotprogress
-  for i in mnt proc sys dev; do mount --bind /$i "$CHROOT"/$i; done
-
-  echo Chroot
-  chroot "$CHROOT" "$@"
-  RC=$?
-
-  echo Chroot cleanup
-  for i in mnt proc sys dev; do umount "$CHROOT"/$i; done
-
-  return $RC
-}
--- a/sources/native-builds/bootstrap-skeleton/files/init	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-#!/bin/bash
-
-# Start running here, and hand off to run-build-stages.sh in chroot.
-
-. /mnt/functions.sh
-
-[ -z "$NATIVE_BUILD" ] && NATIVE_BUILD=chroot
-
-# Always chroot, because even if root filesystem is writeable it's hard to
-# tell tar to skip /proc and /sys and such without unmounting bits of the
-# host environment.
-
-do_in_chroot /home/"$NATIVE_BUILD" /mnt/run-build-stages.sh
-
-if [ $? -eq 0 ]
-then
-  set_titlebar "upload tarball"
-  tar czvf "$NATIVE_BUILD".tar.gz "$NATIVE_BUILD" | dotprogress &&
-  upload_result "$NATIVE_BUILD".tar.gz
-fi
--- a/sources/native-builds/bootstrap-skeleton/files/run-build-stages.sh	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-# Run each of the individual package build files, in order.
-
-[ -z "$FILTER" ] || FILTER="/$FILTER/d"
-for i in $(sed -r -e "$FILTER" -e "s@#.*@@" /mnt/package-list)
-do
-  /mnt/build-one-package.sh "$i" || exit 1
-done
--- a/sources/native-builds/busybox-test.sh	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-#!/bin/bash
-
-# Run the busybox test suite.
-
-source sources/include.sh || exit 1
-
-[ $# -ne 1 ] && echo "usage: $0 FILENAME" >&2 && exit 1
-[ -e "$1" ] && echo "$1" exists && exit 0
-
-WORK="$BUILD/control-images/busybox-test" && blank_tempdir "$WORK"
-
-# Don't download busybox, it's got to already be there in standard sources.
-
-setupfor busybox
-cd "$TOP"
-
-cat > "$WORK"/init << 'EOF' || dienow
-#!/bin/bash
-
-echo === $HOST Run busybox test suite
-
-cp -sfR /mnt/busybox busybox && cd busybox &&
-make defconfig &&
-ln -s /bin/busybox busybox &&
-cd testsuite &&
-./runtest &&
-cd .. &&
-rm -rf busybox || exit 1
-
-sync
-
-EOF
-
-chmod +x "$WORK"/init || dienow
-
-mksquashfs "$WORK" "$1" -noappend -all-root
--- a/sources/native-builds/gentoo-bootstrap/README	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-Extend minimal native build environment into a seed for Gentoo Catalyst.
-
-This doesn't quite create an official Gentoo Stage 1.  We use busybox instead
-of gnu tools, we're uClibc-based instead of glibc-based, and we use our
-existing toolchain (with distcc acceleration) instead of asking portage
-to build one.  That said, this should be enough to run Catalyst and produce
-official Stage 1, Stage 2, and Stage 3 images.
-
-GFS used:
-
-  setup-base-packages.sh
-    strace, Python, ncurses, bash, tar, patch, findutils, file, pax-utils,
-    shadow
-  setup-portage.sh
-    /etc/passwd (root and portage), /etc/group (root and portage)
-    portage
--- a/sources/native-builds/gentoo-bootstrap/download.sh	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-# Download all the source tarballs we haven't got up-to-date copies of.
-
-URL=http://zlib.net/zlib-1.2.5.tar.bz2 \
-SHA1=543fa9abff0442edca308772d6cef85557677e02 \
-maybe_fork "download || dienow"
-
-URL=http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.7.tar.gz \
-SHA1=8233ee56ed84ae05421e4e6d6db6c1fe72ee6797 \
-maybe_fork "download || dienow"
-
-URL=http://python.org/ftp/python/2.6.5/Python-2.6.5.tar.bz2 \
-SHA1=24c94f5428a8c94c9d0b316e3019fee721fdb5d1 \
-RENAME='s/P/p/' \
-maybe_fork "download || dienow"
-
-URL=http://ftp.gnu.org/gnu/bash/bash-3.2.tar.gz \
-SHA1=fe6466c7ee98061e044dae0347ca5d1a8eab4a0d \
-maybe_fork "download || dienow"
-
-URL=http://www.samba.org/ftp/rsync/src/rsync-3.0.7.tar.gz \
-SHA1=63426a1bc71991d93159cd522521fbacdafb7a61 \
-maybe_fork "download || dienow"
-
-URL=http://ftp.gnu.org/gnu/patch/patch-2.5.9.tar.gz \
-SHA1=9a69f7191576549255f046487da420989d2834a6 \
-maybe_fork "download || dienow"
-
-URL=ftp://ftp.astron.com/pub/file/file-5.03.tar.gz \
-SHA1=f659a4e1fa96fbdc99c924ea8e2dc07319f046c1 \
-maybe_fork "download || dienow"
-
-URL=http://dev.gentoo.org/~zmedico/portage/archives/portage-2.1.8.tar.bz2 \
-SHA1=390c97f3783af2d9e52482747ead3681655ea9c3 \
-maybe_fork "download || dienow"
--- a/sources/native-builds/gentoo-bootstrap/make-control-image.sh	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-../bootstrap-skeleton/control-image-wrapper.sh
\ No newline at end of file
--- a/sources/native-builds/gentoo-bootstrap/mnt/build/bash.sh	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-# Portage uses bash ~= regex matches, which were introduced in bash 3.
-
-./configure --enable-cond-regexp --disable-nls --prefix=/usr &&
-make -j $CPUS &&
-make install
--- a/sources/native-builds/gentoo-bootstrap/mnt/build/file.sh	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-./configure --prefix=/usr &&
-make -j $CPUS &&
-make install
--- a/sources/native-builds/gentoo-bootstrap/mnt/build/ncurses.sh	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-./configure --without-cxx-binding --with-shared &&
-make -j $CPUS &&
-make install
--- a/sources/native-builds/gentoo-bootstrap/mnt/build/patch.sh	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-# Need a patch with --dry-run to make portage happy
-
-./configure --prefix=/usr &&
-make -j $CPUS &&
-make install
--- a/sources/native-builds/gentoo-bootstrap/mnt/build/portage.sh	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-#!/bin/sh
-
-# Portage isn't really designed to be portable, so this script contains
-# the "make install" stage that portage really should have within itself.
-
-# Install portage user/group, and libraries.
-
-echo portage:x:250:250:portage:/var/tmp/portage:/bin/false >> /etc/passwd &&
-echo portage::250:portage >> /etc/group &&
-mkdir -p /usr/lib/portage &&
-cp -a bin pym /usr/lib/portage/ &&
-
-# Add portage python modules to the python search path.
-
-echo /usr/lib/portage/pym > /usr/lib/python2.6/site-packages/gentoo.pth ||
-  exit 1
-
-# Install portage binaries into bin and sbin
-
-for i in archive-conf dispatch-conf emaint emerge-webrsync env-update \
-         etc-update fixpackages quickpkg regenworld
-do
-  ln /usr/lib/portage/bin/$i /usr/sbin/$i || exit 1
-done
-
-for i in  ebuild egencache emerge portageq repoman
-do
-  ln /usr/lib/portage/bin/$i /usr/bin/$i || exit 1
-done
-
-# Install portage man pages
-
-cp cnf/make.globals /etc/ &&
-cp man/*.1 /usr/man/man1 &&
-cp man/*.5 /usr/man/man5 &&
-
-mkdir -p /var/log /etc/portage/profile
--- a/sources/native-builds/gentoo-bootstrap/mnt/build/python.sh	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-./configure --prefix=/usr &&
-make -j $CPUS &&
-make install
--- a/sources/native-builds/gentoo-bootstrap/mnt/build/rsync.sh	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-./configure --prefix=/usr &&
-# Break link and touch file, otherwise ./configure tries to recreate it
-# which requires perl.
-cat proto.h-tstamp > proto.h.new &&
-mv -f proto.h.new proto.h-tstamp &&
-make -j $CPUS &&
-make install
--- a/sources/native-builds/gentoo-bootstrap/mnt/build/zlib.sh	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-# 1.2.5 accidentally shipped the Makefile, then configure tries to
-# modify it in place, which fails if the filesystem is read only.
-# The fix is to remove it before configuring.
-
-rm Makefile && 
-./configure --prefix=/usr &&
-make -j $CPUS &&
-make install
--- a/sources/native-builds/gentoo-bootstrap/mnt/files/emerge_wrapper.sh	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-#!/bin/bash
-
-if [ "$1" != "--sync" ]
-then
-  echo 'No portage tree, run "emerge --sync".' >&2
-  exit 1
-fi
-
-if [ "$(id -u)" -ne 0 ]
-then
-  echo "You are not root." >&2
-  exit 1
-fi
-
-echo "Downloading portage tree..."
-mkdir -p /var/log /usr/portage &&
-cd /usr &&
-#wget http://127.0.0.1/aboriginal/mirror/portage-latest.tar.bz2 -O - | \
-wget http://gentoo.osuosl.org/snapshots/portage-latest.tar.bz2 -O - | \
-  tar xjC /usr
-if [ ! -d portage ]
-then
-  echo "Failed to download portage-latest tarball." >&2
-  exit 1
-fi
-
-if ! emerge.real --sync
-then
-  echo "Sync failed"
-  exit 1
-fi
-
-cd $(dirname $(readlink -f $(which emerge.real)))
-mv emerge.real emerge
-
-echo "Portage tree initialized"
--- a/sources/native-builds/gentoo-bootstrap/mnt/files/etc/portage/profile/package.provided	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-# Base aboriginal system
-
-sys-devel/gcc-4.2.1
-sys-devel/binutils-2.17
-sys-devel/make-3.81
-sys-libs/uclibc-0.9.31
-sys-kernel/linux-headers-2.6.35
-sys-apps/busybox-1.17.2
-
-# Stuff busybox provides
-
-app-arch/gzip-1.0
-sys-apps/sed-1.0
-sys-apps/findutils-1.0
-sys-apps/diffutils-1.0
-app-editors/vim-1.0
-sys-apps/gawk-1.0
-app-arch/tar-1.0
-app-arch/bzip2-1.0
-app-arch/cpio-1.0
-sys-process/procps-1.0
-sys-apps/which-1.0
-sys-apps/net-tools-1.0
-sys-apps/sysvinit-1.0
-sys-apps/util-linux-1.0
-sys-apps/coreutils-1.0
-sys-apps/less-1.0
-sys-apps/grep-1.0      
-sys-apps/shadow-1.0    
-sys-apps/module-init-tools-1.0
-net-misc/wget-1.0
-app-arch/xz-utils-1.0
-
-# Upgrades for seed
-
-sys-apps/portage-2.1.8.3
-dev-lang/python-2.6.5
-sys-libs/zlib-1.2.5
-sys-libs/ncurses-5.7
-app-shells/bash-3.2
-net-misc/rsync-3.0.7
-sys-devel/patch-2.5.9
-sys-apps/file-5.03
--- a/sources/native-builds/gentoo-bootstrap/mnt/package-list	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-zlib ncurses python bash rsync patch file portage
--- a/sources/native-builds/gentoo-bootstrap/patches/portage-2.1.8.3.patch	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1155 +0,0 @@
-Index: ChangeLog
-===================================================================
---- a/ChangeLog	(revision 15731)
-+++ b/ChangeLog	(revision 15814)
-@@ -1,3 +1,178 @@
-+2010-03-10 00:31  zmedico
-+
-+	* [r15814] pym/_emerge/depgraph.py: Only try to merge portage asap
-+	  when the new version is different. (trunk r15813)
-+
-+2010-03-09 21:27  zmedico
-+
-+	* [r15812] pym/_emerge/Scheduler.py, pym/_emerge/depgraph.py: Only
-+	  create implicit libc deps when the version changes. (trunk
-+	  r15810)
-+
-+2010-03-09 21:25  zmedico
-+
-+	* [r15811] pym/_emerge/Scheduler.py, pym/_emerge/depgraph.py:
-+	  Disable implicit libc deps for ROOT != "/" since it's probably
-+	  not needed. (trunk r15809)
-+
-+2010-03-09 20:21  zmedico
-+
-+	* [r15808] pym/_emerge/depgraph.py: Merge libc asap for all roots
-+	  instead of just ROOT="/". (trunk r15804)
-+
-+2010-03-09 20:21  zmedico
-+
-+	* [r15807] pym/_emerge/sync/old_tree_timestamp.py: Add periods.
-+	  (trunk r15803)
-+
-+2010-03-09 20:20  zmedico
-+
-+	* [r15806] pym/_emerge/sync/old_tree_timestamp.py: Use ewarn output
-+	  style to add some color. (trunk r15802)
-+
-+2010-03-09 20:20  zmedico
-+
-+	* [r15805] man/portage.5: * Remove outdated profiles.desc sentence
-+	  about "1 profile allowed per stable/dev/KEYWORD". Thanks to
-+	  Torsten Veller <tove@g.o> for reporting.
-+	  
-+	  * Add 'exp' to valid profiles.desc status values, and update the
-+	  example. (trunk r15795)
-+
-+2010-03-09 08:11  zmedico
-+
-+	* [r15794] pym/portage/mail.py: Import 'email' and 'smtlib' locally
-+	  since python ebuilds remove the 'email' module when built with
-+	  USE=build. (trunk r15793)
-+
-+2010-03-09 05:04  zmedico
-+
-+	* [r15792] pym/_emerge/Scheduler.py: Add --debug output for the
-+	  scheduler digraph. (trunk r15790)
-+
-+2010-03-09 05:04  zmedico
-+
-+	* [r15791] pym/_emerge/Scheduler.py: If _implicit_libc_deps() finds
-+	  both a new-style virtual and an old-style PROVIDE virtual, use
-+	  the new-style virtual. (trunk r15789)
-+
-+2010-03-09 04:31  zmedico
-+
-+	* [r15788] pym/_emerge/actions.py: Add support for displaying
-+	  profile listed in make.profile/parent when make.profile is not a
-+	  symlink. The first parent with a path inside $PORTDIR is
-+	  displayed. (trunk r15787)
-+
-+2010-03-09 03:59  zmedico
-+
-+	* [r15786] pym/_emerge/Scheduler.py: Fix typo in parenthesis from
-+	  previous commit. (trunk r15784)
-+
-+2010-03-09 03:58  zmedico
-+
-+	* [r15785] pym/_emerge/Scheduler.py: Bug #303567 - Create implicit
-+	  dependencies on libc, in order to ensure that libc is installed
-+	  as early as possible. (trunk r15783)
-+
-+2010-03-09 02:42  zmedico
-+
-+	* [r15782] pym/portage/dbapi/vartree.py,
-+	  pym/portage/proxy/lazyimport.py: When portage upgrades or
-+	  downgrades itself, preload lazily referenced portage submodules
-+	  into memory so that imports won't fail later. (trunk r15778)
-+
-+2010-03-09 02:42  zmedico
-+
-+	* [r15781] man/emerge.1, pym/_emerge/help.py: Move --update from
-+	  the actions to the options section. (trunk r15777)
-+
-+2010-03-09 02:42  zmedico
-+
-+	* [r15780] man/emerge.1, pym/_emerge/help.py: Clean up/sync docs
-+	  for emerge --sync, and add a note about PORTAGE_SYNC_STALE.
-+	  (trunk r15776)
-+
-+2010-03-09 02:42  zmedico
-+
-+	* [r15779] man/emerge.1: Escape hyphens. (trunk r15775)
-+
-+2010-03-08 09:40  zmedico
-+
-+	* [r15772] pym/_emerge/sync/__init__.py: Add copyright header.
-+	  (trunk r15771)
-+
-+2010-03-08 09:10  zmedico
-+
-+	* [r15770] pym/_emerge/actions.py: Disable PORTAGE_SYNC_STALE
-+	  warnings when --usepkgonly is enabled. (trunk r15769)
-+
-+2010-03-08 09:05  zmedico
-+
-+	* [r15768] pym/portage/package/ebuild/config.py: Exclude
-+	  PORTAGE_SYNC_STALE from the ebuild environment. (trunk r15767)
-+
-+2010-03-08 08:57  zmedico
-+
-+	* [r15766] pym/_emerge/depgraph.py: Bug #307409 - Force --verbose
-+	  mode when displaying circular deps. (trunk r15765)
-+
-+2010-03-08 08:47  zmedico
-+
-+	* [r15764] pym/portage/mail.py: Bug #291331 - Force ascii encoding
-+	  in send_mail() in order to avoid UnicodeEncodeError from
-+	  smtplib.sendmail with python3. (trunk r15759)
-+
-+2010-03-08 08:47  zmedico
-+
-+	* [r15763] pym/_emerge/sync/old_tree_timestamp.py: Show --sync in
-+	  messages, to help avoid confusion. (trunk r15758)
-+
-+2010-03-08 08:47  zmedico
-+
-+	* [r15762] man/make.conf.5: Note that PORTAGE_SYNC_STALE=0 will
-+	  disable warnings. (trunk r15757)
-+
-+2010-03-08 08:47  zmedico
-+
-+	* [r15761] cnf/make.globals, man/make.conf.5,
-+	  pym/_emerge/actions.py, pym/_emerge/sync: Produce a warning
-+	  message if the timestamp of the portage tree is more than 30 days
-+	  old, and make it adjustable via the PORTAGE_SYNC_STALE variable.
-+	  Thanks to Ned Ludd <solar@g.o> for the most of this code. (trunk
-+	  r15756)
-+
-+2010-03-08 08:46  zmedico
-+
-+	* [r15760] pym/portage/package/ebuild/doebuild.py: Bug #308415 -
-+	  Fix broken uri parameter passed to fetch () for some cases when
-+	  using ebuild(1). (trunk r15755)
-+
-+2010-03-04 11:23  zmedico
-+
-+	* [r15749] pym/portage/package/ebuild/getmaskingstatus.py: Bug
-+	  #307723 - Define basestring for python3. (trunk r15745)
-+
-+2010-03-04 11:23  zmedico
-+
-+	* [r15748] pym/portage/package/ebuild/doebuild.py,
-+	  pym/portage/package/ebuild/fetch.py: Fix imports
-+	  doebuild_environment and prepare_build_dirs imports to import
-+	  from the real location instead of importing proxies. (trunk
-+	  r15744)
-+
-+2010-03-04 11:22  zmedico
-+
-+	* [r15747] pym/portage/package/ebuild/fetch.py: Bug #307707 - Fix
-+	  fetch() to use the correct spawn function when calling nofetch.
-+	  (trunk r15743)
-+
-+2010-03-04 11:22  zmedico
-+
-+	* [r15746] man/color.map.5, pym/_emerge/depgraph.py,
-+	  pym/portage/output.py: Add new colors for binary packages in the
-+	  merge list. Thanks to Sebastian Luther (few) for this patch.
-+	  (trunk r15739)
-+
- 2010-03-03 06:27  zmedico
- 
- 	* [r15731] NEWS: Add news about splitting the top-level
-Index: cnf/make.globals
-===================================================================
---- a/cnf/make.globals	(revision 15731)
-+++ b/cnf/make.globals	(revision 15814)
-@@ -1,6 +1,6 @@
- # Copyright 1999-2006 Gentoo Foundation
- # Distributed under the terms of the GNU General Public License v2
--# $Id: make.globals 15254 2010-01-29 18:49:10Z zmedico $
-+# $Id: make.globals 15761 2010-03-08 08:47:02Z zmedico $
- # System-wide defaults for the Portage system
- 
- #            *****************************
-@@ -80,6 +80,10 @@
- 
- PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
- 
-+# The number of days after the last `emerge --sync` that a warning
-+# message should be produced.
-+PORTAGE_SYNC_STALE="30"
-+
- # Minimal CONFIG_PROTECT
- CONFIG_PROTECT="/etc"
- CONFIG_PROTECT_MASK="/etc/env.d"
-Index: man/color.map.5
-===================================================================
---- a/man/color.map.5	(revision 15731)
-+++ b/man/color.map.5	(revision 15814)
-@@ -50,6 +50,15 @@
- \fBPKG_MERGE_WORLD\fR = \fI"green"\fR
- Defines color used for world packages planned to be merged.
- .TP
-+\fBPKG_BINARY_MERGE\fR = \fI"darkgreen"\fR
-+Defines color used for packages planned to be merged using a binary package.
-+.TP
-+\fBPKG_BINARY_MERGE_SYSTEM\fR = \fI"darkgreen"\fR
-+Defines color used for system packages planned to be merged using a binary package.
-+.TP
-+\fBPKG_BINARY_MERGE_WORLD\fR = \fI"green"\fR
-+Defines color used for world packages planned to be merged using a binary package.
-+.TP
- \fBPKG_NOMERGE\fR = \fI"darkblue"\fR
- Defines color used for packages not planned to be merged.
- .TP
-Index: man/emerge.1
-===================================================================
---- a/man/emerge.1	(revision 15731)
-+++ b/man/emerge.1	(revision 15814)
-@@ -195,7 +195,7 @@
- name starts with "kde"; \fBemerge \-\-search "%gcc$"\fR searches for any 
- package that ends with "gcc"; \fBemerge \-\-search "office"\fR searches for 
- any package that contains the word "office".  If you want to include the 
--category into the search string, prepend an @: \fBemerge --search 
-+category into the search string, prepend an @: \fBemerge \-\-search 
- "%@^dev-java.*jdk"\fR. If you want to search the package descriptions as well, 
- use the \fB\-\-searchdesc\fR action.
- .TP
-@@ -205,11 +205,26 @@
- matched as regular expressions.
- .TP
- .BR \-\-sync
--Initiates a portage tree update with one of the rsync.gentoo.org
--mirrors.  \fBNote that any changes you have made to the portage
--tree will be erased\fR.  Except for special circumstances, 
--this uses \fBrsync\fR to do the update.  See \fBmake.conf\fR(5)'s 
--description of PORTDIR_OVERLAY for a method to avoid deletions.
-+This updates the portage tree that is located in the
-+directory that the PORTDIR variable refers to (default
-+location is /usr/portage). The SYNC variable specifies
-+the remote URI from which files will be synchronized.
-+The \fBPORTAGE_SYNC_STALE\fR variable configures
-+warnings that are shown when emerge \-\-sync has not
-+been executed recently.
-+
-+\fBWARNING:\fR
-+The emerge \-\-sync action will modify and/or delete
-+files located inside the directory that the PORTDIR
-+variable refers to (default location is /usr/portage).
-+For more information, see the PORTDIR documentation in
-+the make.conf(5) man page.
-+
-+\fBNOTE:\fR
-+The \fBemerge\-webrsync\fR program will download the entire
-+portage tree as a tarball, which is much faster than emerge
-+\-\-sync for first time syncs.
-+
- .TP
- .BR "\-\-unmerge " (\fB\-C\fR)
- \fBWARNING: This action can remove important packages!\fR Removes
-@@ -219,13 +234,6 @@
- \fIebuilds\fR. For a dependency aware version of \fB\-\-unmerge\fR,
- use \fB\-\-depclean\fR or \fB\-\-prune\fR.
- .TP
--.BR "\-\-update " (\fB\-u\fR)
--Updates packages to the best version available, which may not always be the 
--highest version number due to masking for testing and development.
--Package atoms
--specified on the command line are greedy, meaning that unspecific atoms may
--match multiple installed versions of slotted packages.
--.TP
- .BR "\-\-version " (\fB\-V\fR)
- Displays the version number of \fBemerge\fR.
- .SH "OPTIONS"
-@@ -536,6 +544,13 @@
- constraint is removed, hopefully leading to a more
- readable dependency tree.
- .TP
-+.BR "\-\-update " (\fB\-u\fR)
-+Updates packages to the best version available, which may
-+not always be the  highest version number due to masking
-+for testing and development. Package atoms specified on
-+the command line are greedy, meaning that unspecific
-+atoms may match multiple versions of slotted packages.
-+.TP
- .BR "\-\-use\-ebuild\-visibility[=n]"
- Use unbuilt ebuild metadata for visibility
- checks on built packages.
-Index: man/make.conf.5
-===================================================================
---- a/man/make.conf.5	(revision 15731)
-+++ b/man/make.conf.5	(revision 15814)
-@@ -639,6 +639,12 @@
- .br
- Defaults to 3.
- .TP
-+\fBPORTAGE_SYNC_STALE\fR = \fI[NUMBER]\fR
-+Defines the number of days after the last `emerge \-\-sync` that a warning
-+message should be produced. A value of 0 will disable warnings.
-+.br
-+Defaults to 30.
-+.TP
- \fBPORTAGE_TMPDIR\fR = \fI[path]\fR
- Defines the location of the temporary build directories.
- .br
-Index: man/portage.5
-===================================================================
---- a/man/portage.5	(revision 15731)
-+++ b/man/portage.5	(revision 15814)
-@@ -751,23 +751,22 @@
- .TP
- .BR profiles.desc
- List all the current stable and development profiles.  If a profile is listed 
--here, then it will be checked by repoman.  At the moment, only 1 profile is 
--allowed per stable/dev/KEYWORD; the last one found is the last one used.
--
-+here, then it will be checked by repoman.
- .I Format:
- .nf
- \- comments begin with # (no inline comments)
- \- one profile list per line in format: arch dir status
- \- arch must be listed in arch.list
- \- dir is relative to profiles.desc
--\- status must be 'stable' or 'dev'
-+\- status must be 'stable', 'dev', or 'exp'
- .fi
- 
- .I Example:
- .nf
--alpha default-linux/alpha/2004.3 stable
--m68k  default-linux/m68k         dev
--x86   default-linux/x86/2004.3   stable
-+alpha        default/linux/alpha/10.0    stable
-+m68k         default/linux/m68k/10.0     dev
-+x86          default/linux/x86/10.0      stable
-+x86-linux    prefix/linux/x86            exp
- .fi
- .TP
- .BR repo_name
-Index: pym/_emerge/actions.py
-===================================================================
---- a/pym/_emerge/actions.py	(revision 15731)
-+++ b/pym/_emerge/actions.py	(revision 15814)
-@@ -1,6 +1,6 @@
- # Copyright 1999-2009 Gentoo Foundation
- # Distributed under the terms of the GNU General Public License v2
--# $Id: actions.py 15687 2010-03-02 21:07:53Z zmedico $
-+# $Id: actions.py 15788 2010-03-09 04:31:13Z zmedico $
- 
- from __future__ import print_function
- 
-@@ -53,6 +53,7 @@
- from _emerge.search import search
- from _emerge.SetArg import SetArg
- from _emerge.show_invalid_depstring_notice import show_invalid_depstring_notice
-+from _emerge.sync.old_tree_timestamp import old_tree_timestamp_warn
- from _emerge.unmerge import unmerge
- from _emerge.UnmergeDepPriority import UnmergeDepPriority
- from _emerge.UseFlagDisplay import UseFlagDisplay
-@@ -64,6 +65,9 @@
- def action_build(settings, trees, mtimedb,
- 	myopts, myaction, myfiles, spinner):
- 
-+	if '--usepkgonly' not in myopts:
-+		old_tree_timestamp_warn(settings['PORTDIR'], settings)
-+
- 	# validate the state of the resume data
- 	# so that we can make assumptions later.
- 	for k in ("resume", "resume_backup"):
-@@ -2249,19 +2253,38 @@
- 	writemsg_level("".join("%s\n" % l for l in msg),
- 		level=logging.ERROR, noiselevel=-1)
- 
-+def relative_profile_path(portdir, abs_profile):
-+	realpath = os.path.realpath(abs_profile)
-+	basepath   = os.path.realpath(os.path.join(portdir, "profiles"))
-+	if realpath.startswith(basepath):
-+		profilever = realpath[1 + len(basepath):]
-+	else:
-+		profilever = None
-+	return profilever
-+
- def getportageversion(portdir, target_root, profile, chost, vardb):
--	profilever = "unavailable"
-+	profilever = None
- 	if profile:
--		realpath = os.path.realpath(profile)
--		basepath   = os.path.realpath(os.path.join(portdir, "profiles"))
--		if realpath.startswith(basepath):
--			profilever = realpath[1 + len(basepath):]
--		else:
-+		profilever = relative_profile_path(portdir, profile)
-+		if profilever is None:
- 			try:
--				profilever = "!" + os.readlink(profile)
--			except (OSError):
-+				for parent in portage.grabfile(
-+					os.path.join(profile, 'parent')):
-+					profilever = relative_profile_path(portdir,
-+						os.path.join(profile, parent))
-+					if profilever is not None:
-+						break
-+			except portage.exception.PortageException:
- 				pass
--		del realpath, basepath
-+
-+			if profilever is None:
-+				try:
-+					profilever = "!" + os.readlink(profile)
-+				except (OSError):
-+					pass
-+
-+	if profilever is None:
-+		profilever = "unavailable"
- 
- 	libcver=[]
- 	libclist  = vardb.match("virtual/libc")
-Index: pym/_emerge/depgraph.py
-===================================================================
---- a/pym/_emerge/depgraph.py	(revision 15731)
-+++ b/pym/_emerge/depgraph.py	(revision 15814)
-@@ -1,6 +1,6 @@
- # Copyright 1999-2009 Gentoo Foundation
- # Distributed under the terms of the GNU General Public License v2
--# $Id: depgraph.py 15711 2010-03-02 21:14:20Z zmedico $
-+# $Id: depgraph.py 15814 2010-03-10 00:31:43Z zmedico $
- 
- from __future__ import print_function
- 
-@@ -3341,7 +3341,9 @@
- 		if replacement_portage == running_portage:
- 			replacement_portage = None
- 
--		if replacement_portage is not None:
-+		if replacement_portage is not None and \
-+			(running_portage is None or \
-+			(running_portage.cpv != replacement_portage.cpv)):
- 			# update from running_portage to replacement_portage asap
- 			asap_nodes.append(replacement_portage)
- 
-@@ -3363,12 +3365,16 @@
- 
- 		# Merge libc asap, in order to account for implicit
- 		# dependencies. See bug #303567.
--		libc_pkg = self._dynamic_config.mydbapi[running_root].match_pkgs(
--			portage.const.LIBC_PACKAGE_ATOM)
--		if libc_pkg:
--			libc_pkg = libc_pkg[0]
--			if libc_pkg.operation == 'merge':
--				asap_nodes.append(libc_pkg)
-+		for root in (running_root,):
-+			libc_pkg = self._dynamic_config.mydbapi[root].match_pkgs(
-+				portage.const.LIBC_PACKAGE_ATOM)
-+			if libc_pkg:
-+				libc_pkg = libc_pkg[0]
-+				if libc_pkg.operation == 'merge':
-+					# Only add a dep when the version changes.
-+					if not libc_pkg.root_config.trees[
-+						'vartree'].dbapi.cpv_exists(libc_pkg.cpv):
-+						asap_nodes.append(libc_pkg)
- 
- 		def gather_deps(ignore_priority, mergeable_nodes,
- 			selected_nodes, node):
-@@ -3904,7 +3910,7 @@
- 			tempgraph.remove(node)
- 		display_order.reverse()
- 		self._frozen_config.myopts.pop("--quiet", None)
--		self._frozen_config.myopts.pop("--verbose", None)
-+		self._frozen_config.myopts["--verbose"] = True
- 		self._frozen_config.myopts["--tree"] = True
- 		portage.writemsg("\n\n", noiselevel=-1)
- 		self.display(display_order)
-@@ -4500,12 +4506,20 @@
- 
- 				def pkgprint(pkg_str):
- 					if pkg_merge:
--						if pkg_system:
--							return colorize("PKG_MERGE_SYSTEM", pkg_str)
--						elif pkg_world:
--							return colorize("PKG_MERGE_WORLD", pkg_str)
-+						if built:
-+							if pkg_system:
-+								return colorize("PKG_BINARY_MERGE_SYSTEM", pkg_str)
-+							elif pkg_world:
-+								return colorize("PKG_BINARY_MERGE_WORLD", pkg_str)
-+							else:
-+								return colorize("PKG_BINARY_MERGE", pkg_str)
- 						else:
--							return colorize("PKG_MERGE", pkg_str)
-+							if pkg_system:
-+								return colorize("PKG_MERGE_SYSTEM", pkg_str)
-+							elif pkg_world:
-+								return colorize("PKG_MERGE_WORLD", pkg_str)
-+							else:
-+								return colorize("PKG_MERGE", pkg_str)
- 					elif pkg_status == "uninstall":
- 						return colorize("PKG_UNINSTALL", pkg_str)
- 					else:
-Index: pym/_emerge/help.py
-===================================================================
---- a/pym/_emerge/help.py	(revision 15731)
-+++ b/pym/_emerge/help.py	(revision 15814)
-@@ -1,6 +1,6 @@
- # Copyright 1999-2009 Gentoo Foundation
- # Distributed under the terms of the GNU General Public License v2
--# $Id: help.py 15687 2010-03-02 21:07:53Z zmedico $
-+# $Id: help.py 15781 2010-03-09 02:42:23Z zmedico $
- 
- from __future__ import print_function
- 
-@@ -195,18 +195,31 @@
- 		print("                emerge -S 'perl.*module'")
- 		print()
- 		print("       "+green("--sync"))
--		print("              Tells emerge to update the Portage tree as specified in")
--		print("              The SYNC variable found in /etc/make.conf.  By default, SYNC instructs")
--		print("              emerge to perform an rsync-style update with rsync.gentoo.org.")
-+		desc = "This updates the portage tree that is located in the " + \
-+			"directory that the PORTDIR variable refers to (default " + \
-+			"location is /usr/portage). The SYNC variable specifies " + \
-+			"the remote URI from which files will be synchronized. " + \
-+			"The PORTAGE_SYNC_STALE variable configures " + \
-+			"warnings that are shown when emerge --sync has not " + \
-+			"been executed recently."
-+		for line in wrap(desc, desc_width):
-+			print(desc_indent + line)
- 		print()
--		print("              'emerge-webrsync' exists as a helper app to emerge --sync, providing a")
--		print("              method to receive the entire portage tree as a tarball that can be")
--		print("              extracted and used. First time syncs would benefit greatly from this.")
-+		print(desc_indent + turquoise("WARNING:"))
-+		desc = "The emerge --sync action will modify and/or delete " + \
-+			"files located inside the directory that the PORTDIR " + \
-+			"variable refers to (default location is /usr/portage). " + \
-+			"For more information, see the PORTDIR documentation in " + \
-+			"the make.conf(5) man page."
-+		for line in wrap(desc, desc_width):
-+			print(desc_indent + line)
- 		print()
--		print("              "+turquoise("WARNING:"))
--		print("              If using our rsync server, emerge will clean out all files that do not")
--		print("              exist on it, including ones that you may have created. The exceptions")
--		print("              to this are the distfiles, local and packages directories.")
-+		print(desc_indent + green("NOTE:"))
-+		desc = "The emerge-webrsync program will download the entire " + \
-+			"portage tree as a tarball, which is much faster than emerge " + \
-+			"--sync for first time syncs."
-+		for line in wrap(desc, desc_width):
-+			print(desc_indent + line)
- 		print()
- 		print("       "+green("--unmerge")+" ("+green("-C")+" short option)")
- 		print("              "+turquoise("WARNING: This action can remove important packages!"))
-@@ -216,13 +229,6 @@
- 		print("              ebuilds. For a dependency aware version of --unmerge, use")
- 		print("              --depclean or --prune.")
- 		print()
--		print("       "+green("--update")+" ("+green("-u")+" short option)")
--		print("              Updates packages to the best version available, which may not")
--		print("              always be the highest version number due to masking for testing")
--		print("              and development. Package atoms specified on the command")
--		print("              line are greedy, meaning that unspecific atoms may match multiple")
--		print("              installed versions of slotted packages.")
--		print()
- 		print("       "+green("--version")+" ("+green("-V")+" short option)")
- 		print("              Displays the currently installed version of portage along with")
- 		print("              other information useful for quick reference on a system. See")
-@@ -591,6 +597,15 @@
- 		for line in wrap(desc, desc_width):
- 			print(desc_indent + line)
- 		print()
-+		print("       "+green("--update")+" ("+green("-u")+" short option)")
-+		desc = "Updates packages to the best version available, which may " + \
-+			"not always be the  highest version number due to masking " + \
-+			"for testing and development. Package atoms specified on " + \
-+			"the command line are greedy, meaning that unspecific " + \
-+			"atoms may match multiple versions of slotted packages."
-+		for line in wrap(desc, desc_width):
-+			print(desc_indent + line)
-+		print()
- 		print("       " + green("--use-ebuild-visibility") + "[=%s]" % turquoise("n"))
- 		desc = "Use unbuilt ebuild metadata for visibility " + \
- 			"checks on built packages."
-Index: pym/_emerge/Scheduler.py
-===================================================================
---- a/pym/_emerge/Scheduler.py	(revision 15731)
-+++ b/pym/_emerge/Scheduler.py	(revision 15814)
-@@ -1,6 +1,6 @@
- # Copyright 1999-2009 Gentoo Foundation
- # Distributed under the terms of the GNU General Public License v2
--# $Id: Scheduler.py 15708 2010-03-02 21:13:39Z zmedico $
-+# $Id: Scheduler.py 15812 2010-03-09 21:27:32Z zmedico $
- 
- from __future__ import print_function
- 
-@@ -18,6 +18,7 @@
- from portage import _unicode_decode
- from portage import _unicode_encode
- from portage.cache.mappings import slot_dict_class
-+from portage.const import LIBC_PACKAGE_ATOM
- from portage.elog.messages import eerror
- from portage.output import colorize, create_color_func, darkgreen, red
- bad = create_color_func("BAD")
-@@ -351,6 +352,11 @@
- 		self._find_system_deps()
- 		self._prune_digraph()
- 		self._prevent_builddir_collisions()
-+		self._implicit_libc_deps()
-+		if '--debug' in self.myopts:
-+			writemsg("\nscheduler digraph:\n\n", noiselevel=-1)
-+			self._digraph.debug_print()
-+			writemsg("\n", noiselevel=-1)
- 
- 	def _find_system_deps(self):
- 		"""
-@@ -412,6 +418,69 @@
- 					priority=DepPriority(buildtime=True))
- 			cpv_map[pkg.cpv].append(pkg)
- 
-+	def _implicit_libc_deps(self):
-+		"""
-+		Create implicit dependencies on libc, in order to ensure that libc
-+		is installed as early as possible (see bug #303567). If the merge
-+		list contains both a new-style virtual and an old-style PROVIDE
-+		virtual, the new-style virtual is used.
-+		"""
-+		implicit_libc_roots = set([self._running_root.root])
-+		libc_set = InternalPackageSet([LIBC_PACKAGE_ATOM])
-+		norm_libc_pkgs = {}
-+		virt_libc_pkgs = {}
-+		for pkg in self._mergelist:
-+			if not isinstance(pkg, Package):
-+				# a satisfied blocker
-+				continue
-+			if pkg.installed:
-+				continue
-+			if pkg.root in implicit_libc_roots and \
-+				pkg.operation == 'merge':
-+				if libc_set.findAtomForPackage(pkg):
-+					if pkg.category == 'virtual':
-+						d = virt_libc_pkgs
-+					else:
-+						d = norm_libc_pkgs
-+					if pkg.root in d:
-+						raise AssertionError(
-+							"found 2 libc matches: %s and %s" % \
-+							(d[pkg.root], pkg))
-+					d[pkg.root] = pkg
-+
-+		# Prefer new-style virtuals over old-style PROVIDE virtuals.
-+		libc_pkg_map = norm_libc_pkgs.copy()
-+		libc_pkg_map.update(virt_libc_pkgs)
-+
-+		# Only add a dep when the version changes.
-+		for libc_pkg in list(libc_pkg_map.values()):
-+			if libc_pkg.root_config.trees['vartree'].dbapi.cpv_exists(
-+				libc_pkg.cpv):
-+				del libc_pkg_map[pkg.root]
-+
-+		if not libc_pkg_map:
-+			return
-+
-+		libc_pkgs = set(libc_pkg_map.values())
-+		earlier_libc_pkgs = set()
-+
-+		for pkg in self._mergelist:
-+			if not isinstance(pkg, Package):
-+				# a satisfied blocker
-+				continue
-+			if pkg.installed:
-+				continue
-+			if pkg.root in implicit_libc_roots and \
-+				pkg.operation == 'merge':
-+				if pkg in libc_pkgs:
-+					earlier_libc_pkgs.add(pkg)
-+				else:
-+					my_libc = libc_pkg_map.get(pkg.root)
-+					if my_libc is not None and \
-+						my_libc in earlier_libc_pkgs:
-+						self._digraph.add(my_libc, pkg,
-+							priority=DepPriority(buildtime=True))
-+
- 	class _pkg_failure(portage.exception.PortageException):
- 		"""
- 		An instance of this class is raised by unmerge() when
-Index: pym/_emerge/sync/__init__.py
-===================================================================
---- a/pym/_emerge/sync/__init__.py	(revision 15731)
-+++ b/pym/_emerge/sync/__init__.py	(revision 15814)
-@@ -0,0 +1,3 @@
-+# Copyright 2010 Gentoo Foundation
-+# Distributed under the terms of the GNU General Public License v2
-+# $Id: __init__.py 15772 2010-03-08 09:40:46Z zmedico $
-Index: pym/_emerge/sync/old_tree_timestamp.py
-===================================================================
---- a/pym/_emerge/sync/old_tree_timestamp.py	(revision 15731)
-+++ b/pym/_emerge/sync/old_tree_timestamp.py	(revision 15814)
-@@ -0,0 +1,99 @@
-+# Copyright 2010 Gentoo Foundation
-+# Distributed under the terms of the GNU General Public License v2
-+# $Id: old_tree_timestamp.py 15807 2010-03-09 20:21:05Z zmedico $
-+
-+import locale
-+import logging
-+import time
-+
-+from portage import os
-+from portage.exception import PortageException
-+from portage.localization import _
-+from portage.output import EOutput
-+from portage.util import grabfile, writemsg_level
-+
-+def have_english_locale():
-+	lang, enc = locale.getdefaultlocale()
-+	if lang is not None:
-+		lang = lang.lower()
-+		lang = lang.split('_', 1)[0]
-+	return lang is None or lang in ('c', 'en')
-+
-+def whenago(seconds):
-+	sec = int(seconds)
-+	mins = 0
-+	days = 0
-+	hrs = 0
-+	years = 0
-+	out = []
-+
-+	if sec > 60:
-+		mins = sec / 60
-+		sec = sec % 60
-+	if mins > 60:
-+		hrs = mins / 60
-+		mins = mins % 60
-+	if hrs > 24:
-+		days = hrs / 24
-+		hrs = hrs % 24
-+	if days > 365:
-+		years = days / 365
-+		days = days % 365
-+
-+	if years:
-+		out.append(str(years)+"y ")
-+	if days:
-+		out.append(str(days)+"d ")
-+	if hrs:
-+		out.append(str(hrs)+"h ")
-+	if mins:
-+		out.append(str(mins)+"m ")
-+	if sec:
-+		out.append(str(sec)+"s ")
-+
-+	return "".join(out).strip()
-+
-+def old_tree_timestamp_warn(portdir, settings):
-+	unixtime = time.time()
-+	default_warnsync = 30
-+
-+	timestamp_file = os.path.join(portdir, "metadata/timestamp.x")
-+	try:
-+		lastsync = grabfile(timestamp_file)
-+	except PortageException:
-+		return False
-+
-+	if not lastsync:
-+		return False
-+
-+	lastsync = lastsync[0].split()
-+	if not lastsync:
-+		return False
-+
-+	try:
-+		lastsync = int(lastsync[0])
-+	except ValueError:
-+		return False
-+
-+	var_name = 'PORTAGE_SYNC_STALE'
-+	try:
-+		warnsync = float(settings.get(var_name, default_warnsync))
-+	except ValueError:
-+		writemsg_level("!!! %s contains non-numeric value: %s\n" % \
-+			(var_name, settings[var_name]),
-+			level=logging.ERROR, noiselevel=-1)
-+		return False
-+
-+	if warnsync <= 0:
-+		return False
-+
-+	if (unixtime - 86400 * warnsync) > lastsync:
-+		out = EOutput()
-+		if have_english_locale():
-+			out.ewarn("Last emerge --sync was %s ago." % \
-+				whenago(unixtime - lastsync))
-+		else:
-+			out.ewarn(_("Last emerge --sync was %s.") % \
-+				time.strftime('%c', time.localtime(lastsync)))
-+		return True
-+	return False
-Index: pym/portage/dbapi/vartree.py
-===================================================================
---- a/pym/portage/dbapi/vartree.py	(revision 15731)
-+++ b/pym/portage/dbapi/vartree.py	(revision 15814)
-@@ -1,6 +1,6 @@
- # Copyright 1998-2009 Gentoo Foundation
- # Distributed under the terms of the GNU General Public License v2
--# $Id: vartree.py 15727 2010-03-03 01:27:27Z zmedico $
-+# $Id: vartree.py 15782 2010-03-09 02:42:40Z zmedico $
- 
- __all__ = [
- 	"vardbapi", "vartree", "dblink"] + \
-@@ -3181,6 +3181,9 @@
- 		if self.myroot == "/" and \
- 			match_from_list(PORTAGE_PACKAGE_ATOM, [self.mycpv]) and \
- 			not self.vartree.dbapi.cpv_exists(self.mycpv):
-+			# Load lazily referenced portage submodules into memory,
-+			# so imports won't fail during portage upgrade/downgrade.
-+			portage.proxy.lazyimport._preload_portage_submodules()
- 			settings = self.settings
- 			base_path_orig = os.path.dirname(settings["PORTAGE_BIN_PATH"])
- 			from tempfile import mkdtemp
-Index: pym/portage/mail.py
-===================================================================
---- a/pym/portage/mail.py	(revision 15731)
-+++ b/pym/portage/mail.py	(revision 15814)
-@@ -1,36 +1,43 @@
- # portage.py -- core Portage functionality
- # Copyright 1998-2004 Gentoo Foundation
- # Distributed under the terms of the GNU General Public License v2
--# $Id: mail.py 14860 2009-11-21 04:04:37Z zmedico $
-+# $Id: mail.py 15794 2010-03-09 08:11:46Z zmedico $
-+
-+# Since python ebuilds remove the 'email' module when USE=build
-+# is enabled, use a local import so that
-+# portage.proxy.lazyimport._preload_portage_submodules()
-+# can load this module even though the 'email' module is missing.
-+# The elog mail modules won't work, but at least an ImportError
-+# won't cause portage to crash during stage builds. Since the
-+# 'smtlib' module imports the 'email' module, that's imported
-+# locally as well.
- 
--from email.mime.text import MIMEText
--from email.mime.multipart import MIMEMultipart as MultipartMessage
--from email.mime.base import MIMEBase as BaseMessage
--from email.header import Header
--import smtplib
- import socket
- import sys
- import time
- 
- from portage import os
- from portage import _encodings
--from portage import _unicode_encode
-+from portage import _unicode_decode, _unicode_encode
- from portage.localization import _
- import portage
- 
- if sys.hexversion >= 0x3000000:
- 	basestring = str
- 
--if sys.hexversion >= 0x3000000:
--	def TextMessage(_text):
--		mimetext = MIMEText(_text)
-+def TextMessage(_text):
-+	from email.mime.text import MIMEText
-+	mimetext = MIMEText(_text)
-+	if sys.hexversion >= 0x3000000:
- 		mimetext.set_charset("UTF-8")
--		return mimetext
--else:
--	TextMessage = MIMEText
-+	return mimetext
- 
- def create_message(sender, recipient, subject, body, attachments=None):
- 
-+	from email.header import Header
-+	from email.mime.base import MIMEBase as BaseMessage
-+	from email.mime.multipart import MIMEMultipart as MultipartMessage
-+
- 	if sys.hexversion < 0x3000000:
- 		sender = _unicode_encode(sender,
- 			encoding=_encodings['content'], errors='strict')
-@@ -69,6 +76,9 @@
- 	return mymessage
- 
- def send_mail(mysettings, message):
-+
-+	import smtplib
-+
- 	mymailhost = "localhost"
- 	mymailport = 25
- 	mymailuser = ""
-@@ -135,7 +145,17 @@
- 				myconn = smtplib.SMTP(mymailhost, mymailport)
- 			if mymailuser != "" and mymailpasswd != "":
- 				myconn.login(mymailuser, mymailpasswd)
--			myconn.sendmail(myfrom, myrecipient, message.as_string())
-+
-+			message_str = message.as_string()
-+			if sys.hexversion >= 0x3000000:
-+				# Force ascii encoding in order to avoid UnicodeEncodeError
-+				# from smtplib.sendmail with python3 (bug #291331).
-+				message_str = _unicode_encode(message_str,
-+					encoding='ascii', errors='backslashreplace')
-+				message_str = _unicode_decode(message_str,
-+					encoding='ascii', errors='replace')
-+
-+			myconn.sendmail(myfrom, myrecipient, message_str)
- 			myconn.quit()
- 		except smtplib.SMTPException as e:
- 			raise portage.exception.PortageException(_("!!! An error occured while trying to send logmail:\n")+str(e))
-Index: pym/portage/output.py
-===================================================================
---- a/pym/portage/output.py	(revision 15731)
-+++ b/pym/portage/output.py	(revision 15814)
-@@ -1,6 +1,6 @@
- # Copyright 1998-2009 Gentoo Foundation
- # Distributed under the terms of the GNU General Public License v2
--# $Id: output.py 15245 2010-01-29 18:47:30Z zmedico $
-+# $Id: output.py 15746 2010-03-04 11:22:15Z zmedico $
- 
- __docformat__ = "epytext"
- 
-@@ -139,6 +139,9 @@
- _styles["PKG_MERGE"]               = ( "darkgreen", )
- _styles["PKG_MERGE_SYSTEM"]        = ( "darkgreen", )
- _styles["PKG_MERGE_WORLD"]         = ( "green", )
-+_styles["PKG_BINARY_MERGE"]        = ( "darkgreen", )
-+_styles["PKG_BINARY_MERGE_SYSTEM"] = ( "darkgreen", )
-+_styles["PKG_BINARY_MERGE_WORLD"]  = ( "green", )
- _styles["PKG_UNINSTALL"]           = ( "red", )
- _styles["PKG_NOMERGE"]             = ( "darkblue", )
- _styles["PKG_NOMERGE_SYSTEM"]      = ( "darkblue", )
-Index: pym/portage/package/ebuild/config.py
-===================================================================
---- a/pym/portage/package/ebuild/config.py	(revision 15731)
-+++ b/pym/portage/package/ebuild/config.py	(revision 15814)
-@@ -1,6 +1,6 @@
- # Copyright 2010 Gentoo Foundation
- # Distributed under the terms of the GNU General Public License v2
--# $Id: config.py 15705 2010-03-02 21:11:02Z zmedico $
-+# $Id: config.py 15768 2010-03-08 09:05:13Z zmedico $
- 
- __all__ = [
- 	'autouse', 'best_from_dict', 'check_config_instance', 'config',
-@@ -274,7 +274,8 @@
- 		"PORTAGE_REPO_DUPLICATE_WARN",
- 		"PORTAGE_RO_DISTDIRS",
- 		"PORTAGE_RSYNC_EXTRA_OPTS", "PORTAGE_RSYNC_OPTS",
--		"PORTAGE_RSYNC_RETRIES", "PORTAGE_USE", "PORT_LOGDIR",
-+		"PORTAGE_RSYNC_RETRIES", "PORTAGE_SYNC_STALE",
-+		"PORTAGE_USE", "PORT_LOGDIR",
- 		"QUICKPKG_DEFAULT_OPTS",
- 		"RESUMECOMMAND", "RESUMECOMMAND_HTTP", "RESUMECOMMAND_HTTP",
- 		"RESUMECOMMAND_SFTP", "SYNC", "USE_EXPAND_HIDDEN", "USE_ORDER",
-Index: pym/portage/package/ebuild/doebuild.py
-===================================================================
---- a/pym/portage/package/ebuild/doebuild.py	(revision 15731)
-+++ b/pym/portage/package/ebuild/doebuild.py	(revision 15814)
-@@ -1,6 +1,6 @@
- # Copyright 2010 Gentoo Foundation
- # Distributed under the terms of the GNU General Public License v2
--# $Id: doebuild.py 15713 2010-03-02 21:14:43Z zmedico $
-+# $Id: doebuild.py 15760 2010-03-08 08:46:53Z zmedico $
- 
- __all__ = ['doebuild', 'doebuild_environment', 'spawn', 'spawnebuild']
- 
-@@ -25,6 +25,7 @@
- 	'portage.package.ebuild.config:check_config_instance',
- 	'portage.package.ebuild.digestcheck:digestcheck',
- 	'portage.package.ebuild.digestgen:digestgen',
-+	'portage.package.ebuild.fetch:fetch',
- 	'portage.util.ExtractKernelVersion:ExtractKernelVersion'
- )
- 
-@@ -47,7 +48,6 @@
- from portage.localization import _
- from portage.manifest import Manifest
- from portage.output import style_to_ansi_code
--from portage.package.ebuild.fetch import fetch
- from portage.package.ebuild.prepare_build_dirs import prepare_build_dirs
- from portage.util import apply_recursive_permissions, \
- 	apply_secpass_permissions, noiselimit, normalize_path, \
-@@ -810,7 +810,8 @@
- 			mydo not in ("digest", "manifest") and "noauto" not in features)
- 		alist = mysettings.configdict["pkg"].get("A")
- 		aalist = mysettings.configdict["pkg"].get("AA")
--		if alist is None or aalist is None:
-+		if alist is None or aalist is None or \
-+			(not emerge_skip_distfiles and need_distfiles):
- 			# Make sure we get the correct tree in case there are overlays.
- 			mytree = os.path.realpath(
- 				os.path.dirname(os.path.dirname(mysettings["O"])))
-@@ -827,25 +828,26 @@
- 				return 1
- 			mysettings.configdict["pkg"]["A"] = " ".join(alist)
- 			mysettings.configdict["pkg"]["AA"] = " ".join(aalist)
-+
-+			if not emerge_skip_distfiles and need_distfiles:
-+				if "mirror" in features or fetchall:
-+					fetchme = aalist
-+				else:
-+					fetchme = alist
-+				if not fetch(fetchme, mysettings, listonly=listonly,
-+					fetchonly=fetchonly):
-+					return 1
-+
- 		else:
- 			alist = set(alist.split())
- 			aalist = set(aalist.split())
--		if ("mirror" in features) or fetchall:
--			fetchme = aalist
--			checkme = aalist
--		else:
--			fetchme = alist
--			checkme = alist
- 
- 		if mydo == "fetch":
- 			# Files are already checked inside fetch(),
- 			# so do not check them again.
- 			checkme = []
--
--		if not emerge_skip_distfiles and \
--			need_distfiles and not fetch(
--			fetchme, mysettings, listonly=listonly, fetchonly=fetchonly):
--			return 1
-+		else:
-+			checkme = alist
- 
- 		if mydo == "fetch" and listonly:
- 			return 0
-Index: pym/portage/package/ebuild/fetch.py
-===================================================================
---- a/pym/portage/package/ebuild/fetch.py	(revision 15731)
-+++ b/pym/portage/package/ebuild/fetch.py	(revision 15814)
-@@ -1,6 +1,6 @@
- # Copyright 2010 Gentoo Foundation
- # Distributed under the terms of the GNU General Public License v2
--# $Id: fetch.py 15718 2010-03-02 21:37:48Z zmedico $
-+# $Id: fetch.py 15748 2010-03-04 11:23:00Z zmedico $
- 
- from __future__ import print_function
- 
-@@ -20,18 +20,26 @@
- import portage
- portage.proxy.lazyimport.lazyimport(globals(),
- 	'portage.package.ebuild.config:check_config_instance,config',
-+	'portage.package.ebuild.doebuild:doebuild_environment,' + \
-+		'spawn@doebuild_spawn',
-+	'portage.package.ebuild.prepare_build_dirs:prepare_build_dirs',
- )
- 
--from portage import doebuild_environment, OrderedDict, os, prepare_build_dirs, selinux, _encodings, _shell_quote, _unicode_encode
-+from portage import OrderedDict, os, selinux, _encodings, \
-+	_shell_quote, _unicode_encode
- from portage.checksum import perform_md5, verify_all
--from portage.const import BASH_BINARY, CUSTOM_MIRRORS_FILE, EBUILD_SH_BINARY, GLOBAL_CONFIG_PATH
-+from portage.const import BASH_BINARY, CUSTOM_MIRRORS_FILE, \
-+	EBUILD_SH_BINARY, GLOBAL_CONFIG_PATH
- from portage.data import portage_gid, portage_uid, secpass, userpriv_groups
--from portage.exception import FileNotFound, OperationNotPermitted, PermissionDenied, PortageException, TryAgain
-+from portage.exception import FileNotFound, OperationNotPermitted, \
-+	PermissionDenied, PortageException, TryAgain
- from portage.localization import _
- from portage.locks import lockfile, unlockfile
- from portage.manifest import Manifest
- from portage.output import colorize, EOutput
--from portage.util import apply_recursive_permissions, apply_secpass_permissions, ensure_dirs, grabdict, shlex_split, varexpand, writemsg, writemsg_level, writemsg_stdout
-+from portage.util import apply_recursive_permissions, \
-+	apply_secpass_permissions, ensure_dirs, grabdict, shlex_split, \
-+	varexpand, writemsg, writemsg_level, writemsg_stdout
- from portage.process import spawn
- 
- _userpriv_spawn_kwargs = (
-@@ -1096,7 +1104,7 @@
- 					ebuild_phase = mysettings.get("EBUILD_PHASE")
- 					try:
- 						mysettings["EBUILD_PHASE"] = "nofetch"
--						spawn(_shell_quote(EBUILD_SH_BINARY) + \
-+						doebuild_spawn(_shell_quote(EBUILD_SH_BINARY) + \
- 							" nofetch", mysettings, fd_pipes=fd_pipes)
- 					finally:
- 						if ebuild_phase is None:
-Index: pym/portage/package/ebuild/getmaskingstatus.py
-===================================================================
---- a/pym/portage/package/ebuild/getmaskingstatus.py	(revision 15731)
-+++ b/pym/portage/package/ebuild/getmaskingstatus.py	(revision 15814)
-@@ -1,9 +1,11 @@
- # Copyright 2010 Gentoo Foundation
- # Distributed under the terms of the GNU General Public License v2
--# $Id: getmaskingstatus.py 15672 2010-03-02 21:01:19Z zmedico $
-+# $Id: getmaskingstatus.py 15749 2010-03-04 11:23:09Z zmedico $
- 
- __all__ = ['getmaskingstatus']
- 
-+import sys
-+
- import portage
- from portage import eapi_is_supported, _eapi_is_deprecated
- from portage.dep import match_from_list
-@@ -11,6 +13,9 @@
- from portage.package.ebuild.config import config
- from portage.versions import catpkgsplit, cpv_getkey
- 
-+if sys.hexversion >= 0x3000000:
-+	basestring = str
-+
- def getmaskingstatus(mycpv, settings=None, portdb=None):
- 	if settings is None:
- 		settings = config(clone=portage.settings)
-Index: pym/portage/proxy/lazyimport.py
-===================================================================
---- a/pym/portage/proxy/lazyimport.py	(revision 15731)
-+++ b/pym/portage/proxy/lazyimport.py	(revision 15814)
-@@ -1,6 +1,6 @@
- # Copyright 2009 Gentoo Foundation
- # Distributed under the terms of the GNU General Public License v2
--# $Id: lazyimport.py 14327 2009-09-21 16:07:07Z arfrever $
-+# $Id: lazyimport.py 15782 2010-03-09 02:42:40Z zmedico $
- 
- __all__ = ['lazyimport']
- 
-@@ -20,6 +20,24 @@
- _module_proxies = {}
- _module_proxies_lock = threading.RLock()
- 
-+def _preload_portage_submodules():
-+	"""
-+	Load lazily referenced portage submodules into memory,
-+	so imports won't fail during portage upgrade/downgrade.
-+	Note that this recursively loads only the modules that
-+	are lazily referenced by currently imported modules,
-+	so some portage submodules may still remain unimported
-+	after this function is called.
-+	"""
-+	while True:
-+		remaining = False
-+		for name in list(_module_proxies):
-+			if name.startswith('portage.'):
-+				remaining = True
-+				_unregister_module_proxy(name)
-+		if not remaining:
-+			break
-+
- def _register_module_proxy(name, proxy):
- 	_module_proxies_lock.acquire()
- 	try:
--- a/sources/native-builds/hello-world.sh	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-#!/bin/bash
-
-# Download all the source tarballs we haven't got up-to-date copies of.
-
-# The tarballs are downloaded into the "packages" directory, which is
-# created as needed.
-
-source sources/include.sh || exit 1
-
-[ $# -ne 1 ] && echo "usage: $0 FILENAME" >&2 && exit 1
-[ -e "$1" ] && echo "$1 exists" && exit 0
-
-# Set up working directories
-
-WORK="$BUILD/control-images/hello-world"
-blank_tempdir "$WORK"
-
-cat > "$WORK"/init << 'EOF' || dienow
-#!/bin/bash
-
-echo Started second stage init
-
-cd /home &&
-gcc -lpthread /usr/src/thread-hello2.c -o hello &&
-./hello
-
-# Upload our hello world file to the output directory (named hello-$HOST).
-# No reason, just an example.
-
-ftpput $FTP_SERVER -P $FTP_PORT hello-$HOST hello
-
-sync
-
-EOF
-
-chmod +x "$WORK"/init || dienow
-
-cd "$TOP"
-
-mksquashfs "$WORK" "$1" -noappend -all-root
--- a/sources/native-builds/lfs-bootstrap/download.sh	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-# Build Linux From Scratch 6.7 packages under target environment.
-
-# Note: this doesn't rebuild the toolchain packages (libc, binutils,
-# gcc, linux-headers), but reuses the toolchain we've got, because:
-
-# 1) Building a new toolchain is a target-dependent can of worms.
-# 2) Doing so would lose distcc acceleration.
-# 3) Building glibc under uClibc is buggy because glibc expects that a
-#    2.6 kernel will have TLS, and uClibc without NPTL doesn't.  (Yes,
-#    repeat after me, "autoconf is useless".)
-
-# Download upstream tarball
-
-URL=http://ftp.osuosl.org/pub/lfs/lfs-packages/lfs-packages-6.7.tar \
-SHA1= \
-RENAME='s/-sources//' \
-download || dienow
-
-cleanup_oldfiles
-
-# Extract the individual packages from the upstream tarball
-
-SRCDIR="$SRCTREE/lfs-packages"
-PATCHDIR="$SRCDIR"
-
-# Fixups for tarball names the Aboriginal extract scripts can't parse
-
-mv "$SRCDIR"/sysvinit-2.88{dsf,}.tar.bz2 &&
-mv "$SRCDIR"/tcl{8.5.8-src,-src-8.5.8}.tar.gz &&
-mv "$SRCDIR"/udev-{161-testfiles,testfiles-161}.tar.bz2 || exit 1
-
-# Remove damaged patches (whitespace damaged, don't apply without "fuzz").
-
-rm "$SRCDIR"/gcc-4.5.1-startfiles_fix-1.patch &&
-rm "$SRCDIR"/tar-1.23-overflow_fix-1.patch || exit 1
-
-# Break down upstream tarball
-
-for i in $(cd "$SRCDIR"; ls *.tar.*)
-do
-  extract_package $(noversion $i)
-done
-
-rm -rf "$SRCDIR"
--- a/sources/native-builds/lfs-bootstrap/make-control-image.sh	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-../bootstrap-skeleton/control-image-wrapper.sh
\ No newline at end of file
--- a/sources/native-builds/lfs-bootstrap/mnt/build/bash.sh	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-#!/bin/sh
-
-./configure --prefix=/usr --bindir=/bin --htmldir=/usr/share/doc/bash \
-  --without-bash-malloc --with-installed-readline &&
-make -j $CPUS || exit 1
-
-if [ ! -z "$CHECK" ]
-then
-  chown -R nobody . &&
-  su-tools nobody -s /bin/bash -c "make tests" || exit 1
-fi
-
-make install
--- a/sources/native-builds/lfs-bootstrap/mnt/build/bison.sh	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-./configure --prefix=/usr &&
-echo '#define YYENABLE_NLS 1' >> lib/config.h &&
-make -j $CPUS || exit 1
-
-if [ ! -z "$CHECK" ]
-then
-  make check || exit 1
-fi
-
-make install
--- a/sources/native-builds/lfs-bootstrap/mnt/build/coreutils.sh	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-#!/bin/sh
-
-./configure --prefix=/usr --enable-no-install-program=kill,uptime &&
-make -j $CPUS || exit 1
-
-if [ ! -z "$CHECK" ]
-then
-  make NON_ROOT_USERNAME=nobody check-root &&
-  echo "dummy:x:1000:nobody" >> /etc/group &&
-  chown -R nobody . &&
-  su-tools nobody -s /bin/bash -c "make RUN_EXPENSIVE_TESTS=yes check" &&
-  sed -i '/^dummy:/d' /etc/group || exit 1
-fi
-
-make install &&
-mv /usr/bin/chroot /usr/sbin
-  
--- a/sources/native-builds/lfs-bootstrap/mnt/build/e2fsprogs.sh	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-#!/bin/bash
-
-mkdir build &&
-cd build &&
-../configure --prefix=/usr --with-root-prefix="" \
-  --enable-elf-shlibs --disable-libblkid --disable-libuuid \
-  --disable-uuidd --disable-fsck --disable-tls &&
-make -j $CPUS || exit 1
-
-if [ ! -z "$CHECK" ]
-then
-  make check || exit 1
-fi
-
-make install &&
-make install-libs &&
-chmod u+w /usr/lib/{libcom_err,libe2p,libext2fs,libss}.a
--- a/sources/native-builds/lfs-bootstrap/mnt/build/gdbm.sh	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-./configure --prefix=/usr &&
-make -j $CPUS &&
-make install &&
-make install-compat
--- a/sources/native-builds/lfs-bootstrap/mnt/build/gmp.sh	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-#!/bin/sh
-
-# Doesn't work with uClibc++ yet.
-# [ ! -z "$(which c++)" ] && X="--enable-cxx"
-
-./configure --prefix=/usr $X --enable-mpbsd &&
-make -j $CPUS || exit 1
-
-if [ ! -z "$CHECK" ]
-then
-  make check 2>&1 | tee gmp-check-log
-  awk '/tests passed/{total+=$2} ; END{print total}' gmp-check-log
-fi
-
-make install || exit 1
-
-if [ ! -z "$DOCS" ]
-then
-  mkdir -p /usr/share/doc/gmp-5.0.1 &&
-  cp doc/isa_abi_headache doc/connfiguration doc/*.html \
-    /usr/share/doc/gmp-5.0.1
-fi
--- a/sources/native-builds/lfs-bootstrap/mnt/build/grep.sh	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-./configure --prefix=/usr --bindir=/bin &&
-make -j $CPUS || exit 1
-
-if [ ! -z "$CHECK" ]
-then
-  make check || exit 1
-fi
-
-make install
--- a/sources/native-builds/lfs-bootstrap/mnt/build/iana-etc.sh	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-#!/bin/sh
-
-make -j $CPUS &&
-make install
--- a/sources/native-builds/lfs-bootstrap/mnt/build/inetutils.sh	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-./configure --prefix=/usr --libexecdir=/usr/sbin --localstatedir=/var \
-  --disable-logger --disable-syslogd --disable-whois --disable-servers &&
-make -j $CPUS &&
-make install
--- a/sources/native-builds/lfs-bootstrap/mnt/build/libtool.sh	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-./configure --prefix=/usr &&
-make -j $CPUS || exit 1
-
-if [ ! -z "$CHECK" ]
-then
-  make check || exit 1
-fi
-
-make install
--- a/sources/native-builds/lfs-bootstrap/mnt/build/m4.sh	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-sed -i -e '/"m4.h"/a#include <sys/stat.h>' src/path.c &&
-./configure --prefix=/usr &&
-make || exit 1
-
-if [ ! -z "$CHECK" ]
-then
-  make check || exit 1
-fi
-
-make install
--- a/sources/native-builds/lfs-bootstrap/mnt/build/mpc.sh	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-./configure --prefix=/usr &&
-make -j $CPUS || exit 1
-
-if [ ! -z "$CHECK" ]
-then
-  make check || exit 1
-fi
-
-make install
--- a/sources/native-builds/lfs-bootstrap/mnt/build/mpfr.sh	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-# TODO: The --enable-thread-safe here requires TLS
-
-./configure --prefix=/usr --docdir=/usr/share/doc/mpfr-3.0.0 &&
-make -j $CPUS || exit 1
-
-if [ ! -z "$CHECK" ]
-then
-  make check || exit 1
-fi
-
-make install || exit 1
-
-if [ ! -z "$DOCS" ]
-then
-  make html &&
-  make install-html
-fi
--- a/sources/native-builds/lfs-bootstrap/mnt/build/ncurses.sh	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-#!/bin/sh
-
-[ ! -z "$(which c++)" ] && X="--without-cxx --without-cxx-binding"
-
-./configure --prefix=/usr --with-shared --without-debug --enable-widec $X &&
-make -j $CPUS &&
-make install || exit 1
-
-# Make sure various packages can find ncurses no matter what weird names
-# they look for.
-
-for lib in ncurses form panel menu
-do
-    ln -sf lib${lib}w.so /usr/lib/lib${lib}.so &&
-    ln -sf lib${lib}w.a /usr/lib/lib${lib}.a || exit 1
-done
-ln -sf libncursesw.so libcursesw.so &&
-ln -sf libncurses.so /usr/lib/libcurses.so &&
-ln -sf libncursesw.a /usr/lib/libcursesw.a &&
-ln -sf libncurses.a /usr/lib/libcurses.a || exit 1
-
-if [ ! -z "$(which c++)" ]
-then
-  ln -sf libncurses++w.a /usr/lib/libncurses++.a || exit 1
-fi
--- a/sources/native-builds/lfs-bootstrap/mnt/build/pkg-config.sh	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-#!/bin/sh
-
-sed -i -e 's/XT])dnl/XT])[]dnl/' \
-       -e 's/\.])dnl/\.])[]dnl/' pkg.m4 &&
-./configure --prefix=/usr &&
-make -j $CPUS || exit 1
-
-if [ ! -z "$CHECK" ]
-then
-  make check || exit 1
-fi
-
-make install
--- a/sources/native-builds/lfs-bootstrap/mnt/build/procps.sh	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-sed -i -e 's@\*/module.mk@proc/module.mk ps/module.mk@' Makefile &&
-make -j $CPUS &&
-make install
--- a/sources/native-builds/lfs-bootstrap/mnt/build/readline.sh	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-#!/bin/sh
-
-sed -k '/MV.*old/d' Makefile.in &&
-sed -i '/{OLDSUFF}/c:' support/shlib-install &&
-./configure --prefix=/usr --libdir=/lib &&
-make -j $CPUS SHLIB_LIBS=-lncurses &&
-make install  || exit 1
-
-if [ ! -z "$DOCS" ]
-then
-  mkdir /usr/share/doc/readline &&
-  install -m644 doc/*.ps doc/*.pdf doc/*.html doc/*.dvi \
-    /usr/share/doc/readline
-fi
--- a/sources/native-builds/lfs-bootstrap/mnt/build/sed.sh	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-#!/bin/sh
-
-./configure --prefix=/usr --bindir=/bin --htmldir=/usr/share/doc/sed-4.2.1 &&
-make -j $CPUS || exit 1
-
-if [ ! -z "$DOCS" ]
-then
-  make html &&
-  make -C doc install-html || exit 1
-fi
-
-if [ ! -z "$CHECK" ]
-then
-  make check || exit 1
-fi
-
-make install
--- a/sources/native-builds/lfs-bootstrap/mnt/build/setup.nosrc	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-#!/bin/bash
-
-# Basic setup.  Create directories not in the aboriginal base system.
-
-cd / &&
-
-mkdir -p boot etc/opt opt media/floppy media/cdrom srv var/tmp &&
-chmod 0750 root &&
-chmod 1777 tmp var/tmp &&
-rm -rf /usr/local &&
-ln -sf . usr/local &&
-cd usr/share &&
-mkdir -p doc info locale man misc terminfo zoneinfo &&
-cd ../.. &&
-ln -sf share/man share/doc share/info usr &&
-cd var &&
-mkdir -p lib lock log mail run spool opt cache local &&
-cd lib &&
-mkdir -p misc locate &&
-cd ../.. &&
-
-cat > etc/passwd << "EOF" &&
-root:x:0:0:root:/root:/bin/bash
-bin:x:1:1:bin:/dev/null:/bin/false
-nobody:x:99:99:Unprivileged User:/dev/null:/bin/false
-guest:x:500:500:guest:/home/guest:/bin/sh
-EOF
-
-cat > etc/group << "EOF" &&
-root:x:0:
-bin:x:1:
-sys:x:2:
-kmem:x:3:
-tty:x:4:
-tape:x:5:
-daemon:x:6:
-floppy:x:7:
-disk:x:8:
-lp:x:9:
-dialout:x:10:
-audio:x:11:
-video:x:12:
-utmp:x:13:
-usb:x:14:
-cdrom:x:15:
-mail:x:34:
-nogroup:x:99:
-guest:x:500:
-EOF
-
-touch /var/run/utmp /var/log/btmp /var/log/lastlog /var/log/wtmp &&
-chgrp -v utmp /var/run/utmp /var/log/lastlog &&
-chmod -v 664 /var/run/utmp /var/log/lastlog
--- a/sources/native-builds/lfs-bootstrap/mnt/build/util-linux-ng.sh	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-sed -e 's@etc/adjtime@var/lib/hwclock/adjtime@g' \
-  -i $(grep -rl '/etc/adjtime' .) &&
-mkdir -p /var/lib/hwclock &&
-./configure --enable-arch --enable-partx --enable-write &&
-make -j $CPUS &&
-make install
--- a/sources/native-builds/lfs-bootstrap/mnt/build/zlib.sh	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-#!/bin/sh
-
-# zlib 1.2.5 accidentally shipped a generated file, which it then tries to
-# overwrite in-place.  This doesn't work so well on a read only filesystem.
-
-rm -f Makefile &&
-
-# Fix another bug.
-
-sed -i 's/ifdef _LARGEFILE64_SOURCE/ifndef _LARGEFILE64_SOURCE/' zlib.h &&
-
-# Otherwise, standard build
-
-./configure --prefix=/usr &&
-make -j $CPUS || exit 1
-
-if [ ! -z "$CHECK" ]
-then
-  make check || exit 1
-fi
-
-make install
--- a/sources/native-builds/lfs-bootstrap/mnt/package-list	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-setup
-zlib
-m4		#development
-gmp		#development
-mpfr		#development
-mpc		#development
-sed		#busybox
-pkg-config	#development
-ncurses
-util-linux-ng
-e2fsprogs	#busybox
-coreutils	#busybox
-gawk		#busybox
-iana-etc
-bison		#development
-procps		#busybox
-grep		#busybox
-readline	#development
-gettext		#development internationalization
-bash		#development
-libtool		#development pointless
-gdbm
-inetutils	#busybox?
-perl
-autoconf	#development
-automake	#development
-bzip2		#busybox
-diffutils	#busybox
-file
-findutils	#busybox
-flex		#development
-groff
-gzip		#busybox
-iproute2	#busybox?
-kbd		#busybox?
-less		#busybox
-make		#development
-man-db
-module-init-tools #busybox
-patch		#busybox
-psmisc		#busybox?
-shadow		#busybox
-sysklogd	#busybox
-sysvinit	#busybox
-tar		#busybox
-texinfo		#development pointless
-udev		#busybox
-vim
--- a/sources/native-builds/static-tools-patches/strace-arm-eabi.patch	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
---- a/linux/arm/syscallent.h
-+++ b/linux/arm/syscallent.h
-@@ -453,7 +453,7 @@
- 	{ 5,	TN,	sys_recvmsg,		"recvmsg"	}, /* 417 */
- 	{ 4,	TN,	sys_accept4,		"accept4"	}, /* 418 */
- 
--#if SYS_ipc_subcall != 419
-+#if defined(SYS_ipc_subcall) && (SYS_ipc_subcall != 419)
-  #error fix me
- #endif
- 	{ 4,	0,	printargs,		"ipc_subcall"	}, /* 419 */
--- a/sources/native-builds/static-tools-patches/strace-fixnet.patch	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-diff -ru strace/configure strace.new/configure
---- strace/configure	2009-10-21 12:41:11.000000000 -0500
-+++ strace.new/configure	2010-02-05 01:30:15.000000000 -0600
-@@ -5880,7 +5880,7 @@
- do :
-   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
- ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#include <stddef.h>
--#include <linux/socket.h>
-+#include <sys/socket.h>
- "
- eval as_val=\$$as_ac_Header
-    if test "x$as_val" = x""yes; then :
-diff -ru strace/configure.ac strace.new/configure.ac
---- strace/configure.ac	2009-10-12 14:54:43.000000000 -0500
-+++ strace.new/configure.ac	2010-02-05 01:30:35.000000000 -0600
-@@ -258,7 +258,7 @@
- ], [], [])
- AC_CHECK_HEADERS([linux/icmp.h linux/in6.h linux/netlink.h linux/if_packet.h],
-                  [], [], [#include <stddef.h>
--#include <linux/socket.h>])
-+#include <sys/socket.h>])
- AC_CHECK_HEADERS([asm/sigcontext.h], [], [], [#include <signal.h>])
- AC_CHECK_TYPES([struct sigcontext_struct,
- 		struct sigcontext],,, [#include <signal.h>])
--- a/sources/native-builds/static-tools.sh	Sun Nov 07 15:54:37 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +0,0 @@
-#!/bin/bash
-
-# Download all the source tarballs we haven't got up-to-date copies of.
-
-# The tarballs are downloaded into the "packages" directory, which is
-# created as needed.
-
-source sources/include.sh || exit 1
-
-[ $# -ne 1 ] && echo "usage: $0 FILENAME" >&2 && exit 1
-[ -e "$1" ] && echo "$1" exists && exit 0
-
-PATCHDIR="$SOURCES/native-builds/static-tools-patches"
-SRCDIR="$SRCDIR/native" && mkdir -p "$SRCDIR" || dienow
-WORK="$BUILD/control-images/static-tools" && blank_tempdir "$WORK"
-SRCTREE="$WORK"
-
-EXTRACT_ALL=1
-
-echo "=== Download source code."
-
-# Note: set SHA1= blank to skip checksum validation.
-
-URL=http://downloads.sf.net/sourceforge/strace/strace-4.5.19.tar.bz2 \
-SHA1=5554c2fd8ffae5c1e2b289b2024aa85a0889c989 \
-maybe_fork download || dienow
-
-URL=http://zlib.net/zlib-1.2.5.tar.bz2 \
-SHA1=543fa9abff0442edca308772d6cef85557677e02 \
-maybe_fork "download || dienow"
-
-URL=http://matt.ucc.asn.au/dropbear/releases/dropbear-0.52.tar.bz2 \
-SHA1=8c1745a9b64ffae79f28e25c6fe9a8b96cac86d8 \
-maybe_fork download || dienow
-
-echo === Got all source.
-
-cleanup_oldfiles
-
-cat > "$WORK"/init << 'EOF' || dienow
-#!/bin/bash
-
-upload_result()
-{
-  ftpput $FTP_SERVER -P $FTP_PORT "$1-$HOST" "$1"
-}
-
-echo Started second stage init
-
-echo === Native build static zlib
-
-cp -sfR /mnt/zlib zlib &&
-cd zlib &&
-# 
-rm -f Makefile &&
-./configure &&
-make -j $CPUS &&
-cd .. || exit 1
-
-echo === $HOST Native build static dropbear
-
-cp -sfR /mnt/dropbear dropbear &&
-cd dropbear &&
-CFLAGS="-I ../zlib -Os" LDFLAGS="--static -L ../zlib" ./configure &&
-sed -i 's@/usr/bin/dbclient@ssh@' options.h &&
-make -j $CPUS PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp" MULTI=1 SCPPROGRESS=1 &&
-strip dropbearmulti &&
-upload_result dropbearmulti &&
-cd .. &&
-rm -rf dropbear || exit 1
-
-echo === $HOST native build static strace
-
-cp -sfR /mnt/strace strace &&
-cd strace &&
-CFLAGS="--static -Os" ./configure &&
-make -j $CPUS &&
-strip strace &&
-upload_result strace &&
-cd .. &&
-rm -rf strace || dienow
-
-echo === $HOST native build rsync
-
-sync
-
-EOF
-
-chmod +x "$WORK"/init || dienow
-
-cd "$TOP"
-
-mksquashfs "$WORK" "$1" -noappend -all-root