view sources/native-builds/gentoo-stage1-files/emerge_wrapper.sh @ 1202:75d179a52475

Bootstrapping gentoo portage tree. Download tarball, extract it, and emerge --sync. (Build rsync so emerge --sync works.)
author Rob Landley <rob@landley.net>
date Tue, 10 Aug 2010 11:00:33 -0500
parents 25607cc50c8f
children
line wrap: on
line source

#!/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"