<commit_before>#!/bin/bash -v
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
WEB_DIR=$SCRIPT_DIR/..
echo "Running setup_vimage.sh"
#VERSION=cauldron
#USER=joe
if grep -q Cauldron /etc/release  ; then 
echo "cauldron" 
VERSION=cauldron
else
echo "version 5"
VERSION=5
fi

TESTING=false
USER=user
# Change everything to local user so that suexec will work
# ./setup.sh will take the owner of the scripts to set up the
# suexec environment, so this should be set correctly for 
# everything to work.

cd /home/$USER
chown -R $USER":"$USER git

echo "Resetting urpmi"
urpmi.removemedia -a
urpmi.addmedia --distrib --mirrorlist 'http://mirrors.mageia.org/api/mageia.'$VERSION'.'`uname -m`'.list'
if $TESTING ; then
urpmi.update --no-ignore "Core Updates" "Core Updates Testing"
fi
urpmi.update --no-ignore "Core Backports" "Core Backports Testing"
# Add backup server to make sure that we get fresh rpms
if [ "$VERSION" = "cauldron" ] ; then
urpmi.addmedia "Core backup" http://distro.ibiblio.org/mageia/distrib/$VERSION/`uname -m`/media/core/release --no-md5sum
urpmi.addmedia "Core updates backup" http://distro.ibiblio.org/mageia/distrib/$VERSION/`uname -m`/media/core/updates --no-md5sum
urpmi.addmedia "Bitquant sourceforge" https://sourceforge.net/projects/bitquant/files/rpms/`uname -m`/ --no-md5sum
if $TESTING ; then
urpmi.addmedia "Core updates testing backup" http://distro.ibiblio.org/mageia/distrib/$VERSION/`uname -m`/media/core/updates_testing
fi
urpmi.addmedia "Core backports backup" http://distro.ibiblio.org/mageia/distrib/$VERSION/`uname -m`/media/core/backports
urpmi.addmedia "Backports testing backup" http://ftp.sunet.se/pub/Linux/distributions/mageia/distrib/$VERSION/`uname -m`/media/core/backports_testing
fi

urpmi.update -a
#urpme --force --auto-orphans

echo "Copy configuration files"
pushd $SCRIPT_DIR > /dev/null
. rootcheck.sh
. configcheck.sh

# bootstrap sudo
./setup.sh $config<commit_msg>fix up urpmi setup<commit_after>#!/bin/bash -v
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
WEB_DIR=$SCRIPT_DIR/..
echo "Running setup_vimage.sh"
#VERSION=cauldron
#USER=joe
if grep -q Cauldron /etc/release  ; then 
echo "cauldron" 
VERSION=cauldron
else
echo "version 5"
VERSION=5
fi

TESTING=false
USER=user
URPMI_ROOT=http://distro.ibiblio.org/mageia/distrib
# Change everything to local user so that suexec will work
# ./setup.sh will take the owner of the scripts to set up the
# suexec environment, so this should be set correctly for 
# everything to work.

cd /home/$USER
chown -R $USER":"$USER git

echo "Resetting urpmi"
urpmi.removemedia -a
urpmi.addmedia --distrib --mirrorlist 'http://mirrors.mageia.org/api/mageia.'$VERSION'.'`uname -m`'.list'
if $TESTING ; then
urpmi.update --no-ignore "Core Updates" "Core Updates Testing"
fi
urpmi.update --no-ignore "Core Backports" "Core Backports Testing"
# Add backup server to make sure that we get fresh rpms
if [ "$VERSION" = "cauldron" ] ; then
urpmi.addmedia "Core backup" $URPMI_ROOT/$VERSION/`uname -m`/media/core/release --no-md5sum
urpmi.addmedia "Core updates backup" $URPMI_ROOT/$VERSION/`uname -m`/media/core/updates --no-md5sum
#urpmi.addmedia "Bitquant sourceforge" https://sourceforge.net/projects/bitquant/files/rpms/`uname -m`/ --no-md5sum
if $TESTING ; then
urpmi.addmedia "Core updates testing backup" $URPMI_ROOT/$VERSION/`uname -m`/media/core/updates_testing
fi
urpmi.addmedia "Core backports backup" $URPMI_ROOT/$VERSION/`uname -m`/media/core/backports
urpmi.addmedia "Backports testing backup" $URPMI_ROOT/$VERSION/`uname -m`/media/core/backports_testing
fi

urpmi.update -a
#urpme --force --auto-orphans

echo "Copy configuration files"
pushd $SCRIPT_DIR > /dev/null
. rootcheck.sh
. configcheck.sh

# bootstrap sudo
./setup.sh $config
{'fraction_non_alphanumeric': 0.13955956487131865, 'fraction_numerical': 0.003183868400106129, 'mean_word_length': 4.576923076923077, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '490293', 'n_tokens_mistral': 1431, 'n_tokens_neox': 1378, 'n_words': 351}