<commit_before>#!/bin/bash
# Load env vars to ensure that pod2man is available in $PATH
. /etc/profile

[ -e ~/.makepkg.conf ] || cat > ~/.makepkg.conf <<'EOF'
PACKAGER="<NAME> <<EMAIL>>"
MAKEFLAGS="-j$(nproc)"
# See also http://stackoverflow.com/a/27076307/427545
  DEBUG_CFLAGS+=" -ggdb"
DEBUG_CXXFLAGS+=" -ggdb"
OPTIONS+=(debug)
EOF

# Non-interactive
exec </dev/null
error() {
    printf '\e[31;1m%s\e[m\n' "$@"
    exit 1
}

cd /shared || exit 1
if [ -f commands -a -x commands ]; then
    ./commands || error "command returned exit code $?"
elif [ -e PKGBUILD ]; then
    sudo pacman-db-upgrade # Installed using pacman 4.1.2, runs 4.2
    if [ -f buildrc ]; then
        # can be used to load additional environment variables or more generally
        # invoke commands before running makepkg.
        . ./buildrc || error "buildrc returned exit code $?"
    fi
    # Hide stdout to avoid clogging journald. Use tail -F build.log instead
    script -f -e -c \
        'time makepkg -s --noconfirm' \
        build.log >/dev/null
    rc=$?
    pacman -Q > package-versions.txt
    ls -l *.pkg.tar.*
    [ $rc -eq 0 ] || error "makepkg returned exit code $rc"
    [ -e .noshutdown ] || sudo shutdown -h now
else
    error "Expecting PKGBUILD or an executable 'commands', found none!"
fi<commit_msg>build.sh: allow BUILD_OUTDIR to by specified<commit_after>#!/bin/bash
# Load env vars to ensure that pod2man is available in $PATH
. /etc/profile

[ -e ~/.makepkg.conf ] || cat > ~/.makepkg.conf <<'EOF'
PACKAGER="<NAME> <<EMAIL>>"
MAKEFLAGS="-j$(nproc)"
# See also http://stackoverflow.com/a/27076307/427545
  DEBUG_CFLAGS+=" -ggdb"
DEBUG_CXXFLAGS+=" -ggdb"
OPTIONS+=(debug)
EOF

# Non-interactive
exec </dev/null
error() {
    printf '\e[31;1m%s\e[m\n' "$@"
    exit 1
}

cd /shared || exit 1
if [ -f commands -a -x commands ]; then
    ./commands || error "command returned exit code $?"
elif [ -e PKGBUILD ]; then
    sudo pacman-db-upgrade # Installed using pacman 4.1.2, runs 4.2
    # Output logs and packages to this directory by default
    BUILD_OUTDIR=$(pwd)
    if [ -f buildrc ]; then
        # can be used to load additional environment variables or more generally
        # invoke commands before running makepkg.
        . ./buildrc || error "buildrc returned exit code $?"
    fi
    # Hide stdout to avoid clogging journald. Use tail -F build.log instead
    PKGDEST=$BUILD_OUTDIR \
    script -f -e -c \
        'time makepkg -s --noconfirm' \
        "$BUILD_OUTDIR/build.log" >/dev/null
    rc=$?
    pacman -Q > "$BUILD_OUTDIR/package-versions.txt"
    ls -l "$BUILD_OUTDIR"/*.pkg.tar.*
    [ $rc -eq 0 ] || error "makepkg returned exit code $rc"
    [ -e .noshutdown ] || sudo shutdown -h now
else
    error "Expecting PKGBUILD or an executable 'commands', found none!"
fi
{'fraction_non_alphanumeric': 0.14158026456918127, 'fraction_numerical': 0.018591347872720772, 'mean_word_length': 2.77088948787062, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '5959561', 'n_tokens_mistral': 1006, 'n_tokens_neox': 954, 'n_words': 311}