<commit_before>#!/usr/bin/env bash

set -o errexit
set -o pipefail

fatal() {
  printf "%s\n" "$@"
  exit 1
}

install_tools() {
  echo "Creating symlinks for binaries found in /native (e.g., mdata-*, dtrace, prstat etc.)"
  # /native/usr/bin
  ln -s /native/usr/bin/mdb /usr/bin/mdb
  ln -s /native/usr/bin/pcred /usr/bin/pcred
  ln -s /native/usr/bin/pfiles /usr/bin/pfiles
  ln -s /native/usr/bin/pflags /usr/bin/pflags
  ln -s /native/usr/bin/pldd /usr/bin/pldd
  ln -s /native/usr/bin/prstat /usr/bin/prstat
  ln -s /native/usr/bin/prun /usr/bin/prun
  ln -s /native/usr/bin/psig /usr/bin/psig
  ln -s /native/usr/bin/pstack /usr/bin/pstack
  ln -s /native/usr/bin/pstop /usr/bin/pstop
  ln -s /native/usr/bin/ptime /usr/bin/ptime
  ln -s /native/usr/bin/pwait /usr/bin/pwait
  ln -s /native/usr/bin/pwdx /usr/bin/pwdx
  ln -s /native/usr/bin/truss /usr/bin/truss
  ln -s /native/usr/bin/kstat /usr/bin/kstat
  
  # /native/sbin
  ln -s /native/usr/sbin/cpustat /usr/sbin/cpustat
  ln -s /native/usr/sbin/dtrace /usr/sbin/dtrace
  ln -s /native/usr/sbin/mdata-get /usr/sbin/mdata-get
  ln -s /native/usr/sbin/mdata-put /usr/sbin/mdata-put
  ln -s /native/usr/sbin/mdata-delete /usr/sbin/mdata-delete
  ln -s /native/usr/sbin/mdata-list /usr/sbin/mdata-list
  ln -s /native/usr/sbin/plockstat /usr/sbin/plockstat
  
  
  echo "Copying mdata-* man pages"
  cp -r ./usr/share/man/man1/mdata-* /usr/share/man/man1/
  
  echo "Adding wrapper scripts"
  cp ./usr/bin/* /usr/bin/
  cp ./usr/sbin/* /usr/sbin/
}

install_debian() {
  install_tools
  echo "Installing custom rc.local file to /etc/rc.local..."
  cp ./lib/smartdc/joyent_rc.local /etc/rc.local
}

install_redhat() {
  install_tools
  echo "Installing custom rc.local file to /etc/rc.d/rc.local..."<commit_msg>added symlink for zonename<commit_after>#!/usr/bin/env bash

set -o errexit
set -o pipefail

fatal() {
  printf "%s\n" "$@"
  exit 1
}

install_tools() {
  echo "Creating symlinks for binaries found in /native (e.g., mdata-*, dtrace, prstat etc.)"
  # /native/usr/bin
  ln -s /native/usr/bin/mdb /usr/bin/mdb
  ln -s /native/usr/bin/pcred /usr/bin/pcred
  ln -s /native/usr/bin/pfiles /usr/bin/pfiles
  ln -s /native/usr/bin/pflags /usr/bin/pflags
  ln -s /native/usr/bin/pldd /usr/bin/pldd
  ln -s /native/usr/bin/prstat /usr/bin/prstat
  ln -s /native/usr/bin/prun /usr/bin/prun
  ln -s /native/usr/bin/psig /usr/bin/psig
  ln -s /native/usr/bin/pstack /usr/bin/pstack
  ln -s /native/usr/bin/pstop /usr/bin/pstop
  ln -s /native/usr/bin/ptime /usr/bin/ptime
  ln -s /native/usr/bin/pwait /usr/bin/pwait
  ln -s /native/usr/bin/pwdx /usr/bin/pwdx
  ln -s /native/usr/bin/truss /usr/bin/truss
  ln -s /native/usr/bin/kstat /usr/bin/kstat
  ln -s /native/usr/bin/zonename /usr/bin/zonename
  
  # /native/sbin
  ln -s /native/usr/sbin/cpustat /usr/sbin/cpustat
  ln -s /native/usr/sbin/dtrace /usr/sbin/dtrace
  ln -s /native/usr/sbin/mdata-get /usr/sbin/mdata-get
  ln -s /native/usr/sbin/mdata-put /usr/sbin/mdata-put
  ln -s /native/usr/sbin/mdata-delete /usr/sbin/mdata-delete
  ln -s /native/usr/sbin/mdata-list /usr/sbin/mdata-list
  ln -s /native/usr/sbin/plockstat /usr/sbin/plockstat
  
  
  echo "Copying mdata-* man pages"
  cp -r ./usr/share/man/man1/mdata-* /usr/share/man/man1/
  
  echo "Adding wrapper scripts"
  cp ./usr/bin/* /usr/bin/
  cp ./usr/sbin/* /usr/sbin/
}

install_debian() {
  install_tools
  echo "Installing custom rc.local file to /etc/rc.local..."
  cp ./lib/smartdc/joyent_rc.local /etc/rc.local
}

install_redhat() {
  install_tools
  echo "Installing custom rc.local file to /etc/rc.d/rc.local..."
{'fraction_non_alphanumeric': 0.16925638179800223, 'fraction_numerical': 0.001664816870144284, 'mean_word_length': 2.47972972972973, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2717622', 'n_tokens_mistral': 1655, 'n_tokens_neox': 1588, 'n_words': 320}