diff --git a/PKGBUILD b/PKGBUILD index 4ca8883..2eafa24 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,17 +1,17 @@ # Maintainer: David Thurstenson pkgname=tl-makepkg -pkgver=0.4 +pkgver=0.5 pkgrel=1 pkgdesc="Small utility for running makepkg, then repose to add a local non-AUR package to a custom repo" arch=('any') url="https://git.thurstylark.com/tl-makepkg.git/" license=('GPL') depends=('repose' 'pacutils') -backup=(etc/tl-makepkg.conf) +backup=('etc/tl-makepkg.conf') source=('tl-makepkg' 'tl-makepkg.conf') -md5sums=('6f1d3fa62e88d68ab683bc4ee8755737' - 'bd876524e71c61fd6682041351a192c4') +md5sums=('bdaea613965516d9fbab7f688d75c859' + '938de8daea15f68500e969df422fd7fa') package() { install -Dm755 tl-makepkg ${pkgdir}/usr/bin/tl-makepkg diff --git a/tl-makepkg b/tl-makepkg index f68cb59..959c2d8 100644 --- a/tl-makepkg +++ b/tl-makepkg @@ -3,7 +3,7 @@ declare -A config errmsg() { - echo "Error in ${FUNCNAME[1]}: $1" >&2 + printf "Error in %s: %s\n" "${FUNCNAME[1]}" "$1" >&2 } config_parse() { # Usage: config_parse @@ -12,11 +12,9 @@ config_parse() { # Usage: config_parse exit 1 fi - while IFS='' read -r line || [[ -n "$line" ]]; do - local option=${line%%= *} - local value=${line##* =} # ref: http://wiki.bash-hackers.org/syntax/pe#substring_removal + while IFS== read -r option value <(pacini "$1"); do config["$option"]=$value - done < <(pacini "$1") # Thanks to alad for showing me pacini + done } makepkg_run() { # Usage: makepkg_run @@ -25,14 +23,10 @@ makepkg_run() { # Usage: makepkg_run makepkg "$@" } -repose_run() { # Usage: repose_run - repose $1 --root "$2" --pool "$2" "$3" -} - # 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_run "${config[ReposeOpts]}" "${config[RepoDir]}" "${config[DBFile]}" +repose "${config[ReposeOpts]}" --root "${config[MakepkgOpts]}" --pool "${config[MakepkgOpts]}" "${config[DBFile]}" diff --git a/tl-makepkg.conf b/tl-makepkg.conf index 78dcce0..908df21 100644 --- a/tl-makepkg.conf +++ b/tl-makepkg.conf @@ -1,6 +1,6 @@ # /etc/tl-makepkg.conf # -# All options should be in a 'NAME=VALUE' format. +# All options should be in a 'NAME = VALUE' format. # Syntax shamelessly copied from pacman.conf(5). # # Any lines that start with '#' are ignored.