#!/bin/bash declare -A config errmsg() { printf "Error in %s: %s\n" "${FUNCNAME[1]}" "$1" >&2 } config_parse() { # Usage: config_parse if [[ ! -f "$1" ]]; then errmsg "config file '$1' doesn't exist" exit 1 fi while IFS== read -r option value <(pacini "$1"); do config["$option"]=$value done } makepkg_run() { # Usage: makepkg_run PKGDEST="$1" shift 1 makepkg "$@" } # If not running interactively, don't do anything # Allows for using these functions as commands by sourcing this script [[ $- != *i* ]] && return config_parse "${CONFIG_FILE:-/etc/tl-makepkg.conf}" makepkg_run "${config[RepoDir]}" "${config[MakepkgOpts]} $@" repose "${config[ReposeOpts]}" --root "${config[MakepkgOpts]}" --pool "${config[MakepkgOpts]}" "${config[DBFile]}"