<commit_before>#!/bin/bash
# @author <NAME>
# @file
# @ingroup administrative
# @description Script file that adds extensions to mediawiki based on a list
# @param -a Action.Users.list, if not used, defaults to Action.User.list.temp
#       expects a file which contains one line per extension.  Each extension can have an explicit version - but will default to the specified
#       version if not present.
#       @param [extension]:[Version] (lines beginning with # are considered comments)
#       example
#       NSFileRepo:REL1_21

#    export ExtensionsAddr=ssh://jdpond@gerrit.wikimedia.org:29418/mediawiki
#    export    SVNExtensionsAddr=svn+ssh://jdpond@svn.wikimedia.org/svnroot/mediawiki/trunk


trySVN(){
    echo svn checkout "$SVNExtensionsAddr/extensions/$1 extensions/$1"
    svn checkout "$SVNExtensionsAddr/extensions/$1 extensions/$1"
    if [ -a "extensions/$1/.svn" ]; then
        echo loaded extension $1 with SVN >> ExtensionLoader.log
    else
        echo *** Error *** Could not load extension $1
        echo *** Error *** Could not load extension $1 >> "$ThisHomeDir/ExtensionLoader.log"
    fi
}

export	SVNExtensionsAddr=http://svn.wikimedia.org/svnroot/mediawiki/trunk
export	ExtensionsAddr=https://gerrit.wikimedia.org/r/p/mediawiki

export ConfigFile=extensions/WikiConfig/Extensions.conf
export BranchVer=master
export ThisHomeDir=$(pwd)
echo ThisHomeDir: $ThisHomeDir

while getopts ":f::b:" opt; do
    case $opt in
        f)
			export ConfigFile=$OPTARG
            ;;
        b)
            export BranchVer=$OPTARG
            ;;
        \?)
            echo "Invalid option: -$OPTARG" >&2
            exit 1
            ;;
        :)
            echo "Option -$OPTARG requires an argument." >&2
            exit 1
            ;;
    esac
done

if [ ! -a $ConfigFile ]; then
	echo Media Extension File List $ConfigFile does not exist - exiting
	exit 1
)
echo Starting MediaWiki Extension Loader from $ConfigFile at $(hostname);$(date) > "$ThisHomeDir/ExtensionLoader.log"
while read line; do
	if [ "${line:0:1}" != "#" ] ; then
        export _extension=`echo $line | cut -d: -f1`<commit_msg>Removed extraneous ")"<commit_after>#!/bin/bash
# @author <NAME>
# @file
# @ingroup administrative
# @description Script file that adds extensions to mediawiki based on a list
# @param -a Action.Users.list, if not used, defaults to Action.User.list.temp
#       expects a file which contains one line per extension.  Each extension can have an explicit version - but will default to the specified
#       version if not present.
#       @param [extension]:[Version] (lines beginning with # are considered comments)
#       example
#       NSFileRepo:REL1_21

#    export ExtensionsAddr=ssh://jdpond@gerrit.wikimedia.org:29418/mediawiki
#    export    SVNExtensionsAddr=svn+ssh://jdpond@svn.wikimedia.org/svnroot/mediawiki/trunk


trySVN(){
    echo svn checkout "$SVNExtensionsAddr/extensions/$1 extensions/$1"
    svn checkout "$SVNExtensionsAddr/extensions/$1 extensions/$1"
    if [ -a "extensions/$1/.svn" ]; then
        echo loaded extension $1 with SVN >> ExtensionLoader.log
    else
        echo *** Error *** Could not load extension $1
        echo *** Error *** Could not load extension $1 >> "$ThisHomeDir/ExtensionLoader.log"
    fi
}

export	SVNExtensionsAddr=http://svn.wikimedia.org/svnroot/mediawiki/trunk
export	ExtensionsAddr=https://gerrit.wikimedia.org/r/p/mediawiki

export ConfigFile=extensions/WikiConfig/Extensions.conf
export BranchVer=master
export ThisHomeDir=$(pwd)
echo ThisHomeDir: $ThisHomeDir

while getopts ":f::b:" opt; do
    case $opt in
        f)
			export ConfigFile=$OPTARG
            ;;
        b)
            export BranchVer=$OPTARG
            ;;
        \?)
            echo "Invalid option: -$OPTARG" >&2
            exit 1
            ;;
        :)
            echo "Option -$OPTARG requires an argument." >&2
            exit 1
            ;;
    esac
done

if [ ! -a $ConfigFile ]; then
	echo Media Extension File List $ConfigFile does not exist - exiting
	exit 1
fi

echo Starting MediaWiki Extension Loader from $ConfigFile at $(hostname);$(date) > "$ThisHomeDir/ExtensionLoader.log"
while read line; do
	if [ "${line:0:1}" != "#" ] ; then
        export _extension=`echo $line | cut -d: -f1`
{'fraction_non_alphanumeric': 0.11212333566923616, 'fraction_numerical': 0.011212333566923615, 'mean_word_length': 2.9140767824497256, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, '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': '1635201', 'n_tokens_mistral': 1309, 'n_tokens_neox': 1270, 'n_words': 380}