Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

executable file 46 lines (37 sloc) 0.935 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
#!/bin/bash

# NOTICE: This script is Debian dependent.
#

BASE="./compilation_test/"
DISTRO="sid"
REPOSITORY="http://http.us.debian.org/debian"
CHROOT_SCRIPT="debian_testing_chroot.sh"
VERSION="$1"
TARBALL="cherokee-${VERSION}.tar.gz"

# Some basic checks
if test "x$TARBALL" == "x"; then
    echo "Usage:"
    echo " $0 x.y.z"
    echo "Eg: $0 0.4.28b1"
    exit
fi

if [ ! -f $TARBALL ]; then
    echo "Error: $TARBALL not found"
    exit
fi

# Clean it up
sudo rm -rf $BASE
mkdir -p $BASE

# Install basic system
cd $BASE
sudo /usr/sbin/debootstrap $DISTRO `pwd` $REPOSITORY
cd ..

# Copy the second part of the script and the tarball
cp $CHROOT_SCRIPT $BASE/tmp/
cp $TARBALL $BASE/tmp/
chmod a+rx $BASE/tmp/$CHROOT_SCRIPT

# Chroot in there
sudo /usr/sbin/chroot $BASE /tmp/$CHROOT_SCRIPT $VERSION $DISTRO

# Print notice
total_size=`sudo du -s $BASE`
echo "The $BASE directory is ${total}Kb, maybe you want to remove it.."
echo
Something went wrong with that request. Please try again.