<commit_before>#!/bin/sh

if [ $# != 5 ]; then
    echo "Usage: $0 PACKAGE VERSION CHROOT_BASE ARCHITECTURES CODES"
    echo " e.g.: $0 groonga 0.1.9 /var/lib/chroot 'i386 amd64' 'lenny unstable hardy karmic'"
    exit 1
fi

PACKAGE=$1
VERSION=$2
CHROOT_BASE=$3
ARCHITECTURES=$4
CODES=$5

PATH=/usr/local/sbin:/usr/sbin:$PATH

script_base_dir=`dirname $0`

run()
{
    "$@"
    if test $? -ne 0; then
	echo "Failed $@"
	exit 1
    fi
}

run_sudo()
{
    run sudo "$@"
}

build_chroot()
{
    architecture=$1
    code_name=$2

    run_sudo debootstrap --arch $architecture $code_name $base_dir

    case $code_name in
	lenny|squeeze|unstable)
	    run_sudo sed -i'' -e 's/us/jp/' $base_dir/etc/apt/sources.list
	    ;;
	*)
	    run_sudo sed -i'' -e 's/main$/main universe/' \
		$base_dir/etc/apt/sources.list
	    ;;
    esac

    run_sudo sh -c "echo >> /etc/fstab"
    run_sudo sh -c "echo /sys ${base_dir}/sys none bind 0 0 >> /etc/fstab"
    run_sudo sh -c "echo /dev ${base_dir}/dev none bind 0 0 >> /etc/fstab"
    run_sudo sh -c "echo devpts-chroot ${base_dir}/dev/pts devpts defaults 0 0 >> /etc/fstab"
    run_sudo sh -c "echo proc-chroot ${base_dir}/proc proc defaults 0 0 >> /etc/fstab"
    run_sudo mount ${base_dir}/sys
    run_sudo mount ${base_dir}/dev
    run_sudo mount ${base_dir}/dev/pts
    run_sudo mount ${base_dir}/proc
}

build()
{
    architecture=$1
    code_name=$2

    target=${code_name}-${architecture}
    base_dir=${CHROOT_BASE}/${target}<commit_msg>use Ubuntu host in Japan.<commit_after>#!/bin/sh

if [ $# != 5 ]; then
    echo "Usage: $0 PACKAGE VERSION CHROOT_BASE ARCHITECTURES CODES"
    echo " e.g.: $0 groonga 0.1.9 /var/lib/chroot 'i386 amd64' 'lenny unstable hardy karmic'"
    exit 1
fi

PACKAGE=$1
VERSION=$2
CHROOT_BASE=$3
ARCHITECTURES=$4
CODES=$5

PATH=/usr/local/sbin:/usr/sbin:$PATH

script_base_dir=`dirname $0`

run()
{
    "$@"
    if test $? -ne 0; then
	echo "Failed $@"
	exit 1
    fi
}

run_sudo()
{
    run sudo "$@"
}

build_chroot()
{
    architecture=$1
    code_name=$2

    run_sudo debootstrap --arch $architecture $code_name $base_dir

    case $code_name in
	lenny|squeeze|unstable)
	    run_sudo sed -i'' -e 's/us/jp/' $base_dir/etc/apt/sources.list
	    ;;
	*)
	    run_sudo sed -i'' \
		-e 's,http://archive,http://jp.archive,' \
		-e 's/main$/main universe/' \
		$base_dir/etc/apt/sources.list
	    ;;
    esac

    run_sudo sh -c "echo >> /etc/fstab"
    run_sudo sh -c "echo /sys ${base_dir}/sys none bind 0 0 >> /etc/fstab"
    run_sudo sh -c "echo /dev ${base_dir}/dev none bind 0 0 >> /etc/fstab"
    run_sudo sh -c "echo devpts-chroot ${base_dir}/dev/pts devpts defaults 0 0 >> /etc/fstab"
    run_sudo sh -c "echo proc-chroot ${base_dir}/proc proc defaults 0 0 >> /etc/fstab"
    run_sudo mount ${base_dir}/sys
    run_sudo mount ${base_dir}/dev
    run_sudo mount ${base_dir}/dev/pts
    run_sudo mount ${base_dir}/proc
}

build()
{
    architecture=$1
    code_name=$2

    target=${code_name}-${architecture}
    base_dir=${CHROOT_BASE}/${target}
{'fraction_non_alphanumeric': 0.15669421487603305, 'fraction_numerical': 0.02115702479338843, 'mean_word_length': 2.9607329842931938, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6849482', 'n_tokens_mistral': 1322, 'n_tokens_neox': 1200, 'n_words': 289}