<commit_before>#!/bin/bash

# File:  release.sh
# Copyright (C) 2004 The Institute for System Programming of the Russian Academy of Sciences (ISP RAS)

# This is script for making release of the Sedna system.
# Unfortunately, it depends on the environment of MODIS group and
# will not work in other places without modification


failwith() {
  echo "Error: $*" 1>&2
  exit 1
}

##### SCRIPT USAGE ############################################################
usage() {
    echo "Usage"
    echo "    $0" " local          - build local release"
    echo "    $0" " release        - build release"
    echo "    $0" " release_ftp    - build release and put it to modis.ispras.ru"
    echo
    failwith "Wrong arguments"
}


if test $# -ne 1; then
    usage;
else
   if test $1 "!=" "release" -a $1 "!=" "release_ftp" -a $1 "!=" "local"; then
       usage;
   fi
fi
##### SCRIPT USAGE ############################################################


lookfor() {
  save_IFS="${IFS}"
  IFS="${IFS}:"
  for dir in $PATH; do
    if test -x "$dir/$1"; then
      eval "$1=$dir/$1"
      IFS="$save_IFS"
      return
    fi
  done
  IFS="$save_IFS"
  failwith "Could not find \"$1\"."
}


if test "x$SEDNA_INSTALL" = "x"; then
  failwith "SEDNA_INSTALL is not set up"
fi

lookfor uname
lookfor cat
lookfor cp
lookfor rm
lookfor mv
lookfor tar

export OS=`uname` || failwith "Cannot mine operating system name"
export SEDNA_VERSION=`cat ver` || failwith "Cannot read ver file"
export BUILD_FILE=build-$SEDNA_VERSION
export MD5_EXT=md5

if test "$OS" "=" "Linux"; then

  export BUILD_SUFFIX=linux
  export BUILD_PLATFORM=""
  export DISTR_EXT=sh
  export SRC_EXT=tar.gz
  export SQL_CONNECTION=0
  MAKE_COMMAND=make
  MD5=md5sum
  OS_TYPE=nix

elif test "$OS" "=" "Darwin"; then

  export BUILD_SUFFIX=darwin
  export BUILD_PLATFORM=`uname -p` || failwith "Cannot mine platform type"
  export DISTR_EXT=sh
  export SRC_EXT=tar.gz
  export SQL_CONNECTION=0
  MAKE_COMMAND=make
  MD5=md5
  OS_TYPE=nix

elif test "$OS" "=" "FreeBSD"; then

  export BUILD_SUFFIX=freebsd
  export BUILD_PLATFORM=`uname -p` || failwith "Cannot mine platform type"
  export DISTR_EXT=sh
  export SRC_EXT=tar.gz
  export SQL_CONNECTION=0
  MAKE_COMMAND=gmake
  MD5=md5
  OS_TYPE=nix

elif test "$OS" "=" "SunOS"; then

  export BUILD_SUFFIX=sunos
  export BUILD_PLATFORM=`uname -p` || failwith "Cannot mine platform type"
  export DISTR_EXT=sh
  export SRC_EXT=tar.gz
  export SQL_CONNECTION=0
  MAKE_COMMAND=gmake
  MD5=digest -a md5
  OS_TYPE=nix

else  #Windows (Cygwin)

  export BUILD_SUFFIX=win
  export BUILD_PLATFORM=""
  export DISTR_EXT=tar.gz
  export SRC_EXT=tar.gz
  export SQL_CONNECTION=1
  MAKE_COMMAND=make
  MD5=md5sum
  OS_TYPE=win

fi<commit_msg>one more fix to create md5 under Solaris<commit_after>#!/bin/bash

# File:  release.sh
# Copyright (C) 2004 The Institute for System Programming of the Russian Academy of Sciences (ISP RAS)

# This is script for making release of the Sedna system.
# Unfortunately, it depends on the environment of MODIS group and
# will not work in other places without modification


failwith() {
  echo "Error: $*" 1>&2
  exit 1
}

##### SCRIPT USAGE ############################################################
usage() {
    echo "Usage"
    echo "    $0" " local          - build local release"
    echo "    $0" " release        - build release"
    echo "    $0" " release_ftp    - build release and put it to modis.ispras.ru"
    echo
    failwith "Wrong arguments"
}


if test $# -ne 1; then
    usage;
else
   if test $1 "!=" "release" -a $1 "!=" "release_ftp" -a $1 "!=" "local"; then
       usage;
   fi
fi
##### SCRIPT USAGE ############################################################


lookfor() {
  save_IFS="${IFS}"
  IFS="${IFS}:"
  for dir in $PATH; do
    if test -x "$dir/$1"; then
      eval "$1=$dir/$1"
      IFS="$save_IFS"
      return
    fi
  done
  IFS="$save_IFS"
  failwith "Could not find \"$1\"."
}


if test "x$SEDNA_INSTALL" = "x"; then
  failwith "SEDNA_INSTALL is not set up"
fi

lookfor uname
lookfor cat
lookfor cp
lookfor rm
lookfor mv
lookfor tar

export OS=`uname` || failwith "Cannot mine operating system name"
export SEDNA_VERSION=`cat ver` || failwith "Cannot read ver file"
export BUILD_FILE=build-$SEDNA_VERSION
export MD5_EXT=md5

if test "$OS" "=" "Linux"; then

  export BUILD_SUFFIX=linux
  export BUILD_PLATFORM=""
  export DISTR_EXT=sh
  export SRC_EXT=tar.gz
  export SQL_CONNECTION=0
  MAKE_COMMAND=make
  MD5=md5sum
  OS_TYPE=nix

elif test "$OS" "=" "Darwin"; then

  export BUILD_SUFFIX=darwin
  export BUILD_PLATFORM=`uname -p` || failwith "Cannot mine platform type"
  export DISTR_EXT=sh
  export SRC_EXT=tar.gz
  export SQL_CONNECTION=0
  MAKE_COMMAND=make
  MD5=md5
  OS_TYPE=nix

elif test "$OS" "=" "FreeBSD"; then

  export BUILD_SUFFIX=freebsd
  export BUILD_PLATFORM=`uname -p` || failwith "Cannot mine platform type"
  export DISTR_EXT=sh
  export SRC_EXT=tar.gz
  export SQL_CONNECTION=0
  MAKE_COMMAND=gmake
  MD5=md5
  OS_TYPE=nix

elif test "$OS" "=" "SunOS"; then

  export BUILD_SUFFIX=sunos
  export BUILD_PLATFORM=`uname -p` || failwith "Cannot mine platform type"
  export DISTR_EXT=sh
  export SRC_EXT=tar.gz
  export SQL_CONNECTION=0
  MAKE_COMMAND=gmake
  MD5="digest -a md5"
  OS_TYPE=nix

else  #Windows (Cygwin)

  export BUILD_SUFFIX=win
  export BUILD_PLATFORM=""
  export DISTR_EXT=tar.gz
  export SRC_EXT=tar.gz
  export SQL_CONNECTION=1
  MAKE_COMMAND=make
  MD5=md5sum
  OS_TYPE=win

fi
{'fraction_non_alphanumeric': 0.14824257876525224, 'fraction_numerical': 0.012930249499180478, 'mean_word_length': 3.78397212543554, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '42083', 'n_tokens_mistral': 2059, 'n_tokens_neox': 1968, 'n_words': 584}