<commit_before>#!/bin/sh

set -eu

srcdir="$(realpath -m "$0"/..)"

(cd "${srcdir}" && autoreconf -is --warnings obsolete)
[ -n "${NOCONFIGURE:-}" ] && exit

case "${1:-}" in
    rpm)
        # configure with the same flags as when building an RPM
        mkdir -p tmp/rpmbuild/SPECS
        tools/create-spec -v 0 -o tmp/rpmbuild/SPECS/cockpit.spec tools/cockpit.spec.in
        exec rpmbuild -D '_topdir tmp/rpmbuild' -D 'make_build #' \
            --build-in-place -bc tmp/rpmbuild/SPECS/cockpit.spec ;;

    *)
        exec "${srcdir}/configure" "$@" ;;
esac
<commit_msg>autogen.sh: add a 'mock' option<commit_after>#!/bin/sh

set -eu

srcdir="$(realpath -m "$0"/..)"

(cd "${srcdir}" && autoreconf -is --warnings obsolete)
[ -n "${NOCONFIGURE:-}" ] && exit

case "${1:-}" in
    mock)
        # broken configuration with as few deps as possible
        # mostly only useful for running `make dep`
        exec ./autogen.sh \
            CPPFLAGS=-Itools/mock-build-env \
            PKG_CONFIG_PATH=tools/mock-build-env \
            --enable-prefix-only \
            --disable-pcp \
            --disable-polkit \
            --disable-ssh \
        ;;

    rpm)
        # configure with the same flags as when building an RPM
        mkdir -p tmp/rpmbuild/SPECS
        tools/create-spec -v 0 -o tmp/rpmbuild/SPECS/cockpit.spec tools/cockpit.spec.in
        exec rpmbuild -D '_topdir tmp/rpmbuild' -D 'make_build #' \
            --build-in-place -bc tmp/rpmbuild/SPECS/cockpit.spec ;;

    *)
        exec "${srcdir}/configure" "$@" ;;
esac

{'fraction_non_alphanumeric': 0.1592520954223082, 'fraction_numerical': 0.0038684719535783366, 'mean_word_length': 2.013592233009709, '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': '2161096', 'n_tokens_mistral': 552, 'n_tokens_neox': 531, 'n_words': 130}