<commit_before>#!/bin/bash
version=$1
#directory of this file. all php srces are extrated in it
basedir="`dirname "$0"`"
cd "$basedir"
basedir=`pwd`
#directory of php sources of specific version
srcdir="php-$version"
#directory with source archives
bzipsdir='bzips'
#directory phps get installed into
instbasedir="$basedir/../inst"
#directory this specific version gets installed into
instdir="$instbasedir/php-$version"
#directory where all bins are symlinked
shbindir="$instbasedir/bin"

#we need a php version
if [ "x$version" = 'x' ]; then
    echo 'Please specify php version'
    exit 1
fi


#already extracted?
if [ ! -d "$srcdir" ]; then
    echo 'Source directory does not exist; trying to extract'
    srcfile="$bzipsdir/php-$version.tar.bz2"
    if [ ! -f "$srcfile" ]; then
        #FIXME: fetch from museum
        echo 'Source file not found:'
        echo "$srcfile"
        exit 2
    fi
    #extract<commit_msg>automatically fetch from museum.php.net if file does not exist<commit_after>#!/bin/bash
version=$1
#directory of this file. all php srces are extrated in it
basedir="`dirname "$0"`"
cd "$basedir"
basedir=`pwd`
#directory of php sources of specific version
srcdir="php-$version"
#directory with source archives
bzipsdir='bzips'
#directory phps get installed into
instbasedir="$basedir/../inst"
#directory this specific version gets installed into
instdir="$instbasedir/php-$version"
#directory where all bins are symlinked
shbindir="$instbasedir/bin"

#we need a php version
if [ "x$version" = 'x' ]; then
    echo 'Please specify php version'
    exit 1
fi


#already extracted?
if [ ! -d "$srcdir" ]; then
    echo 'Source directory does not exist; trying to extract'
    srcfile="$bzipsdir/php-$version.tar.bz2"
    if [ ! -f "$srcfile" ]; then
        echo 'Source file not found:'
        echo "$srcfile"
        #FIXME: use php4 if version is that
        url="http://museum.php.net/php5/php-$version.tar.bz2"
	wget -P "$bzipsdir" "$url"
	if [ ! -f "$srcfile" ]; then
            #FIXME: fetch from museum
	    echo "Fetching source from museum failed:"
	    echo $url
            exit 2
	fi
    fi
    #extract
{'fraction_non_alphanumeric': 0.11893656716417911, 'fraction_numerical': 0.006063432835820896, 'mean_word_length': 3.554140127388535, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2431805', 'n_tokens_mistral': 705, 'n_tokens_neox': 672, 'n_words': 240}