<commit_before>#!/bin/sh
#
# Copyright (c) 2004-2006, 2009 <NAME> <<EMAIL>>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
#      - Redistributions of source code must retain the above
#        copyright notice, this list of conditions and the
#        following disclaimer.
#
#      - Redistributions in binary form must reproduce the above
#        copyright notice, this list of conditions and the
#        following disclaimer in the documentation and/or other
#        materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
# autogen.sh - Generates all the necessary files to build calcurse from
# cvs tree.
#

PKG_NAME=calcurse
AC_VERSION="2 59"
AUTOCONF_VERSION=2.59
AC_FLAGS=
AM_VERSION="1 9"
AUTOMAKE_VERSION=1.9
AM_FLAGS="--foreign --copy --add-missing"
GETTEXT_VERSION="0 14"
GETTEXT_FLAGS="--copy --no-changelog"
ACLOCAL_FLAGS="-I m4"
SRCDIR=`dirname $0`
test -z "$SRCDIR" && SRCDIR=.
export AUTOMAKE_VERSION AUTOCONF_VERSION

# Function to check if we are at the top level of calcurse package.
check_directory_level()
{
        (test -f $SRCDIR/configure.ac) || {
                printf "\n\n**Error**: Directory "\`$SRCDIR\'" does not appear to"
                printf "\nbe the top-level $PKG_NAME directory.\n"
                exit 1
        }
}

# Clean previous files before running scripts
clean_old_files()
{
        printf "Cleaning old files ... "
        rm -rf configure config.log aclocal.m4 \
                config.status config autom4te.cache \
                po/Makefile.in.in ABOUT-NLS
        printf "done\n"
}

# Clean useless backup files
clean_backup_files()
{
	printf "Cleaning backup files ... "
	rm -rf configure.ac\~ Makefile.am\~
	printf "done\n"
}

# Function to check for a program availability
check_program()
{
        PROGRAM=$1
        printf "Checking for $PROGRAM ... "
        ($PROGRAM --version) < /dev/null > /dev/null 2>&1 || {
                printf "\n\n**Error**: You must have $PROGRAM installed."
                printf "\nDownload the appropriate package for your distribution,"
                printf "\nor get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
		printf "\n"
                exit 1
        }
	FOUND=`which $PROGRAM`
	printf "$FOUND\n"
}

# Function to check a program's version
# (there must be a better way, but I am not good at sed...)
check_program_version()
{
        PROGRAM=$1; MAJOR=$2; MINOR=$3
        printf "Checking that $PROGRAM version is at least $MAJOR.$MINOR ... "
        VERSION=`$PROGRAM --version |head -n 1|sed 's/([^)]*)//g;s/^[a-zA-Z\.\ \
                \-]*//;s/ .*$//'`                
        MAJOR_FOUND=`echo $VERSION | cut -d. -f1`
        MINOR_FOUND=`echo $VERSION | sed s/[-,a-z,A-Z].*// | cut -d. -f2`
        [ -z "$MINOR_FOUND" ] && MINOR_FOUND=0
        
        WRONG=
        if [ -z "$MAJOR_FOUND" -lt "$MAJOR" ]; then
                WRONG=1
        elif [ "$MAJOR_FOUND" -eq "$MAJOR" ]; then
                if [ "$MINOR_FOUND" -lt "$MINOR" ]; then
                        WRONG=1
                fi
        fi        
        if [ ! -z "$WRONG" ]; then
                printf "\n\n**Error**: found version $MAJOR_FOUND.$MINOR_FOUND,"
                printf "\nwhich is too old. You should upgrade $PROGRAM."
                printf "\nDownload the appropriate package for your distribution,"
                printf "\nor get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
                printf "\n"
                exit 1
        else
                printf "OK, found $MAJOR_FOUND.$MINOR_FOUND\n"<commit_msg>Quick fix for "autogen.sh" version comparison breakage.<commit_after>#!/bin/sh
#
# Copyright (c) 2004-2006, 2009 <NAME> <<EMAIL>>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
#      - Redistributions of source code must retain the above
#        copyright notice, this list of conditions and the
#        following disclaimer.
#
#      - Redistributions in binary form must reproduce the above
#        copyright notice, this list of conditions and the
#        following disclaimer in the documentation and/or other
#        materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
# autogen.sh - Generates all the necessary files to build calcurse from
# cvs tree.
#

PKG_NAME=calcurse
AC_VERSION="2 59"
AUTOCONF_VERSION=2.59
AC_FLAGS=
AM_VERSION="1 9"
AUTOMAKE_VERSION=1.9
AM_FLAGS="--foreign --copy --add-missing"
GETTEXT_VERSION="0 14"
GETTEXT_FLAGS="--copy --no-changelog"
ACLOCAL_FLAGS="-I m4"
SRCDIR=`dirname $0`
test -z "$SRCDIR" && SRCDIR=.
export AUTOMAKE_VERSION AUTOCONF_VERSION

# Function to check if we are at the top level of calcurse package.
check_directory_level()
{
        (test -f $SRCDIR/configure.ac) || {
                printf "\n\n**Error**: Directory "\`$SRCDIR\'" does not appear to"
                printf "\nbe the top-level $PKG_NAME directory.\n"
                exit 1
        }
}

# Clean previous files before running scripts
clean_old_files()
{
        printf "Cleaning old files ... "
        rm -rf configure config.log aclocal.m4 \
                config.status config autom4te.cache \
                po/Makefile.in.in ABOUT-NLS
        printf "done\n"
}

# Clean useless backup files
clean_backup_files()
{
	printf "Cleaning backup files ... "
	rm -rf configure.ac\~ Makefile.am\~
	printf "done\n"
}

# Function to check for a program availability
check_program()
{
        PROGRAM=$1
        printf "Checking for $PROGRAM ... "
        ($PROGRAM --version) < /dev/null > /dev/null 2>&1 || {
                printf "\n\n**Error**: You must have $PROGRAM installed."
                printf "\nDownload the appropriate package for your distribution,"
                printf "\nor get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
		printf "\n"
                exit 1
        }
	FOUND=`which $PROGRAM`
	printf "$FOUND\n"
}

# Function to check a program's version
# (there must be a better way, but I am not good at sed...)
check_program_version()
{
        PROGRAM=$1; MAJOR=$2; MINOR=$3
        printf "Checking that $PROGRAM version is at least $MAJOR.$MINOR ... "
        VERSION=`$PROGRAM --version | head -n 1 | rev | cut -d' ' -f1 | rev`
        MAJOR_FOUND=`echo $VERSION | cut -d. -f1`
        MINOR_FOUND=`echo $VERSION | sed 's/[a-zA-Z-].*//' | cut -d. -f2`
        [ -z "$MINOR_FOUND" ] && MINOR_FOUND=0
        
        WRONG=
        if [ "$MAJOR_FOUND" -lt "$MAJOR" ]; then
                WRONG=1
        elif [ "$MAJOR_FOUND" -eq "$MAJOR" ]; then
                if [ "$MINOR_FOUND" -lt "$MINOR" ]; then
                        WRONG=1
                fi
        fi        
        if [ ! -z "$WRONG" ]; then
                printf "\n\n**Error**: found version $MAJOR_FOUND.$MINOR_FOUND,"
                printf "\nwhich is too old. You should upgrade $PROGRAM."
                printf "\nDownload the appropriate package for your distribution,"
                printf "\nor get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
                printf "\n"
                exit 1
        else
                printf "OK, found $MAJOR_FOUND.$MINOR_FOUND\n"
{'fraction_non_alphanumeric': 0.10692890245280887, 'fraction_numerical': 0.01005990731321352, 'mean_word_length': 2.4148977228869164, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5149430', 'n_tokens_mistral': 2808, 'n_tokens_neox': 2575, 'n_words': 945}