<commit_before>#!/bin/bash

#
# Sync kcdialog/ and ksettings/ with kdelibs
#
# (c) 2003 <NAME> <<EMAIL>>
#
# Feel free to (ab)use this script in any way you like, no need
# to credit me, as long as you don't blame me for anything that goes
# wrong, even when using the script 'as is' :)
#

if [ -z "$1" ]
then
    echo "Sync compat/ with the files from kdelibs HEAD."
    echo
    echo "Usage: $0 [--check] path-to-kdelibs-sources"
    exit 1
fi

cd `dirname $0`

DIR="$1"
if [ ! -d "$DIR" ]
then
    echo "Cannot find kdelibs dir '$DIR'!"
    exit 2
fi

echo "Checking path names..."
KDE_CORE=""
KDE_UI=""
K_UTILS=""
K_SETTINGS=""
NOT_FOUND=""
IGNORE_FILES='(Makefile|\.diff$|\.patch$|CVS|README$|\.cvsignore$|sync.sh$|dummy.cpp$)'

for i in `find -type f | egrep -v "$IGNORE_FILES"`
do
    FILE="`basename $i`"
    if [ -e "$DIR/kutils/$FILE" ]
    then
        K_UTILS="$K_UTILS $FILE"
    elif [ -e "$DIR/kutils/ksettings/$FILE" ]
    then
        K_SETTINGS="$K_SETTINGS $FILE"
    elif [ -e "$DIR/kdecore/$FILE" ]
    then
        KDE_CORE="$KDE_CORE $FILE"
    elif [ -e "$DIR/kdeui/$FILE" ]
    then
        KDE_UI="$KDE_UI $FILE"
    else
        NOT_FOUND="$NOT_FOUND $FILE"
    fi
done

if [ -n "$KDE_CORE" ]
then
    echo "* $DIR/kdecore:"
    echo "    $KDE_CORE"
fi
if [ -n "$KDE_UI" ]
then
    echo "* $DIR/kdeui:"
    echo "    $KDE_UI"
fi
if [ -n "$K_UTILS" ]
then
    echo "* $DIR/kutils:"
    echo "    $K_UTILS"
fi
if [ -n "$K_SETTINGS" ]
then
    echo "* $DIR/kutils/ksettings:"
    echo "    $K_SETTINGS"
fi
if [ -n "$NOT_FOUND" ]
then
    echo "* Not found:"
    echo "    $NOT_FOUND"
fi

echo
read -p "Ok to sync? [y/N] " -n1 RESULT
echo

if [ "$RESULT" != "y" -a "$RESULT" != "Y" ]
then
    echo
    echo "Exiting without update."
    exit 0
fi

echo "Copying files..."
echo

for i in `find -type f | egrep -v "$IGNORE_FILES"`
do
    FILE="`basename $i`"
    if [ -e "$DIR/kutils/$FILE" ]
    then
        FILE="$DIR/kutils/$FILE"
    elif [ -e "$DIR/kutils/ksettings/$FILE" ]
    then
        FILE="$DIR/kutils/ksettings/$FILE"
    elif [ -e "$DIR/kdecore/$FILE" ]
    then
        FILE="$DIR/kdecore/$FILE"
    elif [ -e "$DIR/kdeui/$FILE" ]
    then
        FILE="$DIR/kdeui/$FILE"
    else
        continue
    fi
    cp -v "$FILE" "$i"
done

echo "Done."
echo
echo "Applying patches..."

FAILED=""

for i in `find -type d | egrep -v "CVS"`
do
    cd "$i"
    for j in `ls *.diff *.patch 2>/dev/null`
    do
        echo "Applying $i/$j"
        echo
        patch -p0 < "$j"
        [ $? -ne 0 ] && FAILED="$FAILED $i/$j"
    done
    cd -
done

echo "Done."
if [ -n "$FAILED" ]<commit_msg>Some files are in kdelibs/kio now, search there too<commit_after>#!/bin/bash

#
# Sync kcdialog/ and ksettings/ with kdelibs
#
# (c) 2003 <NAME> <<EMAIL>>
#
# Feel free to (ab)use this script in any way you like, no need
# to credit me, as long as you don't blame me for anything that goes
# wrong, even when using the script 'as is' :)
#

if [ -z "$1" ]
then
    echo "Sync compat/ with the files from kdelibs HEAD."
    echo
    echo "Usage: $0 path-to-kdelibs-sources"
    exit 1
fi

cd `dirname $0`

DIR="$1"
if [ ! -d "$DIR" ]
then
    echo "Cannot find kdelibs dir '$DIR'!"
    exit 2
fi

echo "Checking path names..."
KDE_CORE=""
KDE_UI=""
K_UTILS=""
K_SETTINGS=""
KIO=""
NOT_FOUND=""
IGNORE_FILES='(Makefile|\.diff$|\.patch$|CVS|README$|\.cvsignore$|sync.sh$|dummy.cpp$)'

for i in `find -type f | egrep -v "$IGNORE_FILES"`
do
    FILE="`basename $i`"
    if [ -e "$DIR/kutils/$FILE" ]
    then
        K_UTILS="$K_UTILS $FILE"
    elif [ -e "$DIR/kutils/ksettings/$FILE" ]
    then
        K_SETTINGS="$K_SETTINGS $FILE"
    elif [ -e "$DIR/kdecore/$FILE" ]
    then
        KDE_CORE="$KDE_CORE $FILE"
    elif [ -e "$DIR/kdeui/$FILE" ]
    then
        KDE_UI="$KDE_UI $FILE"
    elif [ -e "$DIR/kio/$FILE" ]
    then
        KIO="$KIO $FILE"
    else
        NOT_FOUND="$NOT_FOUND $FILE"
    fi
done

if [ -n "$KDE_CORE" ]
then
    echo "* $DIR/kdecore:"
    echo "    $KDE_CORE"
fi
if [ -n "$KDE_UI" ]
then
    echo "* $DIR/kdeui:"
    echo "    $KDE_UI"
fi
if [ -n "$KIO" ]
then
    echo "* $DIR/kio:"
    echo "    $KIO"
fi
if [ -n "$K_UTILS" ]
then
    echo "* $DIR/kutils:"
    echo "    $K_UTILS"
fi
if [ -n "$K_SETTINGS" ]
then
    echo "* $DIR/kutils/ksettings:"
    echo "    $K_SETTINGS"
fi
if [ -n "$NOT_FOUND" ]
then
    echo "* Not found:"
    echo "    $NOT_FOUND"
fi

echo
read -p "Ok to sync? [y/N] " -n1 RESULT
echo

if [ "$RESULT" != "y" -a "$RESULT" != "Y" ]
then
    echo
    echo "Exiting without update."
    exit 0
fi

echo "Copying files..."
echo

for i in `find -type f | egrep -v "$IGNORE_FILES"`
do
    FILE="`basename $i`"
    if [ -e "$DIR/kutils/$FILE" ]
    then
        FILE="$DIR/kutils/$FILE"
    elif [ -e "$DIR/kutils/ksettings/$FILE" ]
    then
        FILE="$DIR/kutils/ksettings/$FILE"
    elif [ -e "$DIR/kdecore/$FILE" ]
    then
        FILE="$DIR/kdecore/$FILE"
    elif [ -e "$DIR/kdeui/$FILE" ]
    then
        FILE="$DIR/kdeui/$FILE"
    elif [ -e "$DIR/kio/$FILE" ]
    then
        FILE="$DIR/kio/$FILE"
    else
        continue
    fi
    cp -v "$FILE" "$i"
done

echo "Done."
echo
echo "Applying patches..."

FAILED=""

for i in `find -type d | egrep -v "CVS"`
do
    cd "$i"
    for j in `ls *.diff *.patch 2>/dev/null`
    do
        echo "Applying $i/$j"
        echo
        patch -p0 < "$j"
        [ $? -ne 0 ] && FAILED="$FAILED $i/$j"
    done
    cd -
done

echo "Done."
if [ -n "$FAILED" ]
{'fraction_non_alphanumeric': 0.17511856986501276, 'fraction_numerical': 0.005472455308281649, 'mean_word_length': 2.2773460848774656, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '5290961', 'n_tokens_mistral': 2276, 'n_tokens_neox': 2249, 'n_words': 624}