<commit_before>#!/bin/bash
. /opt/farm/scripts/init
. /opt/farm/scripts/functions.custom



setup_midnight_commander_for_user() {
	file=$1
	path=$2
	user=$3
	group=`id -gn $user`
	home=`getent passwd $user |cut -d: -f 6`

	rc=$home/.bashrc
	wrapper=/usr/share/mc/bin/mc-wrapper.sh

	if [ -d $home ]; then
		mkdir -p `dirname $home/$path`
		cp -f $file $home/$path
		chown $user:$group $home/$path

		if [ -f $rc ]; then

			if [ "`grep 'alias mc' $rc`" = "" ] && [ -f $wrapper ]; then
				echo >>$rc
				echo "alias mc='. $wrapper'" >>$rc
			fi

			if [ "`grep mcedit $rc`" = "" ]; then
				echo >>$rc
				echo "export EDITOR=mcedit" >>$rc
			fi
		fi
	fi
}


base=/opt/sf-mc-black/templates/$OSVER

if [ -f $base/mc.ini ]; then
	echo "setting up midnight commander profiles"

	if [ -f $base/mc.skin ]; then
		cp -f $base/mc.skin /usr/share/mc/skins/wheezy.ini
	fi

	if [ "`grep -Fx $OSVER /opt/sf-mc-black/newpaths.conf`" != "" ]; then
		SUB=".config/mc/ini"
	else
		SUB=".mc/ini"
	fi

	setup_midnight_commander_for_user $base/mc.ini $SUB root

	if [ "`getent passwd ubuntu`" != "" ]; then
		setup_midnight_commander_for_user $base/mc.ini $SUB ubuntu
	fi

	ADMIN=`primary_admin_account`
	if [ "`getent passwd $ADMIN`" != "" ]; then
		setup_midnight_commander_for_user $base/mc.ini $SUB $ADMIN
	fi
fi<commit_msg>changed extension base path<commit_after>#!/bin/bash
. /opt/farm/scripts/init
. /opt/farm/scripts/functions.custom



setup_midnight_commander_for_user() {
	file=$1
	path=$2
	user=$3
	group=`id -gn $user`
	home=`getent passwd $user |cut -d: -f 6`

	rc=$home/.bashrc
	wrapper=/usr/share/mc/bin/mc-wrapper.sh

	if [ -d $home ]; then
		mkdir -p `dirname $home/$path`
		cp -f $file $home/$path
		chown $user:$group $home/$path

		if [ -f $rc ]; then

			if [ "`grep 'alias mc' $rc`" = "" ] && [ -f $wrapper ]; then
				echo >>$rc
				echo "alias mc='. $wrapper'" >>$rc
			fi

			if [ "`grep mcedit $rc`" = "" ]; then
				echo >>$rc
				echo "export EDITOR=mcedit" >>$rc
			fi
		fi
	fi
}


base=/opt/farm/ext/mc-black/templates/$OSVER

if [ -f $base/mc.ini ]; then
	echo "setting up midnight commander profiles"

	if [ -f $base/mc.skin ]; then
		cp -f $base/mc.skin /usr/share/mc/skins/wheezy.ini
	fi

	if [ "`grep -Fx $OSVER /opt/farm/ext/mc-black/newpaths.conf`" != "" ]; then
		SUB=".config/mc/ini"
	else
		SUB=".mc/ini"
	fi

	setup_midnight_commander_for_user $base/mc.ini $SUB root

	if [ "`getent passwd ubuntu`" != "" ]; then
		setup_midnight_commander_for_user $base/mc.ini $SUB ubuntu
	fi

	ADMIN=`primary_admin_account`
	if [ "`getent passwd $ADMIN`" != "" ]; then
		setup_midnight_commander_for_user $base/mc.ini $SUB $ADMIN
	fi
fi
{'fraction_non_alphanumeric': 0.1782477341389728, 'fraction_numerical': 0.0030211480362537764, 'mean_word_length': 3.152037617554859, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, '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': '1928759', 'n_tokens_mistral': 1214, 'n_tokens_neox': 1081, 'n_words': 250}