<commit_before>#!/bin/bash

# Linux Headers

set -e
set -u

. settings/config
. scripts/utils/utils.sh

pkg_dir="$(locate_package 'linux')"

. "${pkg_dir}/package.mk"

cd "${CLFS_SOURCES}/"
if [ ! -d "${CLFS_SOURCES}/${PKG_NAME}" ]; then
    git clone --depth 1 "${PKG_URL}" --progress
fi

cd "${CLFS_SOURCES}/${PKG_NAME}/"

# make sure source is clean
make mrproper

# ensure we have the latest source and correct version
git fetch
cur_branch="$(git symbolic-ref --short -q HEAD)"
if [ "${cur_branch}" != "rpi-${KERNEL_VERSION}.y" ]; then
    git reset --hard "origin/${cur_branch}"
    git checkout "rpi-${KERNEL_VERSION}.y"
fi
git reset --hard "origin/rpi-${KERNEL_VERSION}.y"

# make sure source is clean
make mrproper

# start headers build
make ARCH="${CLFS_ARCH}" headers_check

# install the headers
make ARCH="${CLFS_ARCH}" INSTALL_HDR_PATH="${CLFS_TOOLS}/${CLFS_TARGET}" headers_install
<commit_msg>--depth tag doesn't get the proper branch, so just fetch the target branch<commit_after>#!/bin/bash

# Linux Headers

set -e
set -u

. settings/config
. scripts/utils/utils.sh

pkg_dir="$(locate_package 'linux')"

. "${pkg_dir}/package.mk"

cd "${CLFS_SOURCES}/"
if [ ! -d "${CLFS_SOURCES}/${PKG_NAME}" ]; then
    git clone "${PKG_URL}" --branch "rpi-${KERNEL_VERSION}.y" --single-branch --progress
fi

cd "${CLFS_SOURCES}/${PKG_NAME}/"

# make sure source is clean
make mrproper

# ensure we have the latest source and correct version
git fetch
cur_branch="$(git symbolic-ref --short -q HEAD)"
if [ "${cur_branch}" != "rpi-${KERNEL_VERSION}.y" ]; then
    git reset --hard "origin/${cur_branch}"
    git checkout "rpi-${KERNEL_VERSION}.y"
fi
git reset --hard "origin/rpi-${KERNEL_VERSION}.y"

# make sure source is clean
make mrproper

# start headers build
make ARCH="${CLFS_ARCH}" headers_check

# install the headers
make ARCH="${CLFS_ARCH}" INSTALL_HDR_PATH="${CLFS_TOOLS}/${CLFS_TARGET}" headers_install

{'fraction_non_alphanumeric': 0.16354166666666667, 'fraction_numerical': 0.0005208333333333333, 'mean_word_length': 4.504297994269341, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2116414', 'n_tokens_mistral': 706, 'n_tokens_neox': 673, 'n_words': 185}