<commit_before>#!/usr/bin/env bash
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#

# take a .zip containing a flat hierarchy of odf files and strip out the
# language and country tags in each of them and repack it all up
# should convert templates so that documents based on them use
# the default-document-language rather than the hardcoded lang-tag
#
# All a bit hacky, but it should work

tempfoo=`basename $0`

XSL=`mktemp /tmp/${tempfoo}.XXXXXX`
if [ $? -ne 0 ]; then
    echo "$0: Can't create temp file, exiting..."
    exit 1
fi

# On Windows, xsltproc is a non-Cygwin program, so we can't pass
# a Cygwin /tmp path to it
[ "$COM" == MSC ] && XSL=`cygpath -m -s $XSL`

WRKDIR=`mktemp -d /tmp/${tempfoo}.XXXXXX`
if [ $? -ne 0 ]; then
    echo "$0: Can't create temp dir, exiting..."
    exit 1
fi

cat > $XSL << EOF<commit_msg>check if $CALLXSLTPROC is defined and bail out if not<commit_after>#!/usr/bin/env bash
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#

# take a .zip containing a flat hierarchy of odf files and strip out the
# language and country tags in each of them and repack it all up
# should convert templates so that documents based on them use
# the default-document-language rather than the hardcoded lang-tag
#
# All a bit hacky, but it should work

if [ -z "$CALLXSLTPROC" ]; then
    echo "$0: \$CALLXSLTPROC not defined!"
    echo "$0: Apparently we are not called from the build process, bailing out."
    exit 1
fi

tempfoo=`basename $0`

XSL=`mktemp /tmp/${tempfoo}.XXXXXX`
if [ $? -ne 0 ]; then
    echo "$0: Can't create temp file, exiting..."
    exit 1
fi

# On Windows, xsltproc is a non-Cygwin program, so we can't pass
# a Cygwin /tmp path to it
[ "$COM" == MSC ] && XSL=`cygpath -m -s $XSL`

WRKDIR=`mktemp -d /tmp/${tempfoo}.XXXXXX`
if [ $? -ne 0 ]; then
    echo "$0: Can't create temp dir, exiting..."
    exit 1
fi

cat > $XSL << EOF
{'fraction_non_alphanumeric': 0.11392405063291139, 'fraction_numerical': 0.010912265386294195, 'mean_word_length': 3.2523191094619666, 'pattern_counts': {'":': 0, '<': 7, '<?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': '645057', 'n_tokens_mistral': 807, 'n_tokens_neox': 760, 'n_words': 347}