<commit_before>#!/bin/bash

echo "## Step 00: initialize"
(
  if ! [ -d build ]; then
    mkdir build
    mkdir build/src
    mkdir build/src/trunk
  fi
)

fetch() {
(
  cd src
  if ! [ -f "${2}/.svn/entries" ]; then
    mkdir "${2}"
    cd "${2}"
    svn co --non-interactive --trust-server-cert "${1}" "."
  else
    cd "${2}"
    svn cleanup
    svn up
  fi
)
}

gitfetch() {
(
  cd src
  if ! [ -f "${2}/.git/config" ]; then
    git clone "${1}" "${2}"
    git checkout origin/"${3}"
  else
    cd "${2}"
    git pull
    git checkout origin/"${3}"
  fi
)
}

fetchall() {
  gitfetch "git://github.com/Flowdalic/smack.git" "smack" "experimental"
  fetch "http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/management/common/src/main/" "qpid"
  fetch "http://svn.apache.org/repos/asf/harmony/enhanced/java/trunk/classlib/modules/auth/src/main/java/common/" "harmony"
  fetch "https://dnsjava.svn.sourceforge.net/svnroot/dnsjava/trunk" "dnsjava"
#  fetch "https://kenai.com/svn/jbosh~main/trunk/jbosh/src/main/java" "jbosh"
  gitfetch "git://kenai.com/jbosh~origin" "jbosh" "master"
}

copyfolder() {
(
  (
    cd "${1}"
    tar -cSsp --exclude-vcs "${3}"
  ) | (
    cd "${2}"
    tar -xSsp
  )
)
}

buildsrc() {
  echo "## Step 20: creating build/src"
  rm -rf build/src
  mkdir build/src
  mkdir build/src/trunk
  copyfolder "src/smack/source/" "build/src/trunk" "."
  copyfolder "src/qpid/java" "build/src/trunk" "org/apache/qpid/management/common/sasl"
  copyfolder "src/novell-openldap-jldap" "build/src/trunk" "."
  copyfolder "src/dnsjava"  "build/src/trunk" "org"
  copyfolder "src/harmony" "build/src/trunk" "."
  copyfolder "src/custom" "build/src/trunk" "."
  copyfolder "src/jbosh/src/main/java" "build/src/trunk" "."
}<commit_msg>added openldap-jldap<commit_after>#!/bin/bash

echo "## Step 00: initialize"
(
  if ! [ -d build ]; then
    mkdir build
    mkdir build/src
    mkdir build/src/trunk
  fi
)

fetch() {
(
  cd src
  if ! [ -f "${2}/.svn/entries" ]; then
    mkdir "${2}"
    cd "${2}"
    svn co --non-interactive --trust-server-cert "${1}" "."
  else
    cd "${2}"
    svn cleanup
    svn up
  fi
)
}

gitfetch() {
(
  cd src
  if ! [ -f "${2}/.git/config" ]; then
    git clone "${1}" "${2}"
    git checkout origin/"${3}"
  else
    cd "${2}"
    git pull
    git checkout origin/"${3}"
  fi
)
}

fetchall() {
  gitfetch "git://github.com/Flowdalic/smack.git" "smack" "master"
  fetch "http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/management/common/src/main/" "qpid"
  fetch "http://svn.apache.org/repos/asf/harmony/enhanced/java/trunk/classlib/modules/auth/src/main/java/common/" "harmony"
  fetch "https://dnsjava.svn.sourceforge.net/svnroot/dnsjava/trunk" "dnsjava"
#  fetch "https://kenai.com/svn/jbosh~main/trunk/jbosh/src/main/java" "jbosh"
  gitfetch "git://kenai.com/jbosh~origin" "jbosh" "master"
  gitfetch "git://git.openldap.org/openldap-jldap.git" "novell-openldap-jldap" "master"
}

copyfolder() {
(
  (
    cd "${1}"
    tar -cSsp --exclude-vcs "${3}"
  ) | (
    cd "${2}"
    tar -xSsp
  )
)
}

buildsrc() {
  echo "## Step 20: creating build/src"
  rm -rf build/src
  mkdir build/src
  mkdir build/src/trunk
  copyfolder "src/smack/source/" "build/src/trunk" "."
  copyfolder "src/qpid/java" "build/src/trunk" "org/apache/qpid/management/common/sasl"
  copyfolder "src/novell-openldap-jldap" "build/src/trunk" "."
  copyfolder "src/dnsjava"  "build/src/trunk" "org"
  copyfolder "src/harmony" "build/src/trunk" "."
  copyfolder "src/custom" "build/src/trunk" "."
  copyfolder "src/jbosh/src/main/java" "build/src/trunk" "."
}
{'fraction_non_alphanumeric': 0.19787887245325148, 'fraction_numerical': 0.010047446274072006, 'mean_word_length': 2.9558498896247243, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, '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': '6453416', 'n_tokens_mistral': 1533, 'n_tokens_neox': 1466, 'n_words': 267}