<commit_before>#!/bin/sh

PKGNAME=mssql-server
SUPPORTEDARCHES="x86_64"
DESCRIPTION="MS SQL Server 2019 from the official site"

DEBREPO="deb http://ftp.ru.debian.org/debian/ stretch main"

if [ "$1" = "--remove" ] ; then
    epm remove $PKGNAME
    echo
    echo "Check data directory /var/opt/mssql if you need remove it too."
    exit
fi

. $(dirname $0)/common.sh


serv mssql-server stop

case "$($DISTRVENDOR -d)" in
  "AstraLinux")
    # we have libc++1-9, but this package requires libc++1
    epm ar $DEBREPO ; epm update
    epm install libc++1
    epm install https://packages.microsoft.com/ubuntu/20.04/mssql-server-2019/pool/main/m/mssql-server/mssql-server_1*_amd64.deb
    epm rr $DEBREPO ; epm update
    ;;
  ALTLinux|ALTServer)
    epm install --repack https://packages.microsoft.com/rhel/8/mssql-server-2019/mssql-server-1*.x86_64.rpm || fatal
    ;;
  *)
    fatal "$(DISTRVENDOR -d) is not supported yet."
    ;;
esac

if [ -z "$EPM_AUTO" ] ; then
    $SUDO /opt/mssql/bin/mssql-conf setup accept-eula
    serv mssql-server on
else
cat <<EOF
Run follow commands manually for complete the setup:
    # /opt/mssql/bin/mssql-conf setup accept-eula<commit_msg>epm play mssql-server: fix error message<commit_after>#!/bin/sh

PKGNAME=mssql-server
SUPPORTEDARCHES="x86_64"
DESCRIPTION="MS SQL Server 2019 from the official site"

DEBREPO="deb http://ftp.ru.debian.org/debian/ stretch main"

if [ "$1" = "--remove" ] ; then
    epm remove $PKGNAME
    echo
    echo "Check data directory /var/opt/mssql if you need remove it too."
    exit
fi

. $(dirname $0)/common.sh


serv mssql-server stop

case "$($DISTRVENDOR -d)" in
  "AstraLinux")
    # we have libc++1-9, but this package requires libc++1
    epm ar $DEBREPO ; epm update
    epm install libc++1
    epm install https://packages.microsoft.com/ubuntu/20.04/mssql-server-2019/pool/main/m/mssql-server/mssql-server_1*_amd64.deb
    epm rr $DEBREPO ; epm update
    ;;
  ALTLinux|ALTServer)
    epm install --repack https://packages.microsoft.com/rhel/8/mssql-server-2019/mssql-server-1*.x86_64.rpm || fatal
    ;;
  *)
    fatal "$($DISTRVENDOR -d) is not supported yet."
    ;;
esac

if [ -z "$EPM_AUTO" ] ; then
    $SUDO /opt/mssql/bin/mssql-conf setup accept-eula
    serv mssql-server on
else
cat <<EOF
Run follow commands manually for complete the setup:
    # /opt/mssql/bin/mssql-conf setup accept-eula
{'fraction_non_alphanumeric': 0.1330814441645676, 'fraction_numerical': 0.02938706968933669, 'mean_word_length': 3.217699115044248, 'pattern_counts': {'":': 0, '<': 7, '<?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': '2188992', 'n_tokens_mistral': 974, 'n_tokens_neox': 892, 'n_words': 222}