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

koopa::fedora_install_base() { # {{{1
    # """
    # Install Fedora base system.
    # @note Updated 2021-03-25.
    #
    # Use '<pkg>-<version>' to pin package versions.
    #
    # Refer to Debian install base script for more details on supported args.
    # """
    local dict dnf name_fancy pkgs pos
    dnf='dnf'
    if ! koopa::is_installed dnf && koopa::is_installed yum
    then
        dnf='yum'
    fi
    koopa::assert_is_installed "$dnf" sudo
    declare -A dict=(
        [base]=1
        [dev]=1
        [extra]=0
        [recommended]=1
        [upgrade]=1
    )
    pos=()
    while (("$#"))
    do
        case "$1" in
            --base-image)
                dict[base]=1
                dict[dev]=0
                dict[extra]=0
                dict[recommended]=0
                dict[upgrade]=0
                shift 1
                ;;
            --default|--recommended)
                shift 1
                ;;
            --full)
                dict[base]=1
                dict[dev]=1
                dict[extra]=1
                dict[recommended]=1
                dict[upgrade]=1
                shift 1
                ;;
            "")
                shift 1
                ;;
            --)
                shift 1
                break
                ;;
            --*|-*)
                koopa::invalid_arg "$1"
                ;;
            *)
                pos+=("$1")
                shift 1
                ;;
        esac
    done
    [[ "${#pos[@]}" -gt 0 ]] && set -- "${pos[@]}"
    koopa::assert_has_no_args "$#"
    name_fancy='Fedora base system'
    koopa::install_start "$name_fancy"
    if [[ "${dict[recommended]}" -eq 1 ]] && koopa::is_rhel_ubi
    then
        koopa::stop 'Recommended configuration not yet supported for RHEL UBI.'
    fi
    if [[ "${dict[upgrade]}" -eq 1 ]]
    then
        koopa::alert "Upgrading install via '${dnf} update'."
        sudo "$dnf" -y update
    fi
    pkgs=()
    if [[ "${dict[base]}" -eq 1 ]]
    then
        pkgs+=(
            'autoconf'
            'bash'
            'bc'
            'bzip2'
            'curl'
            'findutils'
            'gcc'
            'gcc-c++'
            'gettext'
            'git'
            'glibc-langpack-en'
            'glibc-locale-source'
            'less'
            'make'
            'man-db'
            'ncurses-devel'  # zsh
            'patch'  # bash
            'sudo'
            'tar'
            'unzip'
            'xz'
        )
    fi
    if [[ "${dict[recommended]}" -eq 1 ]]
    then
        pkgs+=(
            #                                                       | RHEL UBI |
            # ------------------------------------------------------|----------|<commit_msg>Add procps<commit_after>#!/usr/bin/env bash

koopa::fedora_install_base() { # {{{1
    # """
    # Install Fedora base system.
    # @note Updated 2021-05-15.
    #
    # Use '<pkg>-<version>' to pin package versions.
    #
    # Refer to Debian install base script for more details on supported args.
    # """
    local dict dnf name_fancy pkgs pos
    dnf='dnf'
    if ! koopa::is_installed dnf && koopa::is_installed yum
    then
        dnf='yum'
    fi
    koopa::assert_is_installed "$dnf" sudo
    declare -A dict=(
        [base]=1
        [dev]=1
        [extra]=0
        [recommended]=1
        [upgrade]=1
    )
    pos=()
    while (("$#"))
    do
        case "$1" in
            --base-image)
                dict[base]=1
                dict[dev]=0
                dict[extra]=0
                dict[recommended]=0
                dict[upgrade]=0
                shift 1
                ;;
            --default|--recommended)
                shift 1
                ;;
            --full)
                dict[base]=1
                dict[dev]=1
                dict[extra]=1
                dict[recommended]=1
                dict[upgrade]=1
                shift 1
                ;;
            "")
                shift 1
                ;;
            --)
                shift 1
                break
                ;;
            --*|-*)
                koopa::invalid_arg "$1"
                ;;
            *)
                pos+=("$1")
                shift 1
                ;;
        esac
    done
    [[ "${#pos[@]}" -gt 0 ]] && set -- "${pos[@]}"
    koopa::assert_has_no_args "$#"
    name_fancy='Fedora base system'
    koopa::install_start "$name_fancy"
    if [[ "${dict[recommended]}" -eq 1 ]] && koopa::is_rhel_ubi
    then
        koopa::stop 'Recommended configuration not yet supported for RHEL UBI.'
    fi
    if [[ "${dict[upgrade]}" -eq 1 ]]
    then
        koopa::alert "Upgrading install via '${dnf} update'."
        sudo "$dnf" -y update
    fi
    pkgs=()
    if [[ "${dict[base]}" -eq 1 ]]
    then
        pkgs+=(
            'autoconf'
            'bash'
            'bc'
            'bzip2'
            'curl'
            'findutils'
            'gcc'
            'gcc-c++'
            'gettext'
            'git'
            'glibc-langpack-en'
            'glibc-locale-source'
            'less'
            'make'
            'man-db'
            'ncurses-devel'  # zsh
            'patch'  # bash
            'procps'  # ps
            'sudo'
            'tar'
            'unzip'
            'xz'
        )
    fi
    if [[ "${dict[recommended]}" -eq 1 ]]
    then
        pkgs+=(
            #                                                       | RHEL UBI |
            # ------------------------------------------------------|----------|
{'fraction_non_alphanumeric': 0.1522361359570662, 'fraction_numerical': 0.013953488372093023, 'mean_word_length': 0.9603786816269285, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4823263', 'n_tokens_mistral': 1806, 'n_tokens_neox': 1612, 'n_words': 351}