<commit_before>#!/bin/bash
# -*- shell-script -*-

initialize()
{
  unset LD_PRELOAD
  unset XALT_TRANSMISSION_STYLE
  export XALT_EXECUTABLE_TRACKING=no

  ORIG_HOME=`(cd $HOME; /bin/pwd)`
  HOME=`/bin/pwd`
  numStep=0
  COUNT=0

  rm -f  _stderr.* _stdout.* out.* err.* 
  rm -rf .xalt.d syslog.* reverseMapD
  XALT_EPOCH_T0=$(python $projectDir/src/xalt_epoch.py)

}

displayThis()
{
  XALT_EPOCH_T1=$(LD_PRELOAD= $outputDir/XALT/xalt/xalt/libexec/xalt_epoch "$XALT_EPOCH_T0")
  echo 
  echo "#==========================================================#"
  echo "  $@"
  echo "  ($XALT_EPOCH_T1)"
  echo "#==========================================================#"
}

buildRmapT()
{
  echo "<build xalt_rmapT.json and jsonReverseMapT.json files>"
  mkdir reverseMapD
  MPATH=${LMOD_DEFAULT_MODULEPATH-$MODULEPATH}
  $LMOD_DIR/spider -o xalt_rmapT      $MPATH > $outputDir/reverseMapD/xalt_rmapT.json
  $LMOD_DIR/spider -o jsonReverseMapT $MPATH > $outputDir/reverseMapD/jsonReverseMapT.json
  echo "<finish>"
}

installXALT()
{
  rm -rf XALT build
  mkdir build
  if [ -n "$1" ]; then
      HOST_PARSER_OPT=--with-hostnameParser=$1
  fi

  (cd build; echo "<configure>";$projectDir/configure --prefix $outputDir/XALT --with-etcDir=$outputDir --with-syshostConfig=nth_name:2 --with-config=$projectDir/Config/rtm_config.py $HOST_PARSER_OPT ; \
  echo "<make>"; make OPTLVL="-g -O0" install ;  )
  cp $projectDir/src/removeDataBase.py    XALT/xalt/xalt/sbin
  cp $projectDir/test/check_entries_db.py XALT/xalt/xalt/sbin
  PATH=$outputDir/XALT/xalt/xalt/bin:$outputDir/XALT/xalt/xalt/sbin:$PATH;
  echo "<end make>"
}

installDB()
{
  echo "<create db>"
  DBNAME=testxalt
  DB_CONF_FN=testxalt_db.conf
  DBUSER=xaltTest
  PASSWD=<PASSWORD>

  conf_create.py     --dbhost localhost --dbuser $DBUSER \
                     --passwd $PASSWD   --dbname $DBNAME
  echo "<remove old DB>"
  removeDataBase.py  --dbname $DBNAME  > /dev/null 2>&1

  echo "<create new DB>"
  createDB.py        --confFn $DB_CONF_FN
  rm -f xalt_db.conf 
  ln -s testxalt_db.conf xalt_db.conf 
  echo "<end create db>"
}

runMe ()
{
   COUNT=$(($COUNT + 1))
   numStep=$(($numStep+1))
   NUM=$(printf "%02d" $numStep)
   echo "===========================" >  _stderr.$NUM
   echo "step $COUNT"                 >> _stderr.$NUM
   echo "$@"                          >> _stderr.$NUM
   echo "===========================" >> _stderr.$NUM

   echo "===========================" >  _stdout.$NUM
   echo "step $COUNT"                 >> _stdout.$NUM
   echo "$@"                          >> _stdout.$NUM
   echo "===========================" >> _stdout.$NUM

   numStep=$(($numStep+1))
   NUM=$(printf "%02d" $numStep)
   "$@" > _stdout.$NUM 2>> _stderr.$NUM
}
<commit_msg>let the installXALT function take configure options<commit_after>#!/bin/bash
# -*- shell-script -*-

initialize()
{
  unset LD_PRELOAD
  unset XALT_TRANSMISSION_STYLE
  export XALT_EXECUTABLE_TRACKING=no

  ORIG_HOME=`(cd $HOME; /bin/pwd)`
  HOME=`/bin/pwd`
  numStep=0
  COUNT=0

  rm -f  _stderr.* _stdout.* out.* err.* 
  rm -rf .xalt.d syslog.* reverseMapD
  XALT_EPOCH_T0=$(python $projectDir/src/xalt_epoch.py)

}

displayThis()
{
  XALT_EPOCH_T1=$(LD_PRELOAD= $outputDir/XALT/xalt/xalt/libexec/xalt_epoch "$XALT_EPOCH_T0")
  echo 
  echo "#==========================================================#"
  echo "  $@"
  echo "  ($XALT_EPOCH_T1)"
  echo "#==========================================================#"
}

buildRmapT()
{
  echo "<build xalt_rmapT.json and jsonReverseMapT.json files>"
  mkdir reverseMapD
  MPATH=${LMOD_DEFAULT_MODULEPATH-$MODULEPATH}
  $LMOD_DIR/spider -o xalt_rmapT      $MPATH > $outputDir/reverseMapD/xalt_rmapT.json
  $LMOD_DIR/spider -o jsonReverseMapT $MPATH > $outputDir/reverseMapD/jsonReverseMapT.json
  echo "<finish>"
}

installXALT()
{
  rm -rf XALT build
  mkdir build

  (cd build; echo "<configure>";$projectDir/configure --prefix $outputDir/XALT --with-etcDir=$outputDir --with-syshostConfig=nth_name:2 --with-config=$projectDir/Config/rtm_config.py "$@" ; \
  echo "<make>"; make OPTLVL="-g -O0" install ;  )
  cp $projectDir/src/removeDataBase.py    XALT/xalt/xalt/sbin
  cp $projectDir/test/check_entries_db.py XALT/xalt/xalt/sbin
  PATH=$outputDir/XALT/xalt/xalt/bin:$outputDir/XALT/xalt/xalt/sbin:$PATH;
  echo "<end make>"
}

installDB()
{
  echo "<create db>"
  DBNAME=testxalt
  DB_CONF_FN=testxalt_db.conf
  DBUSER=xaltTest
  PASSWD=<PASSWORD>

  conf_create.py     --dbhost localhost --dbuser $DBUSER \
                     --passwd $<PASSWORD>   --dbname $DBNAME
  echo "<remove old DB>"
  removeDataBase.py  --dbname $DBNAME  > /dev/null 2>&1

  echo "<create new DB>"
  createDB.py        --confFn $DB_CONF_FN
  rm -f xalt_db.conf 
  ln -s testxalt_db.conf xalt_db.conf 
  echo "<end create db>"
}

runMe ()
{
   COUNT=$(($COUNT + 1))
   numStep=$(($numStep+1))
   NUM=$(printf "%02d" $numStep)
   echo "===========================" >  _stderr.$NUM
   echo "step $COUNT"                 >> _stderr.$NUM
   echo "$@"                          >> _stderr.$NUM
   echo "===========================" >> _stderr.$NUM

   echo "===========================" >  _stdout.$NUM
   echo "step $COUNT"                 >> _stdout.$NUM
   echo "$@"                          >> _stdout.$NUM
   echo "===========================" >> _stdout.$NUM

   numStep=$(($numStep+1))
   NUM=$(printf "%02d" $numStep)
   "$@" > _stdout.$NUM 2>> _stderr.$NUM
}

{'fraction_non_alphanumeric': 0.22557497700091997, 'fraction_numerical': 0.006991720331186752, 'mean_word_length': 3.352281825460368, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 66, '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': '722390', 'n_tokens_mistral': 2113, 'n_tokens_neox': 1979, 'n_words': 353}