diff options
Diffstat (limited to '.config')
-rw-r--r-- | .config/pacman/makepkg.conf | 40 |
1 files changed, 30 insertions, 10 deletions
diff --git a/.config/pacman/makepkg.conf b/.config/pacman/makepkg.conf index 2e627b8..fe64828 100644 --- a/.config/pacman/makepkg.conf +++ b/.config/pacman/makepkg.conf @@ -9,16 +9,36 @@ PACKAGER="Luke Shumaker <lukeshu@sbcglobal.net>" MAKEFLAGS="-j$(($(nproc)+1))" -if type ccache &>/dev/null; then - f=false +lukeshu_set_BUILDENV() { + local thing=$1 + local i for i in "${!BUILDENV[@]}"; do - if [[ "${BUILDENV[$i]}" == '!ccache' ]]; then - BUILDENV[$i]='ccache' - f=true - fi + case "${BUILDENV[$i]}" in + "!${thing#!}"|"${thing#!}") + BUILDENV[$i]=$thing + return + ;; + esac + done + BUILDENV+=("$thing") +} + +lukeshu_set_OPTIONS() { + local thing=$1 + local i + for i in "${!OPTIONS[@]}"; do + case "${OPTIONS[$i]}" in + "!${thing#!}"|"${thing#!}") + OPTIONS[$i]=$thing + return + ;; + esac done - if [[ $f == false ]]; then - BUILDENV+=('ccache') - fi - unset f i + OPTIONS+=("$thing") +} + +lukeshu_set_OPTIONS debug + +if type ccache &>/dev/null; then + lukeshu_set_BUILDENV ccache fi |