From 94ca0038f5b5091364076a3cd42b6a0c00f526de Mon Sep 17 00:00:00 2001 From: David Thurstenson Date: Tue, 7 Feb 2017 09:22:51 -0600 Subject: [PATCH] Remove config_parse() because it was causing trouble. Might as well just run pacini every time I want to fetch an option. --- PKGBUILD | 4 ++-- tl-makepkg | 20 +++++--------------- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 1f8e826..b3d7e18 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,6 +1,6 @@ # Maintainer: David Thurstenson pkgname=tl-makepkg -pkgver=0.6 +pkgver=0.7 pkgrel=1 pkgdesc="Small utility for running makepkg, then repose to add a local non-AUR package to a custom repo" arch=('any') @@ -10,7 +10,7 @@ depends=('repose' 'pacutils') backup=('etc/tl-makepkg.conf') source=('tl-makepkg' 'tl-makepkg.conf') -md5sums=('a241835872805ff68ffc4e0bc687d778' +md5sums=('db3a09f25da6e05d53e19b20c1e563ce' '938de8daea15f68500e969df422fd7fa') package() { diff --git a/tl-makepkg b/tl-makepkg index b741fdf..7baee36 100644 --- a/tl-makepkg +++ b/tl-makepkg @@ -2,27 +2,17 @@ declare -A config +conf="${CONFIG_FILE:-/etc/tl-makepkg.conf}" + 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 "$@" + makepkg $@ } -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]}" +PKGDEST=$(pacini $conf RepoDir) makepkg $@ $(pacini $conf MakepkgOpts) +repose $(pacini $conf ReposeOpts) --root $(pacini $conf RepoDir) --pool $(pacini $conf RepoDir) $(pacini $conf DBFile)