<commit_before>#!/usr/bin/env bash

KERNEL_VERSION_RPI1=3.18.0-trunk-rpi
KERNEL_VERSION_RPI2=3.18.0-trunk-rpi2

RASPBIAN_ARCHIVE_KEY_DIRECTORY="https://archive.raspbian.org/"
RASPBIAN_ARCHIVE_KEY_FILE_NAME="raspbian.public.key"
RASPBIAN_ARCHIVE_KEY_URL="${RASPBIAN_ARCHIVE_KEY_DIRECTORY}${RASPBIAN_ARCHIVE_KEY_FILE_NAME}"
RASPBIAN_ARCHIVE_KEY_FINGERPRINT="A0DA38D0D76E8B5D638872819165938D90FDDD2E"

RASPBERRYPI_ARCHIVE_KEY_DIRECTORY="https://archive.raspberrypi.org/debian/"
RASPBERRYPI_ARCHIVE_KEY_FILE_NAME="raspberrypi.gpg.key"
RASPBERRYPI_ARCHIVE_KEY_URL="${RASPBERRYPI_ARCHIVE_KEY_DIRECTORY}${RASPBERRYPI_ARCHIVE_KEY_FILE_NAME}"
RASPBERRYPI_ARCHIVE_KEY_FINGERPRINT="<KEY>"

mirror=http://archive.raspbian.org/raspbian/
release=jessie

# programs
packages="$packages raspberrypi-bootloader-nokernel"
packages="$packages linux-image-${KERNEL_VERSION_RPI1}"
packages="$packages linux-image-${KERNEL_VERSION_RPI2}"
packages="$packages btrfs-tools"
packages="$packages busybox-static"
packages="$packages cdebootstrap-static"
packages="$packages dosfstools"
packages="$packages e2fslibs"
packages="$packages e2fsprogs"
packages="$packages f2fs-tools"
packages="$packages gpgv"
packages="$packages raspbian-archive-keyring"

# libraries
packages="$packages libblkid1"
packages="$packages libbz2-1.0"
packages="$packages libc6"
packages="$packages libcomerr2"
packages="$packages libgcc1"
packages="$packages liblzo2-2"
packages="$packages libuuid1"
packages="$packages zlib1g"

packages_found=
packages_debs=
packages_sha256=

check_key() {
    # param 1 = keyfile
    # param 2 = key fingerprint

    # check input parameters
    if [ -z $1 ] || [ ! -f $1 ] ; then
        echo "Parameter 1 of check_key() is not a file!"
        return 1
    fi

    if [ -z $2 ] ; then
        echo "Parameter 2 of check_key() is not a key fingerprint!"
        return 1
    fi

    KEY_FILE="$1"
    KEY_FINGERPRINT="$2"

    echo -n "Checking key file '${KEY_FILE}'... "

    # check that there is only 1 public key in the key file
    if [ ! $(gpg --with-colons ${KEY_FILE} | grep ^pub: | wc -l) -eq 1 ] ; then
        echo "FAILED!"
        echo "There are zero or more then one keys in the ${KEY_FILE} key file!"
        return 1
    fi

    # check that the key file's fingerprint is correct
    if [ "$(gpg --with-colons ${KEY_FILE} | grep ^fpr: | awk -F: '{print $10}')" != "${KEY_FINGERPRINT}" ] ; then
        echo "FAILED!"
        echo "Bad GPG key fingerprint for ${KEY_FILE}!"
        return 1
    fi<commit_msg>Fixed misspelling.<commit_after>#!/usr/bin/env bash

KERNEL_VERSION_RPI1=3.18.0-trunk-rpi
KERNEL_VERSION_RPI2=3.18.0-trunk-rpi2

RASPBIAN_ARCHIVE_KEY_DIRECTORY="https://archive.raspbian.org/"
RASPBIAN_ARCHIVE_KEY_FILE_NAME="raspbian.public.key"
RASPBIAN_ARCHIVE_KEY_URL="${RASPBIAN_ARCHIVE_KEY_DIRECTORY}${RASPBIAN_ARCHIVE_KEY_FILE_NAME}"
RASPBIAN_ARCHIVE_KEY_FINGERPRINT="A0DA38D0D76E8B5D638872819165938D90FDDD2E"

RASPBERRYPI_ARCHIVE_KEY_DIRECTORY="https://archive.raspberrypi.org/debian/"
RASPBERRYPI_ARCHIVE_KEY_FILE_NAME="raspberrypi.gpg.key"
RASPBERRYPI_ARCHIVE_KEY_URL="${RASPBERRYPI_ARCHIVE_KEY_DIRECTORY}${RASPBERRYPI_ARCHIVE_KEY_FILE_NAME}"
RASPBERRYPI_ARCHIVE_KEY_FINGERPRINT="<KEY>"

mirror=http://archive.raspbian.org/raspbian/
release=jessie

# programs
packages="$packages raspberrypi-bootloader-nokernel"
packages="$packages linux-image-${KERNEL_VERSION_RPI1}"
packages="$packages linux-image-${KERNEL_VERSION_RPI2}"
packages="$packages btrfs-tools"
packages="$packages busybox-static"
packages="$packages cdebootstrap-static"
packages="$packages dosfstools"
packages="$packages e2fslibs"
packages="$packages e2fsprogs"
packages="$packages f2fs-tools"
packages="$packages gpgv"
packages="$packages raspbian-archive-keyring"

# libraries
packages="$packages libblkid1"
packages="$packages libbz2-1.0"
packages="$packages libc6"
packages="$packages libcomerr2"
packages="$packages libgcc1"
packages="$packages liblzo2-2"
packages="$packages libuuid1"
packages="$packages zlib1g"

packages_found=
packages_debs=
packages_sha256=

check_key() {
    # param 1 = keyfile
    # param 2 = key fingerprint

    # check input parameters
    if [ -z $1 ] || [ ! -f $1 ] ; then
        echo "Parameter 1 of check_key() is not a file!"
        return 1
    fi

    if [ -z $2 ] ; then
        echo "Parameter 2 of check_key() is not a key fingerprint!"
        return 1
    fi

    KEY_FILE="$1"
    KEY_FINGERPRINT="$2"

    echo -n "Checking key file '${KEY_FILE}'... "

    # check that there is only 1 public key in the key file
    if [ ! $(gpg --with-colons ${KEY_FILE} | grep ^pub: | wc -l) -eq 1 ] ; then
        echo "FAILED!"
        echo "There are zero or more than one keys in the ${KEY_FILE} key file!"
        return 1
    fi

    # check that the key file's fingerprint is correct
    if [ "$(gpg --with-colons ${KEY_FILE} | grep ^fpr: | awk -F: '{print $10}')" != "${KEY_FINGERPRINT}" ] ; then
        echo "FAILED!"
        echo "Bad GPG key fingerprint for ${KEY_FILE}!"
        return 1
    fi
{'fraction_non_alphanumeric': 0.12512432862542272, 'fraction_numerical': 0.029043166898746767, 'mean_word_length': 4.694224235560589, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '698484', 'n_tokens_mistral': 1902, 'n_tokens_neox': 1791, 'n_words': 374}