<commit_before>#!/bin/bash -e

# We need to start with a shell script so that we can set up the virtualenv
# before calling Python code.

venv=var/server-venv

cd "$(dirname $0)/.."

. /etc/os-release

# For the time being, this script needs to be run as root because
# initialize.py installs files that only root can install, but
# eventually we may want to fix that, so I've attempted to write this
# build script so that it can run as root or non-root.
arch_build() {
    git_url="$1"; shift
    mkdir -p var/makepkg
    dir=${git_url##*/}
    dir=${dir%.git}
    if [ $(id -u) == 0 ]; then
	TOROOT=
	FROMROOT="sudo -u nobody"
	FIXPERMS="chown -R nobody"
    else
	TOROOT=sudo
	FROMROOT=
	FIXPERMS=
    fi
    if ! (
	    cd var/makepkg
	    if [ ! -f $dir/*.tar.xz ]; then
		$TOROOT pacman -S --noconfirm --needed git
		rm -rf $dir
		git clone $git_url $dir
		cd $dir
		$FIXPERMS .
		$FROMROOT makepkg -Acs
		cd ..
	    fi
	    $TOROOT pacman -U --needed --noconfirm $dir/*.tar.xz
      ) > var/makepkg/$dir.log 2>&1; then
	echo "Installing $git_url failed. See var/makepkg/$dir.log" 1>&2
	false
    fi
    true
}

mkdir -p var
<commit_msg>Move /etc/os-release include to where it's used<commit_after>#!/bin/bash -e

# We need to start with a shell script so that we can set up the virtualenv
# before calling Python code.

venv=var/server-venv

cd "$(dirname $0)/.."

# For the time being, this script needs to be run as root because
# initialize.py installs files that only root can install, but
# eventually we may want to fix that, so I've attempted to write this
# build script so that it can run as root or non-root.
arch_build() {
    git_url="$1"; shift
    mkdir -p var/makepkg
    dir=${git_url##*/}
    dir=${dir%.git}
    if [ $(id -u) == 0 ]; then
	TOROOT=
	FROMROOT="sudo -u nobody"
	FIXPERMS="chown -R nobody"
    else
	TOROOT=sudo
	FROMROOT=
	FIXPERMS=
    fi
    if ! (
	    cd var/makepkg
	    if [ ! -f $dir/*.tar.xz ]; then
		$TOROOT pacman -S --noconfirm --needed git
		rm -rf $dir
		git clone $git_url $dir
		cd $dir
		$FIXPERMS .
		$FROMROOT makepkg -Acs
		cd ..
	    fi
	    $TOROOT pacman -U --needed --noconfirm $dir/*.tar.xz
      ) > var/makepkg/$dir.log 2>&1; then
	echo "Installing $git_url failed. See var/makepkg/$dir.log" 1>&2
	false
    fi
    true
}

mkdir -p var

. /etc/os-release

{'fraction_non_alphanumeric': 0.12661498708010335, 'fraction_numerical': 0.006029285099052541, 'mean_word_length': 2.607142857142857, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '7424083', 'n_tokens_mistral': 914, 'n_tokens_neox': 846, 'n_words': 302}